mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-12-08 10:38:15 +01:00
Fix price2num when $langs not defined
This commit is contained in:
@@ -5351,12 +5351,17 @@ function price2num($amount, $rounding = '', $option = 0)
|
|||||||
// Decimal delimiter for PHP and database SQL requests must be '.'
|
// Decimal delimiter for PHP and database SQL requests must be '.'
|
||||||
$dec = ',';
|
$dec = ',';
|
||||||
$thousand = ' ';
|
$thousand = ' ';
|
||||||
|
if (is_null($langs)) { // $langs is not defined, we use english values.
|
||||||
|
$dec = '.';
|
||||||
|
$thousand = ',';
|
||||||
|
} else {
|
||||||
if ($langs->transnoentitiesnoconv("SeparatorDecimal") != "SeparatorDecimal") {
|
if ($langs->transnoentitiesnoconv("SeparatorDecimal") != "SeparatorDecimal") {
|
||||||
$dec = $langs->transnoentitiesnoconv("SeparatorDecimal");
|
$dec = $langs->transnoentitiesnoconv("SeparatorDecimal");
|
||||||
}
|
}
|
||||||
if ($langs->transnoentitiesnoconv("SeparatorThousand") != "SeparatorThousand") {
|
if ($langs->transnoentitiesnoconv("SeparatorThousand") != "SeparatorThousand") {
|
||||||
$thousand = $langs->transnoentitiesnoconv("SeparatorThousand");
|
$thousand = $langs->transnoentitiesnoconv("SeparatorThousand");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ($thousand == 'None') {
|
if ($thousand == 'None') {
|
||||||
$thousand = '';
|
$thousand = '';
|
||||||
} elseif ($thousand == 'Space') {
|
} elseif ($thousand == 'Space') {
|
||||||
|
|||||||
Reference in New Issue
Block a user