From 35b1868693cdb41506f5958a58f2a77944a6cea8 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 19 Nov 2021 14:01:31 +0100 Subject: [PATCH] FIX Missing trans --- htdocs/langs/en_US/receptions.lang | 4 +++- htdocs/reception/class/reception.class.php | 10 ++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/htdocs/langs/en_US/receptions.lang b/htdocs/langs/en_US/receptions.lang index ca836137226..d60487c439f 100644 --- a/htdocs/langs/en_US/receptions.lang +++ b/htdocs/langs/en_US/receptions.lang @@ -47,4 +47,6 @@ ReceptionsNumberingModules=Numbering module for receptions ReceptionsReceiptModel=Document templates for receptions NoMorePredefinedProductToDispatch=No more predefined products to dispatch ReceptionExist=A reception exists -ReceptionBackToDraftInDolibarr=Reception %s back to draft \ No newline at end of file +ReceptionBackToDraftInDolibarr=Reception %s back to draft +ReceptionClassifyClosedInDolibarr=Reception %s classified Closed +ReceptionUnClassifyCloseddInDolibarr=Reception %s re-open \ No newline at end of file diff --git a/htdocs/reception/class/reception.class.php b/htdocs/reception/class/reception.class.php index 540bb17b9e1..5fb8e3b8af0 100644 --- a/htdocs/reception/class/reception.class.php +++ b/htdocs/reception/class/reception.class.php @@ -1689,6 +1689,7 @@ class Reception extends CommonObject // We decrement stock of product (and sub-products) -> update table llx_product_stock (key of this table is fk_product+fk_entrepot) and add a movement record $inventorycode = ''; $result = $mouvS->reception($user, $obj->fk_product, $obj->fk_entrepot, -$qty, $obj->subprice, $langs->trans("ReceptionUnClassifyCloseddInDolibarr", $numref), '', '', '', '', 0, $inventorycode); + if ($result < 0) { $this->error = $mouvS->error; $this->errors = $mouvS->errors; @@ -1721,10 +1722,15 @@ class Reception extends CommonObject } } - if ($this->origin == 'order_supplier') { + if (!$error && $this->origin == 'order_supplier') { $commande = new CommandeFournisseur($this->db); $commande->fetch($this->origin_id); - $commande->setStatus($user, 4); + $result = $commande->setStatus($user, 4); + if ($result < 0) { + $error++; + $this->error = $commande->error; + $this->errors = $commande->errors; + } } } else { $error++;