diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index 24c71d51cb4..7b19e95a974 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -503,11 +503,11 @@ class Invoices extends DolibarrApi } $contacts = $this->invoice->liste_contact(); - + foreach ($contacts as $contact) { if ($contact['id'] == $rowid) { $result = $this->invoice->delete_contact($contact['rowid']); - + if (!$result) { throw new RestException(500, 'Error when deleted the contact'); }