From 0fb95fa15f4afdc86f9afbf87d97ede6780c7092 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 5 Jan 2018 01:30:12 +0100 Subject: [PATCH] Try a fix for #7778 --- htdocs/commande/class/commande.class.php | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 4d094712c57..7998a25bd13 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1338,6 +1338,14 @@ class Commande extends CommonOrder $tabprice = calcul_price_total($qty, $pu, $remise_percent, $txtva, $txlocaltax1, $txlocaltax2, 0, $price_base_type, $info_bits, $product_type, $mysoc, $localtaxes_type, 100, $this->multicurrency_tx, $pu_ht_devise); + /*var_dump($txlocaltax1); + var_dump($txlocaltax2); + var_dump($localtaxes_type); + var_dump($tabprice); + var_dump($tabprice[9]); + var_dump($tabprice[10]); + exit;*/ + $total_ht = $tabprice[0]; $total_tva = $tabprice[1]; $total_ttc = $tabprice[2]; @@ -1379,12 +1387,12 @@ class Commande extends CommonOrder $this->line->desc=$desc; $this->line->qty=$qty; - $this->line->vat_src_code=$vat_src_code; + $this->line->vat_src_code=$vat_src_code; $this->line->tva_tx=$txtva; - $this->line->localtax1_tx=$localtaxes_type[1]; - $this->line->localtax2_tx=$localtaxes_type[3]; - $this->line->localtax1_type=$localtaxes_type[0]; - $this->line->localtax2_type=$localtaxes_type[2]; + $this->line->localtax1_tx=($total_localtax1?$localtaxes_type[1]:0); + $this->line->localtax2_tx=($total_localtax2?$localtaxes_type[3]:0); + $this->line->localtax1_type=$localtaxes_type[0]; + $this->line->localtax2_type=$localtaxes_type[2]; $this->line->fk_product=$fk_product; $this->line->product_type=$product_type; $this->line->fk_remise_except=$fk_remise_except;