Fix TakePOS receipt preview in admin

Receipt preview in admin shows header and footer repeating themselves because in preview, `$constFreeText` equals `TAKEPOS_HEADER` (as there is no `$_SESSION['takeposterminal']` defined).
This commit is contained in:
Adnan RIHAN 2023-08-19 12:25:40 +02:00
parent 126634229f
commit e2f587dd80
No known key found for this signature in database
GPG key ID: F3306402D4335C63

View file

@ -111,7 +111,7 @@ if (!empty($hookmanager->resPrint)) {
<br>
<p class="left">
<?php
$constFreeText = 'TAKEPOS_HEADER'.$_SESSION['takeposterminal'];
$constFreeText = 'TAKEPOS_HEADER'.($_SESSION['takeposterminal'] ?? '0');
if (!empty($conf->global->TAKEPOS_HEADER) || getDolGlobalString($constFreeText)) {
$newfreetext = '';
$substitutionarray = getCommonSubstitutionArray($langs);
@ -352,7 +352,7 @@ if (getDolGlobalString('TAKEPOS_PRINT_PAYMENT_METHOD')) {
<br>
<br>
<?php
$constFreeText = 'TAKEPOS_FOOTER'.$_SESSION['takeposterminal'];
$constFreeText = 'TAKEPOS_FOOTER'.($_SESSION['takeposterminal'] ?? '0');
if (!empty($conf->global->TAKEPOS_FOOTER) || !empty($conf->global->{$constFreeText})) {
$newfreetext = '';
$substitutionarray = getCommonSubstitutionArray($langs);