forked from Wavyzz/dolibarr
Merge remote-tracking branch 'origin/3.7' into develop
Conflicts: htdocs/accountancy/customer/card.php htdocs/accountancy/journal/sellsjournal.php htdocs/admin/menus.php htdocs/fourn/commande/card.php htdocs/install/check.php
This commit is contained in:
@@ -488,13 +488,15 @@ function dolEscapeXML($string)
|
||||
*
|
||||
* @param string $stringtoescape String to escape
|
||||
* @param string $mode 0=Escape also ' and " into ', 1=Escape ' but not " for usage into 'string', 2=Escape " but not ' for usage into "string", 3=Escape ' and " with \
|
||||
* @param string $noescapebackslashn 0=Escape also \n. 1=Do not escape \n.
|
||||
* @return string Escaped string. Both ' and " are escaped into ' if they are escaped.
|
||||
*/
|
||||
function dol_escape_js($stringtoescape, $mode=0)
|
||||
function dol_escape_js($stringtoescape, $mode=0, $noescapebackslashn=0)
|
||||
{
|
||||
// escape quotes and backslashes, newlines, etc.
|
||||
$substitjs=array("'"=>"\\'",'\\'=>'\\\\',"\r"=>'\\r',"\n"=>'\\n');
|
||||
$substitjs=array("'"=>"\\'","\r"=>'\\r');
|
||||
//$substitjs['</']='<\/'; // We removed this. Should be useless.
|
||||
if (empty($noescapebackslashn)) { $substitjs["\n"]='\\n'; $substitjs['\\']='\\\\'; }
|
||||
if (empty($mode)) { $substitjs["'"]="\\'"; $substitjs['"']="\\'"; }
|
||||
else if ($mode == 1) $substitjs["'"]="\\'";
|
||||
else if ($mode == 2) { $substitjs['"']='\\"'; }
|
||||
@@ -1119,7 +1121,7 @@ function dol_getdate($timestamp,$fast=false)
|
||||
* @param int $year Year
|
||||
* @param mixed $gm True or 1 or 'gmt'=Input informations are GMT values, False or 0 or 'server' = local to server TZ, 'user' = local to user TZ
|
||||
* @param int $check 0=No check on parameters (Can use day 32, etc...)
|
||||
* @return timestamp|string Date as a timestamp, '' if error
|
||||
* @return timestamp|string Date as a timestamp, '' or false if error
|
||||
* @see dol_print_date, dol_stringtotime, dol_getdate
|
||||
*/
|
||||
function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1)
|
||||
@@ -3389,7 +3391,7 @@ function get_product_vat_for_country($idprod, $thirdparty_seller, $idprodfournpr
|
||||
$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.recuperableonly ASC";
|
||||
$sql.= $db->plimit(1);
|
||||
|
||||
print $sql;
|
||||
$resql=$db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
@@ -3515,7 +3517,7 @@ function get_default_tva($thirdparty_seller, $thirdparty_buyer, $idprod=0, $idpr
|
||||
// we use the buyer VAT.
|
||||
if (! empty($conf->global->SERVICE_ARE_ECOMMERCE_200238EC))
|
||||
{
|
||||
if (! $seller_in_cee && $buyer_in_cee && ! $thirdparty_buyer->isACompany())
|
||||
if ($seller_in_cee && $buyer_in_cee && ! $thirdparty_buyer->isACompany())
|
||||
{
|
||||
//print 'VATRULE 0';
|
||||
return get_product_vat_for_country($idprod,$thirdparty_buyer,$idprodfournprice);
|
||||
|
||||
Reference in New Issue
Block a user