diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 772ee84c891..33d3961ce74 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1399,23 +1399,6 @@ function dol_print_address($address, $htmlid, $mode, $id) if ($showmap) { $url=dol_buildpath('/google/gmaps.php?mode='.$mode.'&id='.$id,1); - /* print ' '; - print ' - '; */ print ' '; } } @@ -2777,10 +2760,10 @@ function price2num($amount,$rounding='',$alreadysqlnb=0) } /** - * Return localtaxe rate for a particular tva + * Return localtaxe rate for a particular vat * * @param float $tva Vat taxe - * @param int $local Local taxe to search and return + * @param int $local Local tax to search and return (1 or 2) * @param Societe $societe_acheteuse Object of buying third party * @return int 0 if not found, localtax if found */ @@ -2788,6 +2771,10 @@ function get_localtax($tva, $local, $societe_acheteuse="") { global $db, $conf, $mysoc; + // TODO Can we uncomment this ? + //if ($local == 1 && empty($conf->global->FACTURE_LOCAL_TAX1_OPTION)) return; + //if ($local == 2 && empty($conf->global->FACTURE_LOCAL_TAX2_OPTION)) return; + $code_pays=$mysoc->pays_code; if (is_object($societe_acheteuse)) @@ -2802,7 +2789,6 @@ function get_localtax($tva, $local, $societe_acheteuse="") $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; $sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$code_pays."'"; $sql .= " AND t.taux = ".$tva." AND t.active = 1"; - $sql .= " ORDER BY t.localtax1 ASC, t.localtax2 ASC"; $resql=$db->query($sql); if ($resql)