Author: jacopoc
Date: Fri Feb 23 07:54:11 2007
New Revision: 510992
URL:
http://svn.apache.org/viewvc?view=rev&rev=510992Log:
Improved isBinComplete method to better handle empty bins.
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=510992&r1=510991&r2=510992==============================================================================
--- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/picklist/PickListServices.java (original)
+++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/picklist/PickListServices.java Fri Feb 23 07:54:11 2007
@@ -35,6 +35,7 @@
import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
+import org.ofbiz.base.util.UtilValidate;
public class PickListServices {
@@ -97,17 +98,20 @@
throw e;
}
- if (items != null) {
+ if (!UtilValidate.isEmpty(items)) {
Iterator i = items.iterator();
- GenericValue v = (GenericValue) i.next();
- String itemStatus = v.getString("itemStatusId");
- if (itemStatus != null) {
- if (!"PICKITEM_COMPLETED".equals(itemStatus)) {
- return false;
+ while (i.hasNext()) {
+ GenericValue v = (GenericValue) i.next();
+ String itemStatus = v.getString("itemStatusId");
+ if (itemStatus != null) {
+ if (!"PICKITEM_COMPLETED".equals(itemStatus)) {
+ return false;
+ }
}
}
+ return true;
}
- return true;
+ return false;
}
}