From 6a7ba4ca5e0ae64eb3b3571e99dc5003fe1a09ca Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Mon, 11 Sep 2006 20:26:15 +0000 Subject: [PATCH] =?UTF-8?q?Fix:=20la=20description=20produit=20=E9tait=20r?= =?UTF-8?q?=E9cup=E9r=E9e=20alors=20que=20l'option=20n'=E9tait=20pas=20act?= =?UTF-8?q?ive?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/propal.class.php | 62 ++++++++++++++++++++++++++--------------- 1 file changed, 39 insertions(+), 23 deletions(-) diff --git a/htdocs/propal.class.php b/htdocs/propal.class.php index 6b74fe3d558..3f981016181 100644 --- a/htdocs/propal.class.php +++ b/htdocs/propal.class.php @@ -135,33 +135,49 @@ class Propal extends CommonObject */ function add_product($idproduct, $qty, $remise_percent=0) { - global $conf, $mysoc; + global $conf, $mysoc; - if (! $qty) $qty = 1; + if (! $qty) $qty = 1; - if ($idproduct > 0) - { - $prod=new Product($this->db); - $prod->fetch($idproduct); + if ($idproduct > 0) + { + $prod=new Product($this->db); + $prod->fetch($idproduct); - $tva_tx = get_default_tva($mysoc,$this->client,$prod->tva_tx); - // multiprix - if($conf->global->PRODUIT_MULTIPRICES == 1) - $price = $prod->multiprices[$this->client->price_level]; - else - $price = $prod->price; - - $line=new PropaleLigne($this->db); - $line->rowid = $idproduct; - $line->fk_product=$idproduct; - $line->desc=$prod->description; - $line->qty = $qty; - $line->subprice=$price; - $line->remise_percent = $remise_percent; - $line->tva_tx=$tva_tx; - - $this->products[]=$line; + // on ajoute la description du produit si l'option est active + if ($conf->global->PRODUIT_CHANGE_PROD_DESC) + { + $productdesc = $prod->description; } + else + { + $productdesc = ''; + } + + $tva_tx = get_default_tva($mysoc,$this->client,$prod->tva_tx); + + // multiprix + if($conf->global->PRODUIT_MULTIPRICES == 1) + { + $price = $prod->multiprices[$this->client->price_level]; + } + else + { + $price = $prod->price; + } + + $line = new PropaleLigne($this->db); + + $line->rowid = $idproduct; + $line->fk_product = $idproduct; + $line->desc = $productdesc; + $line->qty = $qty; + $line->subprice = $price; + $line->remise_percent = $remise_percent; + $line->tva_tx = $tva_tx; + + $this->products[] = $line; + } } /**