Fix: No hard coded precision. Second param must be 'MU' (we want a

unit price so 'MU'. If unit price was on 4 decimal, we must keep 4
decimals once vat rate was changed)
This commit is contained in:
Laurent Destailleur 2012-05-23 02:31:38 +02:00
parent 8eb73aaa33
commit dc16085d57

View File

@ -70,11 +70,11 @@ if ($action == 'convert')
{ {
if ($price_base_type == 'TTC') if ($price_base_type == 'TTC')
{ {
$newprice=price2num($object->price_ttc,'2'); $newprice=price2num($object->price_ttc,'MU'); // Second param must be MU (we want a unit price so 'MT'. If unit price was on 4 decimal, we must keep 4 decimals)
} }
else else
{ {
$newprice=price2num($object->price,'MU'); $newprice=price2num($object->price,'MU'); // Second param must be MU (we want a unit price so 'MT'. If unit price was on 4 decimal, we must keep 4 decimals)
} }
$newvat=str_replace('*','',$newvatrate); $newvat=str_replace('*','',$newvatrate);