FIX get_product_vat_for_country functions.lib.php

This commit is contained in:
Frédéric FRANCE 2018-08-31 20:23:26 +02:00 committed by GitHub
parent ca2e9f20f6
commit 66d64359cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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";