fix: display message only if change
This commit is contained in:
parent
1d354aa844
commit
0ee6e92dc0
@ -1830,7 +1830,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
|
|
||||||
// Predefine quantity according to packaging
|
// Predefine quantity according to packaging
|
||||||
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
if (!empty($conf->global->PRODUCT_USE_SUPPLIER_PACKAGING)) {
|
||||||
$prod = new Product($this->db, $fk_product);
|
$prod = new Product($this->db);
|
||||||
$prod->get_buyprice($fk_prod_fourn_price, $qty, $fk_product, 'none', ($this->fk_soc ? $this->fk_soc : $this->socid));
|
$prod->get_buyprice($fk_prod_fourn_price, $qty, $fk_product, 'none', ($this->fk_soc ? $this->fk_soc : $this->socid));
|
||||||
|
|
||||||
if ($qty < $prod->packaging) {
|
if ($qty < $prod->packaging) {
|
||||||
@ -1839,9 +1839,9 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
if (!empty($prod->packaging) && ($qty % $prod->packaging) > 0) {
|
if (!empty($prod->packaging) && ($qty % $prod->packaging) > 0) {
|
||||||
$coeff = intval($qty / $prod->packaging) + 1;
|
$coeff = intval($qty / $prod->packaging) + 1;
|
||||||
$qty = $prod->packaging * $coeff;
|
$qty = $prod->packaging * $coeff;
|
||||||
|
setEventMessage($langs->trans('QtyRecalculatedWithPackaging'), 'mesgs');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
setEventMessage($langs->trans('QtyRecalculatedWithPackaging'), 'mesgs');
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user