forked from Wavyzz/dolibarr
FIX calculation of balance in conciliation page on desc sorting.
This commit is contained in:
@@ -5378,13 +5378,16 @@ function price2num($amount, $rounding = '', $option = 0)
|
||||
if ($thousand != ',' && $thousand != '.') {
|
||||
$amount = str_replace(',', '.', $amount); // To accept 2 notations for french users
|
||||
}
|
||||
|
||||
$amount = str_replace(' ', '', $amount); // To avoid spaces
|
||||
$amount = str_replace($thousand, '', $amount); // Replace of thousand before replace of dec to avoid pb if thousand is .
|
||||
$amount = str_replace($dec, '.', $amount);
|
||||
|
||||
$amount = preg_replace('/[^0-9\-\.]/', '', $amount); // Clean non numeric chars (so it clean some UTF8 spaces for example.
|
||||
}
|
||||
//print ' XX'.$amount.' '.$rounding;
|
||||
|
||||
// Now, make a rounding if required
|
||||
// Now, $amount is a real PHP float number. We make a rounding if required.
|
||||
if ($rounding) {
|
||||
$nbofdectoround = '';
|
||||
if ($rounding == 'MU') {
|
||||
@@ -5424,9 +5427,12 @@ function price2num($amount, $rounding = '', $option = 0)
|
||||
if ($thousand != ',' && $thousand != '.') {
|
||||
$amount = str_replace(',', '.', $amount); // To accept 2 notations for french users
|
||||
}
|
||||
|
||||
$amount = str_replace(' ', '', $amount); // To avoid spaces
|
||||
$amount = str_replace($thousand, '', $amount); // Replace of thousand before replace of dec to avoid pb if thousand is .
|
||||
$amount = str_replace($dec, '.', $amount);
|
||||
|
||||
$amount = preg_replace('/[^0-9\-\.]/', '', $amount); // Clean non numeric chars (so it clean some UTF8 spaces for example.
|
||||
}
|
||||
|
||||
return $amount;
|
||||
|
||||
Reference in New Issue
Block a user