FIX TakePOS receipt preview in admin #25648

Receipt preview in admin shows header and footer repeating themselves because in preview, $constFreeText equals TAKEPOS_HEADER (as there is no $_SESSION['takeposterminal'] defined).

Back compatibility for #25648
This commit is contained in:
Adnan RIHAN 2023-08-19 17:27:06 +02:00
parent 5c36c23cdb
commit 30ec5dfd75
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) || !empty($conf->global->{$constFreeText})) {
$newfreetext = '';
$substitutionarray = getCommonSubstitutionArray($langs);
@ -316,7 +316,7 @@ if ($conf->global->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);