Improve Exception for accountancy ACH, VEN, ODS, FIN

This commit is contained in:
sparkyx 2024-12-28 11:16:31 +01:00
parent d15e85649d
commit 5f33bc1bd3
11 changed files with 94 additions and 46 deletions

View file

@ -105,7 +105,16 @@ if (isset($_POST['record']))
echo '<div class="content">';
$Ledger = new Acc_Ledger_Purchase($cn, $post_jrn);
$internal = $Ledger->insert($_POST);
try {
$internal = $Ledger->insert($_POST);
} catch (\Exception $e) {
if ( $e->getCode()==EXC_BALANCE)
echo_warning(_("enregistrement annulé: balance , voyer le fichier log"));
else
echo_warning($e->getMessage());
return;
}
/* Save the predefined operation */