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
|
ReplenishmentOrders=Replenishment orders
|
||||||
UseVirtualStock=Use virtual stock instead of physical stock
|
UseVirtualStock=Use virtual stock instead of physical stock
|
||||||
RuleForStockReplenishment=Rule for stocks replenishment
|
RuleForStockReplenishment=Rule for stocks replenishment
|
||||||
|
SelectProduct=Select at least one product
|
||||||
|
|||||||
@ -94,3 +94,4 @@ Replenishment=Réapprovisionnement
|
|||||||
ReplenishmentOrders=Commandes de réapprovisionnement
|
ReplenishmentOrders=Commandes de réapprovisionnement
|
||||||
UseVirtualStock=Utiliser le stock théorique à la place du stock physique
|
UseVirtualStock=Utiliser le stock théorique à la place du stock physique
|
||||||
RuleForStockReplenishment=Règle de gestion du réapprovisionnement des stocks
|
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
|
//could go in the lib
|
||||||
if ($action == 'order') {
|
if ($action == 'order') {
|
||||||
$linecount = GETPOST('linecount', 'int');
|
$linecount = GETPOST('linecount', 'int');
|
||||||
|
$box = 0;
|
||||||
unset($_POST['linecount']);
|
unset($_POST['linecount']);
|
||||||
if ($linecount > 0) {
|
if ($linecount > 0) {
|
||||||
$suppliers = array();
|
$suppliers = array();
|
||||||
for ($i = 0; $i < $linecount; $i++) {
|
for ($i = 0; $i < $linecount; $i++) {
|
||||||
if(GETPOST($i, 'alpha') === 'on'
|
if(GETPOST($i, 'alpha') === 'on'
|
||||||
&& GETPOST('fourn' . $i, 'int') > 0) { //one line
|
&& GETPOST('fourn' . $i, 'int') > 0) { //one line
|
||||||
|
$box = $i;
|
||||||
$supplierpriceid = GETPOST('fourn'.$i, 'int');
|
$supplierpriceid = GETPOST('fourn'.$i, 'int');
|
||||||
//get all the parameters needed to create a line
|
//get all the parameters needed to create a line
|
||||||
$qty = GETPOST('tobuy'.$i, 'int');
|
$qty = GETPOST('tobuy'.$i, 'int');
|
||||||
@ -136,6 +138,9 @@ if ($action == 'order') {
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($box == 0){
|
||||||
|
setEventMessage($langs->trans('SelectProduct'), 'warnings');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user