From af0c1a5f76842a0733278c95ea9c0b16b71ec474 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 3 Nov 2012 15:33:49 +0100 Subject: [PATCH] Fix: Missing parameter --- htdocs/cashdesk/class/Facturation.class.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/cashdesk/class/Facturation.class.php b/htdocs/cashdesk/class/Facturation.class.php index af0b033d81f..2c5d1b6df0d 100644 --- a/htdocs/cashdesk/class/Facturation.class.php +++ b/htdocs/cashdesk/class/Facturation.class.php @@ -92,9 +92,13 @@ class Facturation global $conf,$db; $thirdpartyid = $_SESSION['CASHDESK_ID_THIRDPARTY']; + $societe = new Societe($db); $societe->fetch($thirdpartyid); + $product = new Product($db); + $product->fetch($this->id); + $sql = "SELECT taux"; $sql.= " FROM ".MAIN_DB_PREFIX."c_tva"; $sql.= " WHERE rowid = ".$this->tva(); @@ -109,13 +113,12 @@ class Facturation //var_dump($vat_rate);exit; } else - { + { dol_print_error($db); } - // Define part of HT, VAT, TTC - $resultarray=calcul_price_total($this->qte,$this->prix(),$this->remisePercent(),$vat_rate,0,0,0,'HT',0); + $resultarray=calcul_price_total($this->qte,$this->prix(),$this->remisePercent(),$vat_rate,0,0,$product->type,'HT',0); // Calcul du total ht sans remise $total_ht = $resultarray[0]; @@ -132,9 +135,6 @@ class Facturation $montant_remise_ht = ($resultarray[6] - $resultarray[0]); $this->montantRemise($montant_remise_ht); - $product = new Product($db); - $product->fetch($this->id); - $newcartarray=$_SESSION['poscart']; $i=count($newcartarray);