diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index 0cb005ddba5..afecfd33b45 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -956,7 +956,7 @@ class Invoices extends DolibarrApi throw new RestException(404, 'Thirdparty not found'); } - if (! $object->paye) // protection against multiple submit + if (! $this->invoice->paye) // protection against multiple submit { $this->invoice->fetch_lines(); @@ -1015,7 +1015,7 @@ class Invoices extends DolibarrApi } else { - throw new RestException(500, 'Discount error'); + throw new RestException(500, 'Discount creation error'); $this->db->rollback(); } }