svn commit: r1748954 - in /ofbiz/branches/release14.12/applications/product: webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.groovy widget/facility/FacilityForms.xml widget/facility/FacilityScreens.xml

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

svn commit: r1748954 - in /ofbiz/branches/release14.12/applications/product: webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.groovy widget/facility/FacilityForms.xml widget/facility/FacilityScreens.xml

Mridul Pathak-5
Author: mridulpathak
Date: Sat Jun 18 10:31:17 2016
New Revision: 1748954

URL: http://svn.apache.org/viewvc?rev=1748954&view=rev
Log:
[OFBIZ-7186] Find Facility Inventory Items shows same 20 items on all pagination page. Thanks Arvind Singh Tomar for reporting the issue and providing the patch. Thanks Montalbano Florian for your contribution. Migrating fix from trunk r1748950.

Modified:
    ofbiz/branches/release14.12/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.groovy
    ofbiz/branches/release14.12/applications/product/widget/facility/FacilityForms.xml
    ofbiz/branches/release14.12/applications/product/widget/facility/FacilityScreens.xml

Modified: ofbiz/branches/release14.12/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/release14.12/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.groovy?rev=1748954&r1=1748953&r2=1748954&view=diff
==============================================================================
--- ofbiz/branches/release14.12/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.groovy (original)
+++ ofbiz/branches/release14.12/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.groovy Sat Jun 18 10:31:17 2016
@@ -39,6 +39,7 @@ hasOffsetQOH = false;
 hasOffsetATP = false;
 
 rows = [] as ArrayList;
+int listSize = 0; // The complete size of the list of result (for pagination)
 
 if (action) {
     // ------------------------------
@@ -124,11 +125,15 @@ if (action) {
     whereCondition = EntityCondition.makeCondition(whereConditionsList, EntityOperator.AND);
 
     beganTransaction = false;
+    // get the indexes for the partial list
+    lowIndex = ((viewIndex.intValue() * viewSize.intValue()) + 1);
+    highIndex = (viewIndex.intValue() + 1) * viewSize.intValue();
     List prods = null;
     try {
         beganTransaction = TransactionUtil.begin();
         prodsEli = from(prodView).where(whereCondition).orderBy("productId").cursorScrollInsensitive().distinct().queryIterator();
-        prods = prodsEli.getCompleteList();
+        prods = prodsEli.getPartialList(lowIndex, highIndex);
+        listSize = prodsEli.getResultsSizeAfterPartialList();
         prodsEli.close();
     } catch (GenericEntityException e) {
         errMsg = "Failure in operation, rolling back transaction";
@@ -198,6 +203,7 @@ if (action) {
         }
     }
 }
-context.overrideListSize = rows.size();
+
+context.overrideListSize = listSize;
 context.inventoryByProduct = rows;
 context.searchParameterString = searchParameterString;

Modified: ofbiz/branches/release14.12/applications/product/widget/facility/FacilityForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release14.12/applications/product/widget/facility/FacilityForms.xml?rev=1748954&r1=1748953&r2=1748954&view=diff
==============================================================================
--- ofbiz/branches/release14.12/applications/product/widget/facility/FacilityForms.xml (original)
+++ ofbiz/branches/release14.12/applications/product/widget/facility/FacilityForms.xml Sat Jun 18 10:31:17 2016
@@ -433,7 +433,7 @@ under the License.
         <field name="productsSoldThruTimestamp" title="${uiLabelMap.ProductShowProductsSoldThruTimestamp}">
             <date-time default-value="${groovy: org.ofbiz.base.util.UtilDateTime.nowTimestamp()}"/>
         </field>
-        <field name="VIEW_SIZE" entry-name="viewSize" title="${uiLabelMap.ProductShowProductsPerPage}"><text/></field>
+        <field name="VIEW_SIZE_1" entry-name="viewSize" title="${uiLabelMap.ProductShowProductsPerPage}"><text/></field>
         <field name="monthsInPastLimit" entry-name="monthsInPastLimit"><text/></field>
         <field name="fromDateSellThrough" title="${uiLabelMap.ProductFromDateSellThrough}"><date-time/></field>
         <field name="thruDateSellThrough" title="${uiLabelMap.ProductThruDateSellThrough}"><date-time/></field>

Modified: ofbiz/branches/release14.12/applications/product/widget/facility/FacilityScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release14.12/applications/product/widget/facility/FacilityScreens.xml?rev=1748954&r1=1748953&r2=1748954&view=diff
==============================================================================
--- ofbiz/branches/release14.12/applications/product/widget/facility/FacilityScreens.xml (original)
+++ ofbiz/branches/release14.12/applications/product/widget/facility/FacilityScreens.xml Sat Jun 18 10:31:17 2016
@@ -433,7 +433,8 @@ under the License.
         <section>
             <actions>
                 <set field="tabButtonItem" value="ViewFacilityInventoryByProduct"/>
-                <set field="viewSize" from-field="parameters.VIEW_SIZE"/>
+                <set field="viewSize" from-field="parameters.VIEW_SIZE_1" type="Integer" default-value="20"/>
+                <set field="viewIndex" from-field="parameters.VIEW_INDEX_1" type="Integer" default-value="0"/>
                 <!-- This is the target of the search form-->
                 <set field="facilityInventoryByProductScreen" value="ViewFacilityInventoryByProduct"/>
                 <set field="facilityId" from-field="parameters.facilityId"/>