Author: lektran
Date: Mon Jan 25 05:23:56 2010
New Revision: 902712
URL:
http://svn.apache.org/viewvc?rev=902712&view=revLog:
Code style fix, removed old comments and premature rounding held over from the days of doubles.
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=902712&r1=902711&r2=902712&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 Mon Jan 25 05:23:56 2010
@@ -2384,14 +2384,11 @@
BigDecimal adjustment = ZERO;
if (orderAdjustment.get("amount") != null) {
- // round amount to best precision (taxCalcScale) because db value of 0.825 is pulled as 0.8249999...
- BigDecimal amount = orderAdjustment.getBigDecimal("amount").setScale(taxCalcScale, taxRounding);
+ BigDecimal amount = orderAdjustment.getBigDecimal("amount");
adjustment = adjustment.add(amount);
- }
- else if (orderAdjustment.get("sourcePercentage") != null) {
- // round amount to best precision (taxCalcScale) because db value of 0.825 is pulled as 0.8249999...
- BigDecimal percent = orderAdjustment.getBigDecimal("sourcePercentage").setScale(taxCalcScale,taxRounding);
- BigDecimal amount = orderSubTotal.multiply(percent).multiply(percentage).setScale(taxCalcScale, taxRounding);
+ } else if (orderAdjustment.get("sourcePercentage") != null) {
+ BigDecimal percent = orderAdjustment.getBigDecimal("sourcePercentage");
+ BigDecimal amount = orderSubTotal.multiply(percent).multiply(percentage);
adjustment = adjustment.add(amount);
}
return adjustment.setScale(scale, rounding);