From 7c62f2240897165b00f1e43b9f7c84cd75f7cdee Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 15 Mar 2018 14:02:32 +0100 Subject: [PATCH] Remove doubtful code --- htdocs/core/lib/functions.lib.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index bed4bcc8d6a..f9219c265ad 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -4696,7 +4696,7 @@ function getTaxesFromId($vatrate, $buyer=null, $seller=null, $firstparamisid=1) { global $db, $mysoc; - dol_syslog("getTaxesFromId vatrowid=".$vatrate); + dol_syslog("getTaxesFromId vat id or rate = ".$vatrate); // Search local taxes $sql = "SELECT t.rowid, t.code, t.taux as rate, t.recuperableonly as npr, t.accountancy_code_sell, t.accountancy_code_buy"; @@ -4713,8 +4713,9 @@ function getTaxesFromId($vatrate, $buyer=null, $seller=null, $firstparamisid=1) } $sql.=", ".MAIN_DB_PREFIX."c_country as c"; - if ($mysoc->country_code == 'ES') $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$buyer->country_code."'"; // local tax in spain use the buyer country ?? - else $sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$seller->country_code."'"; + /*if ($mysoc->country_code == 'ES') $sql.= " WHERE t.fk_pays = c.rowid AND c.code = '".$buyer->country_code."'"; // vat in spain use the buyer country ?? + else $sql.= " WHERE t.fk_pays = c.rowid AND c.code = '".$seller->country_code."'";*/ + $sql.= " WHERE t.fk_pays = c.rowid AND c.code = '".$seller->country_code."'"; $sql.= " AND t.taux = ".((float) $vatratecleaned)." AND t.active = 1"; if ($vatratecode) $sql.= " AND t.code = '".$vatratecode."'"; }