Rounding error in prorating returned adjustments
------------------------------------------------
Key: OFBIZ-4038
URL: https://issues.apache.org/jira/browse/OFBIZ-4038
Project: OFBiz
Issue Type: Bug
Affects Versions: Release 09.04, Release Branch 09.04, Release Branch 10.04
Reporter: Wickersheimer Jeremy
Priority: Minor
The error is in
applications/order/src/org/ofbiz/order/order/OrderReturnServices.java the
getAdjustmentAmount method is prorating using this code:
newAmount = returnTotal.divide(originalTotal, decimals,
rounding).multiply(amount).setScale(decimals, rounding);
it should be:
newAmount = returnTotal.multiply(amount).divide(originalTotal, decimals,
rounding);
else by dividing first what should be for example 1/3 of the adjustment ends up
being 0.33
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.