From 791df0c9ea4e657c2d80c51d91b9c41886463551 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Mon, 11 Apr 2016 17:27:34 +0200 Subject: [PATCH 1/3] FIX: correct display of minimum buying price --- htdocs/fourn/class/fournisseur.product.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/class/fournisseur.product.class.php b/htdocs/fourn/class/fournisseur.product.class.php index 344fa3ffa56..50613103848 100644 --- a/htdocs/fourn/class/fournisseur.product.class.php +++ b/htdocs/fourn/class/fournisseur.product.class.php @@ -540,7 +540,7 @@ class ProductFournisseur extends Product { global $langs; $langs->load("suppliers"); - $out=($showunitprice?price($this->fourn_unitprice).' '.$langs->trans("HT").'   (':'').($showsuptitle?$langs->trans("Supplier").': ':'').$this->getSocNomUrl(1).' / '.$langs->trans("SupplierRef").': '.$this->fourn_ref.($showunitprice?')':''); + $out=($showunitprice?price($this->fourn_unitprice * (1 - $this->fourn_remise_percent/100) + $this->fourn_unitcharges - $this->fourn_remise).' '.$langs->trans("HT").'   (':'').($showsuptitle?$langs->trans("Supplier").': ':'').$this->getSocNomUrl(1).' / '.$langs->trans("SupplierRef").': '.$this->fourn_ref.($showunitprice?')':''); return $out; } From 983b2c9a210c11a56f7af7376686afaef70ba8b6 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Mon, 11 Apr 2016 17:40:47 +0200 Subject: [PATCH 2/3] FIX: real min buying price --- htdocs/product/composition/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 89760dc66ba..10d50acebe0 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -354,7 +354,7 @@ if ($id > 0 || ! empty($ref)) else { print $langs->trans("NotDefined"); $notdefined++; $atleastonenotdefined++; } } print ''; - $totalline=price2num($value['nb'] * $product_fourn->fourn_unitprice, 'MT'); + $totalline=price2num($value['nb'] * ($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent/100) + $product_fourn->fourn_unitcharges), 'MT'); $total+=$totalline; print ''.($notdefined?'':price($totalline,'','',0,0,-1,$conf->currency)).''; if (! empty($conf->stock->enabled)) print ''.$langs->trans("Stock").': '.$value['stock'].''; // Real stock From 292373cf8401f190ccc7269838d0e0efdff5d0c6 Mon Sep 17 00:00:00 2001 From: Christophe Battarel Date: Mon, 11 Apr 2016 17:43:10 +0200 Subject: [PATCH 3/3] forgot new discount field --- htdocs/product/composition/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/product/composition/card.php b/htdocs/product/composition/card.php index 10d50acebe0..6cb6424bdc4 100644 --- a/htdocs/product/composition/card.php +++ b/htdocs/product/composition/card.php @@ -354,7 +354,7 @@ if ($id > 0 || ! empty($ref)) else { print $langs->trans("NotDefined"); $notdefined++; $atleastonenotdefined++; } } print ''; - $totalline=price2num($value['nb'] * ($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent/100) + $product_fourn->fourn_unitcharges), 'MT'); + $totalline=price2num($value['nb'] * ($product_fourn->fourn_unitprice * (1 - $product_fourn->fourn_remise_percent/100) + $product_fourn->fourn_unitcharges - $product_fourn->fourn_remise), 'MT'); $total+=$totalline; print ''.($notdefined?'':price($totalline,'','',0,0,-1,$conf->currency)).''; if (! empty($conf->stock->enabled)) print ''.$langs->trans("Stock").': '.$value['stock'].''; // Real stock