svn commit: r496779 - /ofbiz/trunk/applications/product/src/org/ofbiz/shipment/picklist/PickListServices.java

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

svn commit: r496779 - /ofbiz/trunk/applications/product/src/org/ofbiz/shipment/picklist/PickListServices.java

jaz-3
Author: jaz
Date: Tue Jan 16 09:20:28 2007
New Revision: 496779

URL: http://svn.apache.org/viewvc?view=rev&rev=496779
Log:
new helper method to check if bin is complete

Modified:
    ofbiz/trunk/applications/product/src/org/ofbiz/shipment/picklist/PickListServices.java

Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/picklist/PickListServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/picklist/PickListServices.java?view=diff&rev=496779&r1=496778&r2=496779
==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/picklist/PickListServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/picklist/PickListServices.java Tue Jan 16 09:20:28 2007
@@ -29,8 +29,10 @@
 import org.ofbiz.entity.condition.EntityCondition;
 import org.ofbiz.entity.GenericDelegator;
 import org.ofbiz.entity.GenericEntityException;
+import org.ofbiz.entity.GenericValue;
 import org.ofbiz.base.util.UtilMisc;
 import org.ofbiz.base.util.Debug;
+import org.ofbiz.base.util.GeneralException;
 
 public class PickListServices {
 
@@ -81,5 +83,29 @@
         Map result = ServiceUtil.returnSuccess();
         result.put("orderHeaderList", orderHeaderList);
         return result;
+    }
+
+    public static boolean isBinComplete(GenericDelegator delegator, String picklistBinId) throws GeneralException {
+        // lookup the items in the bin
+        List items;
+        try {
+            items = delegator.findByAnd("PicklistItem", UtilMisc.toMap("picklistBinId", picklistBinId));
+        } catch (GenericEntityException e) {
+            Debug.logError(e, module);
+            throw e;
+        }
+
+        if (items != null) {
+            Iterator i = items.iterator();
+            GenericValue v = (GenericValue) i.next();
+            String itemStatus = v.getString("itemStatusId");
+            if (itemStatus != null) {
+                if (!"PICKITEM_COMPLETED".equals(itemStatus)) {
+                    return false;
+                }
+            }
+        }
+
+        return true;
     }
 }