diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 932ed33010d..156cfee46ef 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -863,8 +863,8 @@ class Facture extends CommonInvoice ); if ($result < 0) { - $this->error = $this->db->lasterror(); - $this->errors = array_merge($this->errors, $newinvoiceline->errors); + $this->error = $newinvoiceline->error; + $this->errors = $newinvoiceline->errors; $error++; break; }