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 <eldy@destailleur.fr>
This commit is contained in:
Alexandre SPANGARO
2025-10-21 01:06:21 +02:00
committed by GitHub
parent 894e73e9cf
commit ffa489ee59

View File

@@ -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')) {