diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index a623184478b..71ec8393e09 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1070,7 +1070,7 @@ class Account extends CommonObject return 0; } } else { - $this->error = $this->db->lasterror; + $this->error = $this->db->lasterror(); $this->errors[] = $this->error; return -1; } diff --git a/htdocs/compta/paiement/class/paiement.class.php b/htdocs/compta/paiement/class/paiement.class.php index ec1392e9ea7..373fa2d5175 100644 --- a/htdocs/compta/paiement/class/paiement.class.php +++ b/htdocs/compta/paiement/class/paiement.class.php @@ -643,6 +643,8 @@ class Paiement extends CommonObject $acc = new Account($this->db); $result = $acc->fetch($this->fk_account); if ($result < 0) { + $this->error = $acc->error; + $this->errors = $acc->errors; $error++; return -1; } @@ -768,7 +770,7 @@ class Paiement extends CommonObject } // Add link 'InvoiceRefused' in bank_url - if (! $error && $label == '(InvoiceRefused)') { + if (!$error && $label == '(InvoiceRefused)') { $result=$acc->add_url_line( $bank_line_id, $this->id_prelevement, @@ -788,6 +790,7 @@ class Paiement extends CommonObject } } else { $this->error = $acc->error; + $this->errors = $acc->errors; $error++; }