Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into

develop
This commit is contained in:
Laurent Destailleur 2025-10-28 13:33:06 +01:00
parent 9214ee5d2a
commit 541e5fefdc
3 changed files with 18 additions and 9 deletions

View file

@ -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);
}

View file

@ -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

View file

@ -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()) {
</style>
<center>
<div style="font-size: 1.5em">
<?php echo '<b>'.$mysoc->name.'</b>'; ?>
<?php
echo '<b>'.$mysoc->name.'</b>';
if (GETPOST('specimen')) {
print '<br>';
print '!!!!! SPECIMEN !!!!!';
}
?>
</div>
</center>
<br>
@ -191,14 +199,12 @@ if (getDolGlobalString('TAKEPOS_HEADER') || getDolGlobalString($constFreeText))
<?php
if ($object->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) {
<p class="right">
<?php
print $langs->trans('Date')." ".dol_print_date($object->date, 'day').'<br>';
print $langs->trans('Date')." ".dol_print_date($object->date ? $object->date : dol_now(), 'day').'<br>';
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 '<br>'.$langs->trans("Terminal").' '.$object->pos_source;
print '<br>'.$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);