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

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

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

lektran
Author: lektran
Date: Sat Nov 14 22:41:55 2009
New Revision: 836279

URL: http://svn.apache.org/viewvc?rev=836279&view=rev
Log:
Find Shipment search wasn't performing no condition finds

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

Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy?rev=836279&r1=836278&r2=836279&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy (original)
+++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy Sat Nov 14 22:41:55 2009
@@ -90,13 +90,14 @@
     paramListBuffer.append(maxDate);
     findShipmentExprs.add(EntityCondition.makeCondition("estimatedShipDate", EntityOperator.LESS_THAN_EQUAL_TO, ObjectType.simpleTypeConvert(maxDate, "Timestamp", null, null)));
 }
-
 if ("Y".equals(lookupFlag)) {
     context.paramList = paramListBuffer.toString();
 
-    if (findShipmentExprs.size() > 0) {
         findOpts = new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, true);
-        mainCond = EntityCondition.makeCondition(findShipmentExprs, EntityOperator.AND);
+        mainCond = null;
+        if (findShipmentExprs.size() > 0) {
+            mainCond = EntityCondition.makeCondition(findShipmentExprs, EntityOperator.AND);
+        }
         orderBy = ['-estimatedShipDate'];
 
         beganTransaction = false;
@@ -104,8 +105,8 @@
             beganTransaction = TransactionUtil.begin();
 
             // get the indexes for the partial list
-            lowIndex = (((viewIndex - 1) * viewSize) + 1);
-            highIndex = viewIndex * viewSize;
+            lowIndex = viewIndex * viewSize + 1;
+            highIndex = (viewIndex + 1) * viewSize;
             findOpts.setMaxRows(highIndex);
             // using list iterator
             orli = delegator.find("Shipment", mainCond, null, null, orderBy, findOpts);
@@ -139,12 +140,6 @@
             // only commit the transaction if we started one... this will throw an exception if it fails
             TransactionUtil.commit(beganTransaction);
         }
-    } else {
-        shipmentList = [] as ArrayList;
-        shipmentListSize = 0;
-        highIndex = 0;
-        lowIndex = 0;
-    }
 
     context.shipmentList = shipmentList;
     context.listSize = shipmentListSize;