[OFBiz] SVN: r6922 - trunk/applications/order/src/org/ofbiz/order/order

sichen@svn.ofbiz.org sichen at svn.ofbiz.org
Mon Mar 6 10:40:20 CST 2006


Author: sichen
Date: 2006-03-06 10:40:17 -0600 (Mon, 06 Mar 2006)
New Revision: 6922

Modified:
   trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java
Log:
Fixed bug OFBIZ-776 where ordering would cause ecommerce to crash due to a divide by zero. The problem was a typo in BigDecimal refactoring. Thanks to Jaques Le Roux.

Modified: trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java
===================================================================
--- trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java	2006-03-05 06:49:14 UTC (rev 6921)
+++ trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java	2006-03-06 16:40:17 UTC (rev 6922)
@@ -1490,7 +1490,7 @@
         // calculate tax and shipping adjustments for entire order, add to result
         BigDecimal orderItemsSubTotal = this.getOrderItemsSubTotalBd();
         BigDecimal orderFactorNotReturned = ZERO;
-        if (orderItemsSubTotal.signum() == 0) {
+        if (orderItemsSubTotal.signum() != 0) {
             orderFactorNotReturned = totalSubTotalNotReturned.divide(orderItemsSubTotal, scale, rounding);
         }
         BigDecimal orderTaxNotReturned = this.getHeaderTaxTotalBd().multiply(orderFactorNotReturned).setScale(scale, rounding);



More information about the Svn mailing list