forked from Wavyzz/dolibarr
Fix escape
This commit is contained in:
@@ -4857,10 +4857,10 @@ function get_localtax($vatrate, $local, $thirdparty_buyer = "", $thirdparty_sell
|
||||
// By default, search value of local tax on line of common tax
|
||||
$sql = "SELECT t.localtax1, t.localtax2, t.localtax1_type, t.localtax2_type";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_country as c";
|
||||
$sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$thirdparty_seller->country_code."'";
|
||||
$sql .= " WHERE t.fk_pays = c.rowid AND c.code = '".$db->escape($thirdparty_seller->country_code)."'";
|
||||
$sql .= " AND t.taux = ".((float) $vatratecleaned)." AND t.active = 1";
|
||||
if ($vatratecode) $sql .= " AND t.code ='".$vatratecode."'"; // If we have the code, we use it in priority
|
||||
else $sql .= " AND t.recuperableonly ='".$vatnpr."'";
|
||||
if ($vatratecode) $sql .= " AND t.code ='".$db->escape($vatratecode)."'"; // If we have the code, we use it in priority
|
||||
else $sql .= " AND t.recuperableonly ='".$db->escape($vatnpr)."'";
|
||||
dol_syslog("get_localtax", LOG_DEBUG);
|
||||
$resql = $db->query($sql);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user