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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

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

jacopoc
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();
                 }