From a039b4cc93583162c1f9e5dbfc2485d6a246206c Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 30 Nov 2007 10:07:39 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20la=20virgule=20n'=E9tait=20pas=20modifi?= =?UTF-8?q?=E9e=20en=20point=20lors=20de=20la=20division?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/fourn/fournisseur.product.class.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/fourn/fournisseur.product.class.php b/htdocs/fourn/fournisseur.product.class.php index d98bfbaf7c5..b1fb2d0907c 100644 --- a/htdocs/fourn/fournisseur.product.class.php +++ b/htdocs/fourn/fournisseur.product.class.php @@ -167,6 +167,8 @@ class ProductFournisseur extends Product if ($this->db->query($sql)) { + $unitBuyPrice = (price2num($buyprice)/$qty); + // Ajoute prix courant du fournisseur pour cette quantité $sql = "INSERT INTO ".MAIN_DB_PREFIX."product_fournisseur_price"; $sql .= " SET datec = now()"; @@ -174,7 +176,7 @@ class ProductFournisseur extends Product $sql .= " ,fk_user = ".$user->id; $sql .= " ,price = ".price2num($buyprice); $sql .= " ,quantity = ".$qty; - $sql .= " ,unitprice = ".price2num($buyprice/$qty,'MU'); + $sql .= " ,unitprice = ".price2num($unitBuyPrice,'MU'); dolibarr_syslog("ProductFournisseur::update_buyprice sql=".$sql); if (! $this->db->query($sql))