diff --git a/htdocs/langs/en_US/stocks.lang b/htdocs/langs/en_US/stocks.lang index bbc5a6fe261..5f6b45cff1e 100644 --- a/htdocs/langs/en_US/stocks.lang +++ b/htdocs/langs/en_US/stocks.lang @@ -94,3 +94,4 @@ Replenishment=Replenishment ReplenishmentOrders=Replenishment orders UseVirtualStock=Use virtual stock instead of physical stock RuleForStockReplenishment=Rule for stocks replenishment +SelectProduct=Select at least one product diff --git a/htdocs/langs/fr_FR/stocks.lang b/htdocs/langs/fr_FR/stocks.lang index efdfa28a6da..643bcc955fa 100644 --- a/htdocs/langs/fr_FR/stocks.lang +++ b/htdocs/langs/fr_FR/stocks.lang @@ -94,3 +94,4 @@ Replenishment=Réapprovisionnement ReplenishmentOrders=Commandes de réapprovisionnement UseVirtualStock=Utiliser le stock théorique à la place du stock physique RuleForStockReplenishment=Règle de gestion du réapprovisionnement des stocks +SelectProduct=Sélectionnez au moins un produit diff --git a/htdocs/product/stock/replenish.php b/htdocs/product/stock/replenish.php index 65ef6f33415..cdb8e63077c 100644 --- a/htdocs/product/stock/replenish.php +++ b/htdocs/product/stock/replenish.php @@ -71,12 +71,14 @@ $offset = $limit * $page ; //could go in the lib if ($action == 'order') { $linecount = GETPOST('linecount', 'int'); + $box = 0; unset($_POST['linecount']); if ($linecount > 0) { $suppliers = array(); for ($i = 0; $i < $linecount; $i++) { if(GETPOST($i, 'alpha') === 'on' && GETPOST('fourn' . $i, 'int') > 0) { //one line + $box = $i; $supplierpriceid = GETPOST('fourn'.$i, 'int'); //get all the parameters needed to create a line $qty = GETPOST('tobuy'.$i, 'int'); @@ -135,6 +137,9 @@ if ($action == 'order') { header('Location: replenishorders.php'); exit; } + } + if ($box == 0){ + setEventMessage($langs->trans('SelectProduct'), 'warnings'); } }