From 0a033f4cfda196f232115b994db70e932aa44783 Mon Sep 17 00:00:00 2001 From: atm-quentin Date: Mon, 22 Oct 2018 16:49:36 +0200 Subject: [PATCH] FIX : manage error --- htdocs/langs/fr_FR/receptions.lang | 1 + htdocs/reception/list.php | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/langs/fr_FR/receptions.lang b/htdocs/langs/fr_FR/receptions.lang index 3dab5a0500e..2102e282668 100644 --- a/htdocs/langs/fr_FR/receptions.lang +++ b/htdocs/langs/fr_FR/receptions.lang @@ -61,6 +61,7 @@ NoProductToShipFoundIntoStock=Aucun produit à expédier n'a été trouver dans WeightVolShort=Poids/vol. ValidateOrderFirstBeforeReception=Vous devez d'abord valider la commande pour pouvoir créer une réception. CreateInvoiceForThisSupplier=Facturer réceptions +ErrorRefAlreadyExists = La référence fournisseur existe déjà # Reception methods # ModelDocument diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php index e2c0f59bf2e..f05debc8858 100644 --- a/htdocs/reception/list.php +++ b/htdocs/reception/list.php @@ -181,7 +181,8 @@ if (empty($reshook)) $object = new FactureFournisseur($db); if (!empty($createbills_onebythird) && !empty($TFactThird[$rcp->socid])){ $object = $TFactThird[$rcp->socid]; // If option "one bill per third" is set, we use already created reception. - $object->fetchObjectLinked(); + if(empty($object->rowid)&&$object->id != null)$object->rowid = $object->id; + if(!empty($object->rowid))$object->fetchObjectLinked(); $rcp->fetchObjectLinked(); if (count($rcp->linkedObjectsIds['order_supplier']) > 0) @@ -234,7 +235,7 @@ if (empty($reshook)) $nb_bills_created++; $object->id = $res; }else { - $errors[]=$object->error; + $errors[]=$rcp->ref.' : '.$langs->trans($object->error); $error++; } }