fix: display message only if change

This commit is contained in:
Florian HENRY 2022-07-22 10:51:28 +02:00
parent 1d354aa844
commit 0ee6e92dc0

View File

@ -1830,7 +1830,7 @@ class CommandeFournisseur extends CommonOrder
// Predefine quantity according to 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));
if ($qty < $prod->packaging) {
@ -1839,9 +1839,9 @@ class CommandeFournisseur extends CommonOrder
if (!empty($prod->packaging) && ($qty % $prod->packaging) > 0) {
$coeff = intval($qty / $prod->packaging) + 1;
$qty = $prod->packaging * $coeff;
setEventMessage($langs->trans('QtyRecalculatedWithPackaging'), 'mesgs');
}
}
setEventMessage($langs->trans('QtyRecalculatedWithPackaging'), 'mesgs');
}
}