From 0cb5b3f50c9d6ccda1e9cf9ce80dc2f2140bb5f3 Mon Sep 17 00:00:00 2001 From: simnandez Date: Fri, 1 Mar 2013 20:32:49 +0100 Subject: [PATCH] Fix: Localtax2 for Spain must be based into buyer --- htdocs/core/lib/functions.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 32615202cc1..300db957b16 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2687,10 +2687,10 @@ function get_localtax($tva, $local, $thirdparty_buyer="", $thirdparty_seller="") dol_syslog("get_localtax tva=".$tva." local=".$local." thirdparty_buyer id=".(is_object($thirdparty_buyer)?$thirdparty_buyer->id:'')." thirdparty_seller id=".$thirdparty_seller->id); // Some test to guess with no need to make database access - if ($mysoc->country_code == 'ES') // For spain and localtaxes 1, tax is qualified if buyer use local taxe + if ($mysoc->country_code == 'ES') // For spain localtaxes 1 and 2, tax is qualified if buyer use local taxe { if ($local == 1 && ! $thirdparty_buyer->localtax1_assuj) return 0; - if ($local == 2 && ! $thirdparty_seller->localtax2_assuj) return 0; + if ($local == 2 && ! $thirdparty_buyer->localtax2_assuj) return 0; } else {