You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2006/12/09 11:16:12 UTC

svn commit: r484961 - in /incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order: order/OrderReadHelper.java shoppingcart/ShoppingCartServices.java

Author: jacopoc
Date: Sat Dec  9 02:16:10 2006
New Revision: 484961

URL: http://svn.apache.org/viewvc?view=rev&rev=484961
Log:
Applied patch from Scott Gray to fix an issue reported by Ray Barlow in OFBIZ-386:
"Adding additional items in order entry messes up values for quantity/remaining/outstanding on cancelled line items"

Modified:
    incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java
    incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java

Modified: incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java?view=diff&rev=484961&r1=484960&r2=484961
==============================================================================
--- incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java (original)
+++ incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java Sat Dec  9 02:16:10 2006
@@ -2259,16 +2259,9 @@
     }
 
     public static BigDecimal getOrderItemQuantityBd(GenericValue orderItem) {
-        String cancelQtyField = "cancelQuantity";
-        String quantityField = "quantity";
 
-        if ("OrderItemAndShipGroupAssoc".equals(orderItem.getEntityName())) {
-            cancelQtyField = "cancelQuantity";
-            quantityField = "quantity";
-        }
-
-        BigDecimal cancelQty = orderItem.getBigDecimal(cancelQtyField);
-        BigDecimal orderQty = orderItem.getBigDecimal(quantityField);
+        BigDecimal cancelQty = orderItem.getBigDecimal("cancelQuantity");
+        BigDecimal orderQty = orderItem.getBigDecimal("quantity");
 
         if (cancelQty == null) cancelQty = ZERO;
         if (orderQty == null) orderQty = ZERO;

Modified: incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java
URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java?view=diff&rev=484961&r1=484960&r2=484961
==============================================================================
--- incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java (original)
+++ incubator/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCartServices.java Sat Dec  9 02:16:10 2006
@@ -270,7 +270,7 @@
                     amount = new Double(0);
                 }
                 double quantityDbl = 0;
-                BigDecimal quantity = OrderReadHelper.getOrderItemQuantityBd(item);
+                BigDecimal quantity = item.getBigDecimal("quantity");
                 if (quantity != null) {
                     quantityDbl = quantity.doubleValue();
                 }