From 4382642099552169d5e657738bfb654863aacfca Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Wed, 18 Oct 2017 12:10:00 +0200 Subject: [PATCH 1/2] FIX: Bad localtax apply --- htdocs/expedition/class/expedition.class.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 9e057106dd8..7cfd19e6f1f 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2007 Franky Van Liedekerke * Copyright (C) 2006-2012 Laurent Destailleur - * Copyright (C) 2011-2016 Juanjo Menent + * Copyright (C) 2011-2017 Juanjo Menent * Copyright (C) 2013 Florian Henry * Copyright (C) 2014 Cedric GROSS * Copyright (C) 2014-2015 Marcos GarcĂ­a @@ -1400,7 +1400,10 @@ class Expedition extends CommonObject $line->pa_ht = $obj->pa_ht; + // Local taxes $localtax_array=array(0=>$obj->localtax1_type, 1=>$obj->localtax1_tx, 2=>$obj->localtax2_type, 3=>$obj->localtax2_tx); + $localtax1_tx = get_localtax($obj->tva_tx, 1, $this->thirdparty); + $localtax2_tx = get_localtax($obj->tva_tx, 2, $this->thirdparty); // For invoicing $tabprice = calcul_price_total($obj->qty_shipped, $obj->subprice, $obj->remise_percent, $obj->tva_tx, $obj->localtax1_tx, $obj->localtax2_tx, 0, 'HT', $obj->info_bits, $obj->fk_product_type, $mysoc, $localtax_array); // We force type to 0 From df53870c01db2cb2d72b7c2faf86e4670c0ccf39 Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Wed, 18 Oct 2017 12:13:32 +0200 Subject: [PATCH 2/2] FIX: Bad localtax apply --- htdocs/expedition/class/expedition.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 7cfd19e6f1f..879b5745db4 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1406,7 +1406,7 @@ class Expedition extends CommonObject $localtax2_tx = get_localtax($obj->tva_tx, 2, $this->thirdparty); // For invoicing - $tabprice = calcul_price_total($obj->qty_shipped, $obj->subprice, $obj->remise_percent, $obj->tva_tx, $obj->localtax1_tx, $obj->localtax2_tx, 0, 'HT', $obj->info_bits, $obj->fk_product_type, $mysoc, $localtax_array); // We force type to 0 + $tabprice = calcul_price_total($obj->qty_shipped, $obj->subprice, $obj->remise_percent, $obj->tva_tx, $localtax1_tx, $localtax2_tx, 0, 'HT', $obj->info_bits, $obj->fk_product_type, $mysoc, $localtax_array); // We force type to 0 $line->desc = $obj->description; // We need ->desc because some code into CommonObject use desc (property defined for other elements) $line->qty = $line->qty_shipped; $line->total_ht = $tabprice[0];