fix delete in paymentvat.class.php (#39323)
Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
parent
8739e98012
commit
cdc6063405
1 changed files with 7 additions and 5 deletions
|
|
@ -458,11 +458,13 @@ class PaymentVAT extends CommonObject
|
|||
|
||||
if ($this->bank_line > 0) {
|
||||
$accline = new AccountLine($this->db);
|
||||
$accline->fetch($this->bank_line);
|
||||
$result = $accline->delete($user);
|
||||
if ($result < 0) {
|
||||
$this->errors[] = $accline->error;
|
||||
$error++;
|
||||
$result = $accline->fetch($this->bank_line);
|
||||
if ($result > 0) {
|
||||
$result = $accline->delete($user); // $result may be 0 if not found (when bank entry was deleted manually and fk_bank point to nothing)
|
||||
if ($result < 0) {
|
||||
$this->errors[] = $accline->error;
|
||||
$error++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue