Author: lektran
Date: Thu Dec 6 23:37:10 2007 New Revision: 602011 URL: http://svn.apache.org/viewvc?rev=602011&view=rev Log: Round the total rather than the subtotals to avoid prematurely rounding tax adjustments, reported by Rashko Rejmer Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java?rev=602011&r1=602010&r2=602011&view=diff ============================================================================== --- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java (original) +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java Thu Dec 6 23:37:10 2007 @@ -2513,9 +2513,9 @@ Iterator itemIter = UtilMisc.toIterator(orderItems); while (itemIter != null && itemIter.hasNext()) { - result = result.add(getOrderItemAdjustmentsTotal((GenericValue) itemIter.next(), adjustments, includeOther, includeTax, includeShipping)).setScale(scale, rounding); + result = result.add(getOrderItemAdjustmentsTotal((GenericValue) itemIter.next(), adjustments, includeOther, includeTax, includeShipping)); } - return result; + return result.setScale(scale, rounding); } /** The passed adjustments can be all adjustments for the order, ie for all line items */ |
The rounding should be done per item, but if I remember right elsewhere it would have a slightly different scale, ie for most needs it would have 3 decimal places instead of 2. I think there is even separate configuration and infrastructure in place for that separate setting that is used elsewhere. -David On Dec 7, 2007, at 12:37 AM, [hidden email] wrote: > Author: lektran > Date: Thu Dec 6 23:37:10 2007 > New Revision: 602011 > > URL: http://svn.apache.org/viewvc?rev=602011&view=rev > Log: > Round the total rather than the subtotals to avoid prematurely > rounding tax adjustments, reported by Rashko Rejmer > > Modified: > ofbiz/trunk/applications/order/src/org/ofbiz/order/order/ > OrderReadHelper.java > > Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/ > OrderReadHelper.java > URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java?rev=602011&r1=602010&r2=602011&view=diff > = > = > = > = > = > = > = > = > ====================================================================== > --- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/ > OrderReadHelper.java (original) > +++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/ > OrderReadHelper.java Thu Dec 6 23:37:10 2007 > @@ -2513,9 +2513,9 @@ > Iterator itemIter = UtilMisc.toIterator(orderItems); > > while (itemIter != null && itemIter.hasNext()) { > - result = > result.add(getOrderItemAdjustmentsTotal((GenericValue) > itemIter.next(), adjustments, includeOther, includeTax, > includeShipping)).setScale(scale, rounding); > + result = > result.add(getOrderItemAdjustmentsTotal((GenericValue) > itemIter.next(), adjustments, includeOther, includeTax, > includeShipping)); > } > - return result; > + return result.setScale(scale, rounding); > } > > /** The passed adjustments can be all adjustments for the order, > ie for all line items */ > > |
Free forum by Nabble | Edit this page |