From 6dab4ba8402c73ae32107bbd7454ff7eb71adea7 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Fri, 3 Feb 2006 16:34:24 +0000 Subject: [PATCH] =?UTF-8?q?int=C3=A9gration=20support=20multiprix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/facture.class.php | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/htdocs/facture.class.php b/htdocs/facture.class.php index aa751e85725..86e37f8e632 100644 --- a/htdocs/facture.class.php +++ b/htdocs/facture.class.php @@ -4,6 +4,7 @@ * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005 Marc Barilley / Ocebo + * Copyright (C) 2006 Andre Cianfarani * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -168,10 +169,18 @@ class Facture { $prod = new Product($this->db, $this->products[$i]); $prod->fetch($this->products[$i]); - + // multiprix + if($conf->global->PRODUIT_MULTIPRICES == 1) + { + $soc = new Societe($this->db); + $soc->fetch($this->socidp); + $price = $prod->multiprices[$soc->price_level]; + } + else + $price = $prod->price; $result_insert = $this->addline($this->id, $prod->libelle, - $prod->price, + $price, $this->products_qty[$i], $prod->tva_tx, $this->products[$i], @@ -970,6 +979,7 @@ class Facture */ function addline($facid, $desc, $pu, $qty, $txtva, $fk_product=0, $remise_percent=0, $datestart='', $dateend='', $ventil = 0) { + global $conf; dolibarr_syslog("facture.class.php::addline($facid,$desc,$pu,$qty,$txtva,$fk_product,$remise_percent,$datestart,$dateend,$ventil)"); if ($this->brouillon) { @@ -982,7 +992,15 @@ class Facture { $prod = new Product($this->db, $fk_product); $prod->fetch($fk_product); - $pu=$prod->price; + // multiprix + if($conf->global->PRODUIT_MULTIPRICES == 1) + { + $soc = new Societe($this->db); + $soc->fetch($this->socidp); + $pu = $prod->multiprices[$soc->price_level]; + } + else + $pu=$prod->price; $txtva=$prod->tva_tx; } $price = $pu;