2
0
forked from Wavyzz/dolibarr

FIX calculation of balance in conciliation page on desc sorting.

This commit is contained in:
Laurent Destailleur
2021-11-11 13:49:21 +01:00
parent bbd97c6e16
commit 0443302c3d
2 changed files with 13 additions and 8 deletions

View File

@@ -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;