warning message if you try to create orders without selecting any product
This commit is contained in:
parent
9ff183d432
commit
d4052f7b9c
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user