Fix rounding of foreign amount

This commit is contained in:
Laurent Destailleur
2021-01-11 13:46:23 +01:00
parent 3a2230e41d
commit f9f84f84ba
2 changed files with 3 additions and 2 deletions

View File

@@ -4826,7 +4826,8 @@ function price($amount, $form = 0, $outlangs = '', $trunc = 1, $rounding = -1, $
* 'MU'=Round to Max unit price (MAIN_MAX_DECIMALS_UNIT) * 'MU'=Round to Max unit price (MAIN_MAX_DECIMALS_UNIT)
* 'MT'=Round to Max for totals with Tax (MAIN_MAX_DECIMALS_TOT) * 'MT'=Round to Max for totals with Tax (MAIN_MAX_DECIMALS_TOT)
* 'MS'=Round to Max for stock quantity (MAIN_MAX_DECIMALS_STOCK) * 'MS'=Round to Max for stock quantity (MAIN_MAX_DECIMALS_STOCK)
* 'CR'=Foreign currency accurancy * 'CU'=Round to Max unit price of foreign currency accuracy
* 'CT'=Round to Max for totals with Tax of foreign currency accuracy
* Numeric = Nb of digits for rounding * Numeric = Nb of digits for rounding
* @param int $option Put 1 if you know that content is already universal format number (so no correction on decimal will be done) * @param int $option Put 1 if you know that content is already universal format number (so no correction on decimal will be done)
* Put 2 if you know that number is a user input (so we know we don't have to fix decimal separator). * Put 2 if you know that number is a user input (so we know we don't have to fix decimal separator).

View File

@@ -869,7 +869,7 @@ if (empty($reshook))
} }
$price_base_type = 'HT'; $price_base_type = 'HT';
$pu_ht_devise = GETPOST('multicurrency_subprice', 'CU'); $pu_ht_devise = price2num(GETPOST('multicurrency_subprice'), 'CU');
// Add buying price // Add buying price
$fournprice = (GETPOST('fournprice') ? GETPOST('fournprice') : ''); $fournprice = (GETPOST('fournprice') ? GETPOST('fournprice') : '');