diff --git a/htdocs/admin/system/dolibarr.php b/htdocs/admin/system/dolibarr.php index 86f69680d01..f089351ec63 100644 --- a/htdocs/admin/system/dolibarr.php +++ b/htdocs/admin/system/dolibarr.php @@ -74,7 +74,7 @@ print "".$langs->trans("LanguageParameter"," //$var=!$var; //print "".$langs->trans("LanguageParameter","PHP LC_MONETARY")."".setlocale(LC_MONETARY,0)."\n"; $var=!$var; -print "=> price2num(1234.56)'.price2num(1233.56+1,'MT').""; +print "=> price2num(1234.56)'.price2num(1233.56+1,'2').""; $var=!$var; print "=> dolibarr_print_date(0,"daytext")'.dolibarr_print_date(0,"daytext").""; // Thousands @@ -87,18 +87,17 @@ $var=!$var; $dec=$langs->trans("SeparatorDecimal"); print "".$langs->trans("CurrentValueSeparatorDecimal")."".$dec."\n"; $var=!$var; -print "=> price2num('."'1".$thousand."234".$dec."56')".price2num("1".$thousand."234".$dec."56",'MT').""; -if ($thousand != ',' && $thousand != '.') +print "=> price2num('."'1".$thousand."234".$dec."56')".price2num("1".$thousand."234".$dec."56",'2').""; +if (($thousand != ',' && $thousand != '.') || ($thousand != ' ')) { $var=!$var; - print "=> price2num('."'1 234.56')".price2num("1 234.56",'MT').""; + print "=> price2num('."'1 234.56')".price2num("1 234.56",'2').""; print "\n"; } - -print ''.$langs->trans("TimeZone").''.$langs->trans("Value").''."\n"; +//print ''.$langs->trans("TimeZone").''.$langs->trans("Value").''."\n"; // Timezone $var=!$var; -print "".$langs->trans("DolibarrTZ")."".$langs->trans("FeatureNotYetAvailable")."\n"; +print "".$langs->trans("ClientTZ")."".$langs->trans("FeatureNotYetAvailable")."\n"; $var=!$var; print "".$langs->trans("ServerTZ")." (variable system TZ)".$_ENV["TZ"]."\n"; $var=!$var; diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 3fb21a234af..ae7782b3a4e 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -77,9 +77,9 @@ ParameterInDolibarr=Parameter %s LanguageParameter=Language parameter %s LanguageBrowserParameter=Parameter %s LocalisationDolibarrParameters=Localisation parameters -DolibarrTZ=Time Zone Dolibarr -ServerTZ=Time Zone Server -PHPTZ=Time Zone PHP +ClientTZ=Time Zone Client (user) +ServerTZ=Time Zone Server OS +PHPTZ=Time Zone Server PHP PHPServerOffsetWithGreenwich=Offset for PHP server width Greenwich (secondes) CurrentHour=Current hour CurrentSessionTimeOut=Current session timeout diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index 6a0ca456b8a..97728a98191 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -75,9 +75,9 @@ ParameterInDolibarr=Variable %s LanguageParameter=Variable idioma %s LanguageBrowserParameter=Variable %s LocalisationDolibarrParameters=Parámetros de localización -DolibarrTZ=Zona hoaria -ServerTZ=Zona hoaria -PHPTZ=Zona horaria PHP +ClientTZ=Zona hoaria (user) +ServerTZ=Zona hoaria server OS +PHPTZ=Zona horaria server PHP PHPServerOffsetWithGreenwich=Offset con Greenwich (segundos) CurrentHour=Hora actual CurrentSessionTimeOut=Tiempo espera sesión actual diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 67f512e5fa4..42c3d09d549 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -37,7 +37,7 @@ UsePopupCalendar=Utiliser les popups pour la saisie des dates UsePreviewTabs=Afficher les onglets "Aperçu" ShowPreview=Afficher aperçu ThemeCurrentlyActive=Theme actuellement actif -CurrentTimeZone=TimeZone courant +CurrentTimeZone=Time Zone courant Space=Espace Fields=Champs Mask=Masque @@ -77,9 +77,9 @@ ParameterInDolibarr=Variable %s LanguageParameter=Variable langue %s LanguageBrowserParameter=Variable %s LocalisationDolibarrParameters=Paramčtres de localisation -DolibarrTZ=Time Zone Dolibarr -ServerTZ=Time Zone Serveur -PHPTZ=Time Zone PHP +ClientTZ=Time Zone Client (utilisateur) +ServerTZ=Time Zone Serveur OS +PHPTZ=Time Zone Serveur PHP PHPServerOffsetWithGreenwich=Offset serveur PHP avec Greenwich (secondes) CurrentHour=Heure courante CurrentSessionTimeOut=Time out session courante diff --git a/htdocs/langs/it_IT/admin.lang b/htdocs/langs/it_IT/admin.lang index c7cb180a68f..9ae443f5810 100644 --- a/htdocs/langs/it_IT/admin.lang +++ b/htdocs/langs/it_IT/admin.lang @@ -71,9 +71,9 @@ ParameterInDolibarr =Parametro %s LanguageParameter =Lingua parametro %s LanguageBrowserParameter =Parametro %s LocalisationDolibarrParameters =Parametri di localizzazione -DolibarrTZ =Fuso orario Dolibarr -ServerTZ =Fuso orario server -PHPTZ =Fuso orario php +ClientTZ =Fuso orario client (user) +ServerTZ =Fuso orario server OS +PHPTZ =Fuso orario server PHP PHPServerOffsetWithGreenwich =Offset per PHP server larghezza di Greenwich (secondi) CurrentHour =Ora corrente OSEnv =OS Ambiente diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index 562d8a329f5..b1b70bea980 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -2145,8 +2145,8 @@ function price2num($amount,$rounding='',$alreadysqlnb=-1) { global $langs,$conf; - // Round PHP function does not allow number like '1,234.5' nor '1.234,5' nor '1 234,5' - // Numbers must be '1234.5' + // Round PHP function does not allow number like '1,234.56' nor '1.234,56' nor '1 234,56' + // Numbers must be '1234.56' // Decimal delimiter for database SQL request must be '.' $dec=','; $thousand=' '; if ($langs->trans("SeparatorDecimal") != "SeparatorDecimal") $dec=$langs->trans("SeparatorDecimal"); @@ -2180,7 +2180,8 @@ function price2num($amount,$rounding='',$alreadysqlnb=-1) if ($rounding == 'MU') $nbofdectoround=$conf->global->MAIN_MAX_DECIMALS_UNIT; elseif ($rounding == 'MT') $nbofdectoround=$conf->global->MAIN_MAX_DECIMALS_TOT; elseif ($rounding == 'MS') $nbofdectoround=$conf->global->MAIN_MAX_DECIMALS_SHOWN; - if ($nbofdectoround) $amount = round($amount,$nbofdectoround); + elseif ($rounding == '2') $nbofdectoround=2; // For admin info page + if (strlen($nbofdectoround)) $amount = round($amount,$nbofdectoround); // $nbofdectoround can be 0. else return 'ErrorBadParameterProvidedToFunction'; //print 'ZZ'.$nbofdec.'-'.$nbofdectoround.'=>'.$amount.'
';