From 541e5fefdccdf02b8dae808a0457c041e39127ee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 28 Oct 2025 13:33:06 +0100 Subject: [PATCH] Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop --- htdocs/core/modules/modBlockedLog.class.php | 4 +++- htdocs/langs/en_US/blockedlog.lang | 1 + htdocs/takepos/receipt.php | 22 +++++++++++++-------- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/htdocs/core/modules/modBlockedLog.class.php b/htdocs/core/modules/modBlockedLog.class.php index 340c808871e..ef9b533c80a 100644 --- a/htdocs/core/modules/modBlockedLog.class.php +++ b/htdocs/core/modules/modBlockedLog.class.php @@ -209,7 +209,7 @@ class modBlockedLog extends DolibarrModules */ public function remove($options = '') { - global $conf, $user; + global $conf, $langs, $user; $sql = array(); @@ -233,6 +233,8 @@ class modBlockedLog extends DolibarrModules if ($b->alreadyUsed(1)) { $res = $b->create($user, '0000000000'); // If already used for something else than SET or UNSET, we log with error + //$this->error = $langs->trans('DisablingBlockedLogIsNotallowedOnceUsedExceptOnFullreset', $langs->transnoentitiesnoconv('BlockedLog')); + return 0; } else { $res = $b->create($user); } diff --git a/htdocs/langs/en_US/blockedlog.lang b/htdocs/langs/en_US/blockedlog.lang index c05b2623c52..852ff5c247f 100644 --- a/htdocs/langs/en_US/blockedlog.lang +++ b/htdocs/langs/en_US/blockedlog.lang @@ -36,6 +36,7 @@ LinkHasBeenDisabledForPerformancePurpose=For performance purpose, direct link to SavedOnLine=Saved on line UnlaterableDataOfEvent=Unalterable data of event YourCountryCode=Your country code +DisablingBlockedLogIsNotallowedOnceUsedExceptOnFullreset=Disabling %s module is not allowed once it has been used, except for a full database reset. Ask your integrator or reseller if you need such a reset. ## logTypes logBILL_DELETE=Customer invoice logically deleted diff --git a/htdocs/takepos/receipt.php b/htdocs/takepos/receipt.php index 2847000bd20..1a28512a3ad 100644 --- a/htdocs/takepos/receipt.php +++ b/htdocs/takepos/receipt.php @@ -63,6 +63,7 @@ if (!isset($action)) { * @var User $user */ include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php'; +include_once DOL_DOCUMENT_ROOT.'/blockedlog/lib/blockedlog.lib.php'; $langs->loadLangs(array("main", "bills", "cashdesk", "companies")); @@ -166,7 +167,14 @@ if (isALNERunningVersion()) {
-'.$mysoc->name.''; ?> +'.$mysoc->name.''; + +if (GETPOST('specimen')) { + print '
'; + print '!!!!! SPECIMEN !!!!!'; +} +?>

@@ -191,14 +199,12 @@ if (getDolGlobalString('TAKEPOS_HEADER') || getDolGlobalString($constFreeText)) status == Facture::STATUS_DRAFT) { $canprintifnotvalidate = true; - $arrayOfCountryWithPrintingOnBrowserMandatory = array('FR'); - if (in_array($mysoc->country_code, $arrayOfCountryWithPrintingOnBrowserMandatory) && isModEnabled('blockedlog')) { - //$customprinterallowed = false; // Custom printer are allowed but information in template are mandatory + if (isALNERunningVersion()) { $canprintifnotvalidate = false; //$orderprinterallowed = false; } - if (!$canprintifnotvalidate && empty($facid)) { + if (!$canprintifnotvalidate && empty($facid) && !GETPOST('specimen')) { print "Error: Printing ticket is not allowed when invoice is not validated/paid."; exit; } @@ -207,7 +213,7 @@ if ($object->status == Facture::STATUS_DRAFT) {

trans('Date')." ".dol_print_date($object->date, 'day').'
'; +print $langs->trans('Date')." ".dol_print_date($object->date ? $object->date : dol_now(), 'day').'
'; if (getDolGlobalString('TAKEPOS_RECEIPT_NAME')) { print getDolGlobalString('TAKEPOS_RECEIPT_NAME') . " "; } else { @@ -217,14 +223,14 @@ if ($object->status == Facture::STATUS_DRAFT || empty($facid) || GETPOST('specim // Printing ticket is not allowed if invoice not yet validate. // Reaching this code may happen for specimen or if a feature to validate invoice and print it before paying is implemented. if (empty($facid) || GETPOST('specimen')) { - print 'Specimen'; + print '99999'; } else { print $object->ref; } } else { print $object->ref; } -print '
'.$langs->trans("Terminal").' '.$object->pos_source; +print '
'.$langs->trans("Terminal").' '.(GETPOST('specimen') ? '99' : $object->pos_source); if (getDolGlobalString('TAKEPOS_SHOW_CUSTOMER')) { if ($object->socid != getDolGlobalInt('CASHDESK_ID_THIRDPARTY'.$_SESSION["takeposterminal"])) { $soc = new Societe($db);