From caa5d7b347ad7b91909eeaed0e3866a4bdca6165 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 12 Feb 2026 16:23:43 +0100 Subject: [PATCH] Debug v23 --- htdocs/blockedlog/lib/blockedlog.lib.php | 12 ++++++++---- htdocs/compta/facture/card.php | 4 ++-- htdocs/core/class/commoninvoice.class.php | 1 + 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/htdocs/blockedlog/lib/blockedlog.lib.php b/htdocs/blockedlog/lib/blockedlog.lib.php index 7400f410f8e..4fd1d36b40d 100644 --- a/htdocs/blockedlog/lib/blockedlog.lib.php +++ b/htdocs/blockedlog/lib/blockedlog.lib.php @@ -165,12 +165,16 @@ function isALNEQualifiedVersion($ignoredev = 0, $ignoremodule = 0) */ function isALNERunningVersion($blockedlogtestalreadydone = 0) { - // For Debug help: Constant set by developer to force all LNE restrictions even if country is not France so we can test them on any dev instance. - // Note that you can force, with this option, the enabling of the LNE restrictions, but there is no way to force the disabling of the LNE restriction. - if (defined('CERTIF_LNE') && (int) constant('CERTIF_LNE') === 2) { + // For Debug help: Constant set by developer to force all LNE restrictions + // even if country is not France so we can test them on any dev instance. + // Note that you can force, with this option, the enabling of the LNE restrictions, + // but there is no way to force the disabling of the LNE restriction. + if (defined('CERTIF_LNE') && (int) constant('CERTIF_LNE') === 2 + && isModEnabled('blockedlog') && ($blockedlogtestalreadydone || isBlockedLogUsed())) { return true; } - if (isModEnabled('blockedlog') && ($blockedlogtestalreadydone || isBlockedLogUsed())) { + if (defined('CERTIF_LNE') && (int) constant('CERTIF_LNE') === 1 + && isModEnabled('blockedlog') && ($blockedlogtestalreadydone || isBlockedLogUsed())) { return true; } diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index e3932131383..4b902934cf1 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -5042,11 +5042,11 @@ if ($action == 'create') { break; case -7: // Already validated - setEventMessages($langs->trans("DisabledBecauseVersionProtected"), null, 'errors'); + setEventMessages($langs->trans("DisabledBecauseVersionProtected").(empty($object->error) ? '' : ': '.$object->error), null, 'errors'); break; default: // Other error - setEventMessages($langs->trans("DisabledBecauseNotErasable"), null, 'errors'); + setEventMessages($langs->trans("DisabledBecauseNotErasable").(empty($object->error) ? '' : ': '.$object->error), null, 'errors'); break; } $oktomodif = 0; diff --git a/htdocs/core/class/commoninvoice.class.php b/htdocs/core/class/commoninvoice.class.php index 60598c8def6..de38b4d125a 100644 --- a/htdocs/core/class/commoninvoice.class.php +++ b/htdocs/core/class/commoninvoice.class.php @@ -763,6 +763,7 @@ abstract class CommonInvoice extends CommonObject include_once DOL_DOCUMENT_ROOT.'/blockedlog/lib/blockedlog.lib.php'; if (isALNERunningVersion()) { + $this->error = 'Action not allowed on the certified version'; return -7; } }