Merge pull request #21569 from emheyarssi/develop

Fix #21536
This commit is contained in:
Laurent Destailleur 2022-07-25 19:41:21 +02:00 committed by GitHub
commit 4ca57617b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -668,6 +668,8 @@ class Invoices extends DolibarrApi
$result = $this->invoice->delete(DolibarrApiAccess::$user);
if ($result < 0) {
throw new RestException(500, 'Error when deleting invoice');
} elseif ($result == 0) {
throw new RestException(403, 'Invoice not erasable');
}
return array(