RE: Wrong decimal places and approximation
Look at lines 738-744 of PO_Items.php. It uses the currency # of decimal places when the price > 1, otherwise 4 decimals.
You can change this code to always use 4, or always use th standard cost decimal places parameter
// Note if the price is greater than 1 use 2 decimal place, if the price is a fraction of 1, use 4 decimal places
// This should help display where item-price is a fraction
if ($POLine->Price > 1) {
$DisplayPrice = locale_number_format($POLine->Price,$_SESSION['PO'.$identifier]->CurrDecimalPlaces);
$SuppPrice = locale_number_format(round(($POLine->Price *$POLine->ConversionFactor),$_SESSION['PO'.$identifier]->CurrDecimalPlaces),$_SESSION['PO'.$identifier]->CurrDecimalPlaces);
} else {
$DisplayPrice = locale_number_format($POLine->Price,4);
$SuppPrice = locale_number_format(round(($POLine->Price *$POLine->ConversionFactor),4),4);
}
I changed the above to this code: Note a '//' is a comment and makes that code not fire.
// Note if the price is greater than 1 use 2 decimal place, if the price is a fraction of 1, use 4 decimal places
// This should help display where item-price is a fraction
//if ($POLine->Price > 1) {
// $DisplayPrice = locale_number_format($POLine->Price,$_SESSION['PO'.$identifier]->CurrDecimalPlaces);
// $SuppPrice = locale_number_format(round(($POLine->Price *$POLine->ConversionFactor),$_SESSION['PO'.$identifier]->CurrDecimalPlaces),$_SESSION['PO'.$identifier]->CurrDecimalPlaces);
//} else {
$DisplayPrice = locale_number_format($POLine->Price,$_SESSION['StandardCostDecimalPlaces']);
$SuppPrice = locale_number_format(round(($POLine->Price *$POLine->ConversionFactor),$_SESSION['StandardCostDecimalPlaces']),$_SESSION['StandardCostDecimalPlaces']);
//}
|