svn commit: r773185 - /ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/ReviewOrdersNotPickedOrPacked.groovy

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

svn commit: r773185 - /ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/ReviewOrdersNotPickedOrPacked.groovy

mor-2
Author: mor
Date: Sat May  9 09:22:40 2009
New Revision: 773185

URL: http://svn.apache.org/viewvc?rev=773185&view=rev
Log:
Improved part of code related to Add a page that shows orders with the "pick sheet printed date" field.
Patch from Arun Patidar, part of OFBIZ-2388 (https://issues.apache.org/jira/browse/OFBIZ-2388)

Modified:
    ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/ReviewOrdersNotPickedOrPacked.groovy

Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/ReviewOrdersNotPickedOrPacked.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/ReviewOrdersNotPickedOrPacked.groovy?rev=773185&r1=773184&r2=773185&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/ReviewOrdersNotPickedOrPacked.groovy (original)
+++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/ReviewOrdersNotPickedOrPacked.groovy Sat May  9 09:22:40 2009
@@ -19,23 +19,19 @@
 
 import org.ofbiz.entity.condition.EntityCondition;
 import org.ofbiz.entity.condition.EntityOperator;
+import org.ofbiz.entity.util.EntityUtil;
 
-orderHeaders = delegator.findList("OrderHeader", null, null, null, null, false);
+condList = [];
+condList.add(EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, "ORDER_APPROVED"));
+condList.add(EntityCondition.makeCondition("orderTypeId", EntityOperator.EQUALS, "SALES_ORDER"));
+condList.add(EntityCondition.makeCondition("pickSheetPrintedDate", EntityOperator.NOT_EQUAL, null));
+cond = EntityCondition.makeCondition(condList, EntityOperator.AND);
+orderHeaders = delegator.findList("OrderHeader", cond, null, null, null, false);
 orders = [];
-
 orderHeaders.each { orderHeader ->
-    if (orderHeader.pickSheetPrintedDate) {
-        orderShipments = delegator.findList("Shipment", EntityCondition.makeCondition("primaryOrderId", EntityOperator.EQUALS, orderHeader.orderId), null, null, null, false);
-        if (orderShipments) {
-            orderShipments.each { orderShipment ->
-                if (orderShipment.statusId == "SHIPMENT_INPUT" || orderShipment.statusId == "SHIPMENT_SCHEDULED") {
-                    orders.add([orderId : orderHeader.orderId, pickSheetPrintedDate : orderHeader.pickSheetPrintedDate]);
-                }
-            }
-        }
-        else {
-            orders.add([orderId : orderHeader.orderId, pickSheetPrintedDate : orderHeader.pickSheetPrintedDate]);
-        }
+    itemIssuanceList = delegator.findByAnd("ItemIssuance", [orderId : orderHeader.orderId]);
+    if (!itemIssuanceList) {
+        orders.add([orderId : orderHeader.orderId, pickSheetPrintedDate : orderHeader.pickSheetPrintedDate]);
     }
 }
 context.orders = orders;
\ No newline at end of file