diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php
index 6f042d7f10e..54e5de37a5c 100644
--- a/htdocs/takepos/admin/terminal.php
+++ b/htdocs/takepos/admin/terminal.php
@@ -94,6 +94,10 @@ if (GETPOST('action', 'alpha') == 'set')
$res = dolibarr_set_const($db, "TAKEPOS_ADDON".$terminaltouse, GETPOST('TAKEPOS_ADDON'.$terminaltouse, 'alpha'), 'chaine', 0, '', $conf->entity);
+ // add free text on each terminal of cash desk
+ $res = dolibarr_set_const($db, 'TAKEPOS_HEADER'.$terminaltouse, GETPOST('TAKEPOS_HEADER'.$terminaltouse, 'none'), 'chaine', 0, '', $conf->entity);
+ $res = dolibarr_set_const($db, 'TAKEPOS_FOOTER'.$terminaltouse, GETPOST('TAKEPOS_FOOTER'.$terminaltouse, 'none'), 'chaine', 0, '', $conf->entity);
+
dol_syslog("admin/cashdesk: level ".GETPOST('level', 'alpha'));
if (!$res > 0) $error++;
@@ -324,6 +328,57 @@ if ($conf->global->TAKEPOS_ADDON == "terminal") {
print '';
print '';
+// add free text on each terminal of cash desk
+$substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
+$substitutionarray['__(AnyTranslationKey)__'] = $langs->trans('Translation');
+$htmltext = '' . $langs->trans('AvailableVariables') . ':
';
+foreach ($substitutionarray as $key => $val) $htmltext .= $key . '
';
+$htmltext .= '';
+
+print '
';
+print load_fiche_titre($langs->trans('FreeLegalTextOnInvoices'), '', '');
+
+print '
| ' . $langs->trans("Parameters") . ' | ' . $langs->trans('Value') . ' | '; +print '
| ';
+print $form->textwithpicto($langs->trans('Header'), $htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').' '; +print ' | ';
+print ''; +$variablename = 'TAKEPOS_HEADER' . $terminaltouse; +if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { + print ''; +} else { + include_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; + $doleditor = new DolEditor($variablename, $conf->global->{$variablename}, '', 80, 'dolibarr_notes'); + print $doleditor->Create(); +} +print ' |
| ';
+print $form->textwithpicto($langs->trans('Footer'), $htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').' '; +print ' | ';
+print ''; +$variablename = 'TAKEPOS_FOOTER' . $terminaltouse; +if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) { + print ''; +} else { + include_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; + $doleditor = new DolEditor($variablename, $conf->global->{$variablename}, '', 80, 'dolibarr_notes'); + print $doleditor->Create(); +} +print ' |
global->TAKEPOS_HEADER)) +$constFreeText = 'TAKEPOS_HEADER' . $_SESSION['takeposterminal']; +if (!empty($conf->global->TAKEPOS_HEADER) || !empty($conf->global->{$constFreeText})) { + $newfreetext = ''; $substitutionarray = getCommonSubstitutionArray($langs); - if (!empty($conf->global->TAKEPOS_HEADER)) - $newfreetext = make_substitutions($conf->global->TAKEPOS_HEADER, $substitutionarray); - echo $newfreetext; + if (!empty($conf->global->TAKEPOS_HEADER)) $newfreetext .= make_substitutions($conf->global->TAKEPOS_HEADER, $substitutionarray); + if (!empty($conf->global->{$constFreeText})) $newfreetext .= make_substitutions($conf->global->{$constFreeText}, $substitutionarray); + print $newfreetext; } ?>
@@ -183,11 +185,14 @@ if ($conf->global->TAKEPOS_SHOW_CUSTOMER)