Perf: Try a speed enhancement
This commit is contained in:
parent
dd9e150743
commit
18a7cd1e33
@ -1399,23 +1399,6 @@ function dol_print_address($address, $htmlid, $mode, $id)
|
|||||||
if ($showmap)
|
if ($showmap)
|
||||||
{
|
{
|
||||||
$url=dol_buildpath('/google/gmaps.php?mode='.$mode.'&id='.$id,1);
|
$url=dol_buildpath('/google/gmaps.php?mode='.$mode.'&id='.$id,1);
|
||||||
/* print ' <img id="'.$htmlid.'" src="'.DOL_URL_ROOT.'/theme/common/gmap.png">';
|
|
||||||
print '<script type="text/javascript">
|
|
||||||
$(\'#gmap\').css(\'cursor\',\'pointer\');
|
|
||||||
$(\'#gmap\').click(function() {
|
|
||||||
$( \'<div>\').dialog({
|
|
||||||
modal: true,
|
|
||||||
open: function ()
|
|
||||||
{
|
|
||||||
$(this).load(\''.$url.'\');
|
|
||||||
},
|
|
||||||
height: 400,
|
|
||||||
width: 600,
|
|
||||||
title: \'GMap\'
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
'; */
|
|
||||||
print ' <a href="'.$url.'" target="_gmaps"><img id="'.$htmlid.'" border="0" src="'.DOL_URL_ROOT.'/theme/common/gmap.png"></a>';
|
print ' <a href="'.$url.'" target="_gmaps"><img id="'.$htmlid.'" border="0" src="'.DOL_URL_ROOT.'/theme/common/gmap.png"></a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -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 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
|
* @param Societe $societe_acheteuse Object of buying third party
|
||||||
* @return int 0 if not found, localtax if found
|
* @return int 0 if not found, localtax if found
|
||||||
*/
|
*/
|
||||||
@ -2788,6 +2771,10 @@ function get_localtax($tva, $local, $societe_acheteuse="")
|
|||||||
{
|
{
|
||||||
global $db, $conf, $mysoc;
|
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;
|
$code_pays=$mysoc->pays_code;
|
||||||
|
|
||||||
if (is_object($societe_acheteuse))
|
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 .= " 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 .= " WHERE t.fk_pays = p.rowid AND p.code = '".$code_pays."'";
|
||||||
$sql .= " AND t.taux = ".$tva." AND t.active = 1";
|
$sql .= " AND t.taux = ".$tva." AND t.active = 1";
|
||||||
$sql .= " ORDER BY t.localtax1 ASC, t.localtax2 ASC";
|
|
||||||
|
|
||||||
$resql=$db->query($sql);
|
$resql=$db->query($sql);
|
||||||
if ($resql)
|
if ($resql)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user