From 3ebf64de63fa0257f54c1372d6157f2efa5a4daa Mon Sep 17 00:00:00 2001 From: marc Date: Sun, 24 Jul 2022 11:57:42 +0200 Subject: [PATCH] Fix #21536 API Invoice Delete doesn't raise exception in some case --- htdocs/compta/facture/class/api_invoices.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index a864168d161..6948ae850c7 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -666,7 +666,7 @@ class Invoices extends DolibarrApi } $result = $this->invoice->delete(DolibarrApiAccess::$user); - if ($result < 0) { + if ($result <= 0) { throw new RestException(500, 'Error when deleting invoice'); }