Author: mridulpathak
Date: Sat Jun 18 10:18:13 2016 New Revision: 1748950 URL: http://svn.apache.org/viewvc?rev=1748950&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. Modified: ofbiz/trunk/applications/product/groovyScripts/facility/facility/ViewFacilityInventoryByProduct.groovy ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml Modified: ofbiz/trunk/applications/product/groovyScripts/facility/facility/ViewFacilityInventoryByProduct.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/groovyScripts/facility/facility/ViewFacilityInventoryByProduct.groovy?rev=1748950&r1=1748949&r2=1748950&view=diff ============================================================================== --- ofbiz/trunk/applications/product/groovyScripts/facility/facility/ViewFacilityInventoryByProduct.groovy (original) +++ ofbiz/trunk/applications/product/groovyScripts/facility/facility/ViewFacilityInventoryByProduct.groovy Sat Jun 18 10:18:13 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/trunk/applications/product/widget/facility/FacilityForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml?rev=1748950&r1=1748949&r2=1748950&view=diff ============================================================================== --- ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml (original) +++ ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml Sat Jun 18 10:18:13 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/trunk/applications/product/widget/facility/FacilityScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml?rev=1748950&r1=1748949&r2=1748950&view=diff ============================================================================== --- ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml (original) +++ ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml Sat Jun 18 10:18:13 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"/> @@ -1603,4 +1604,4 @@ under the License. </widgets> </section> </screen> -</screens> \ No newline at end of file +</screens> |
Free forum by Nabble | Edit this page |