From 0ee6e92dc0286ed9427cb446cadf63a45052d6e0 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 22 Jul 2022 10:51:28 +0200 Subject: [PATCH] fix: display message only if change --- htdocs/fourn/class/fournisseur.commande.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index ce1fffba01e..74ef2ff7ce2 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -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'); } }