From dee9442720e4af73019114ce1354b45359f5818f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sat, 1 Sep 2018 13:12:09 +0200 Subject: [PATCH] Fix regression --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 236ceaa1a62..77d64406d3b 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -5001,7 +5001,7 @@ function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournpr if (empty($conf->global->MAIN_VAT_DEFAULT_IF_AUTODETECT_FAILS)) { // If vat of product for the country not found or not defined, we return the first higher vat of country. - $sql = "SELECT c.taux as vat_rate, c.code as default_vat_code"; + $sql = "SELECT t.taux as vat_rate, t.code as default_vat_code"; $sql.= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c"; $sql.= " WHERE t.active=1 AND t.fk_pays = c.rowid AND c.code='".$thirdparty_seller->country_code."'"; $sql.= " ORDER BY t.taux DESC, t.code ASC, t.recuperableonly ASC";