From ffa489ee59cf12d942d39c139ba21df875348171 Mon Sep 17 00:00:00 2001 From: Alexandre SPANGARO Date: Tue, 21 Oct 2025 01:06:21 +0200 Subject: [PATCH] NEW Accountancy - Transaction - Add verification on centralized account (#35824) * NEW Accountancy - Transaction - Add verification on centralized account * Fix phan * Fix phan --------- Co-authored-by: Laurent Destailleur --- htdocs/accountancy/bookkeeping/card.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/htdocs/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php index 142d82f7ee8..8d106a7bd94 100644 --- a/htdocs/accountancy/bookkeeping/card.php +++ b/htdocs/accountancy/bookkeeping/card.php @@ -198,6 +198,11 @@ if (empty($reshook)) { setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv("AccountAccountingShort")), null, 'errors'); $action = ''; } + $subledger_account_str = is_array($subledger_account) ? reset($subledger_account) : (string) $subledger_account; + if (!checkGeneralAccountAllowsAuxiliary($db, $accountingaccount_number, $subledger_account_str)) { + $error++; + setEventMessages($langs->trans("ErrorAccountNotCentralized"). ". " . $langs->trans("RemoveSubsidiaryAccountOrAdjustTheGeneralAccount"), null, 'errors'); + } if (!$error) { if (GETPOSTINT('doc_datemonth') && GETPOSTINT('doc_dateday') && GETPOSTINT('doc_dateyear')) {