Fix missing error management

This commit is contained in:
Laurent Destailleur 2022-02-28 16:39:42 +01:00
parent 99ddef0530
commit aff7148ed8

View File

@ -585,16 +585,19 @@ class Paiement extends CommonObject
return -1;
}
$this->db->begin();
$this->fk_account = $accountid;
dol_syslog("addPaymentToBank ".$user->id.", ".$mode.", ".$label.", ".$this->fk_account.", ".$emetteur_nom.", ".$emetteur_banque);
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
dol_syslog("$user->id, $mode, $label, $this->fk_account, $emetteur_nom, $emetteur_banque");
$acc = new Account($this->db);
$result = $acc->fetch($this->fk_account);
if ($result < 0) {
$error++;
return -1;
}
$this->db->begin();
$totalamount = $this->amount;
if (empty($totalamount)) {