From 94d57cd462ca57ee7ad8283321822dabaa34f3e2 Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 4 Dec 2020 10:03:06 +0100 Subject: [PATCH] fix rounding --- htdocs/fourn/class/fournisseur.commande.class.php | 2 +- htdocs/fourn/class/fournisseur.product.class.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.commande.class.php b/htdocs/fourn/class/fournisseur.commande.class.php index dc3113f2554..af283d8cdf0 100644 --- a/htdocs/fourn/class/fournisseur.commande.class.php +++ b/htdocs/fourn/class/fournisseur.commande.class.php @@ -1729,9 +1729,9 @@ class CommandeFournisseur extends CommonOrder { $coeff = intval($qty / $prod->packaging) + 1; $qty = $prod->packaging * $coeff; - setEventMessage($langs->trans('QtyRecalculatedWithPackaging'), 'mesgs'); } } + setEventMessage($langs->trans('QtyRecalculatedWithPackaging'), 'mesgs'); } } else diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 1643ae69846..5a36e6bdabf 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -274,7 +274,7 @@ class ProductFournisseur extends Product $charges = price2num($charges, 'MU'); $qty = price2num($qty, 'MS'); $unitBuyPrice = price2num($buyprice / $qty, 'MU'); - $packaging = ($this->packaging < $qty) ? $qty : $this->packaging; + $packaging = price2num((($this->packaging < $qty) ? $qty : $this->packaging), 'MS'); $error = 0; $now = dol_now();