svn commit: r567065 - /ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java

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

svn commit: r567065 - /ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java

jacopoc
Author: jacopoc
Date: Fri Aug 17 08:15:19 2007
New Revision: 567065

URL: http://svn.apache.org/viewvc?view=rev&rev=567065
Log:
Implemented util methods to get the total shippable quantitiy from all the ship groups of an order.

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?view=diff&rev=567065&r1=567064&r2=567065
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java Fri Aug 17 08:15:19 2007
@@ -962,6 +962,19 @@
         return getShippableTotalBd(shipGroupSeqId).doubleValue();
     }
 
+    public BigDecimal getShippableQuantityBd() {
+        BigDecimal shippableQuantity = ZERO;
+        List shipGroups = getOrderItemShipGroups();
+        if (UtilValidate.isNotEmpty(shipGroups)) {
+            Iterator shipGroupsIt = shipGroups.iterator();
+            while (shipGroupsIt.hasNext()) {
+                GenericValue shipGroup = (GenericValue)shipGroupsIt.next();
+                shippableQuantity = shippableQuantity.add(getShippableQuantityBd(shipGroup.getString("shipGroupSeqId")));
+            }
+        }
+        return shippableQuantity.setScale(scale, rounding);
+    }
+
     public BigDecimal getShippableQuantityBd(String shipGroupSeqId) {
         BigDecimal shippableQuantity = ZERO;
         List validItems = getValidOrderItems(shipGroupSeqId);