svn commit: r1661342 - /ofbiz/branches/release14.12/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: r1661342 - /ofbiz/branches/release14.12/applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy

ashish-18
Author: ashish
Date: Sat Feb 21 12:28:59 2015
New Revision: 1661342

URL: http://svn.apache.org/r1661342
Log:
Applied bug fix from trunk r1661339.
============================================================================
Applied patch from jira issue - OFBIZ-6058 - Find Shipment generates an error.
Thanks Pierre for reporting the issue, thanks Amardeep for providing the patch.
============================================================================

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

Modified: ofbiz/branches/release14.12/applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/release14.12/applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy?rev=1661342&r1=1661341&r2=1661342&view=diff
==============================================================================
--- ofbiz/branches/release14.12/applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy (original)
+++ ofbiz/branches/release14.12/applications/product/webapp/facility/WEB-INF/actions/shipment/FindShipment.groovy Sat Feb 21 12:28:59 2015
@@ -117,11 +117,6 @@ if (maxDate && maxDate.length() > 8) {
 if ("Y".equals(lookupFlag)) {
     context.paramList = paramListBuffer.toString();
 
-    mainCond = null;
-    if (findShipmentExprs.size() > 0) {
-        mainCond = EntityCondition.makeCondition(findShipmentExprs, EntityOperator.AND);
-    }
-
     beganTransaction = false;
     try {
         beganTransaction = TransactionUtil.begin();
@@ -132,7 +127,11 @@ if ("Y".equals(lookupFlag)) {
         
         if (!orderReturnValue) {
             // using list iterator
-            orli = from("Shipment").where(mainCond).orderBy("-estimatedShipDate").cursorScrollInsensitive().distinct().maxRows(highIndex).queryIterator();
+            if (findShipmentExprs.size() > 0) {
+                orli = from("Shipment").where(EntityCondition.makeCondition(findShipmentExprs, EntityOperator.AND)).orderBy("-estimatedShipDate").cursorScrollInsensitive().distinct().maxRows(highIndex).queryIterator();
+            } else {
+                orli = from("Shipment").orderBy("-estimatedShipDate").cursorScrollInsensitive().distinct().maxRows(highIndex).queryIterator();
+            }
     
             shipmentListSize = orli.getResultsSizeAfterPartialList();
             if (highIndex > shipmentListSize) {