From 967c20e3e9ed0f5547e71e48b6794a7a0a157180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Salvador?= Date: Mon, 16 Sep 2013 14:31:56 +0200 Subject: [PATCH] Improved error message --- htdocs/fourn/class/fournisseur.commande.class.php | 3 ++- htdocs/product/stock/replenish.php | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index 93612387adb..6f6f9e91867 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1200,7 +1200,8 @@ class CommandeFournisseur extends CommonOrder } if ($result == 0 || $result == -1) { - $this->error="No price found for this quantity. Quantity may be too low ?"; + $langs->load("errors"); + $this->error = "Ref " . $prod->ref . " " . $langs->trans("ErrorQtyTooLowForThisSupplier"); $this->db->rollback(); dol_syslog(get_class($this)."::addline result=".$result." - ".$this->error, LOG_DEBUG); return -1; diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index eedee585cee..30941ec0cc2 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -137,7 +137,9 @@ if ($action == 'order' && isset($_POST['valid'])) { $id = $order->create($user); if ($id < 0) { $fail++; - setEventMessage($langs->trans('OrderFail'), 'errors'); + $msg = $langs->trans('OrderFail') . " : "; + $msg .= $order->error; + setEventMessage($msg, 'errors'); } $i++; }