From 4b0b8e1c1f1e6882123694e15cd26f57f3a0ad81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Sat, 23 Feb 2019 16:44:36 +0100 Subject: [PATCH] Update api_invoices.class.php --- htdocs/compta/facture/class/api_invoices.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/class/api_invoices.class.php b/htdocs/compta/facture/class/api_invoices.class.php index 7f97658fe8a..0ec6dc19c2f 100644 --- a/htdocs/compta/facture/class/api_invoices.class.php +++ b/htdocs/compta/facture/class/api_invoices.class.php @@ -239,7 +239,7 @@ class Invoices extends DolibarrApi * * @param int $orderid Id of the order * -$this->db->begin(); * @url POST /createfromorder/{orderid} + * @url POST /createfromorder/{orderid} * * @return int * @throws 400 @@ -393,7 +393,7 @@ $this->db->begin(); * @url POST /createfromorder/{orderid} } $result = $this->invoice->fetch($id); -$this->db->begin(); + if(!$result) { throw new RestException(404, 'Invoice not found'); }