You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by mr...@apache.org on 2016/06/18 10:37:55 UTC
svn commit: r1748955 - in /ofbiz/branches/release13.07/applications/product:
webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.groovy
widget/facility/FacilityForms.xml widget/facility/FacilityScreens.xml
Author: mridulpathak
Date: Sat Jun 18 10:37:55 2016
New Revision: 1748955
URL: http://svn.apache.org/viewvc?rev=1748955&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/release13.07/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.groovy
ofbiz/branches/release13.07/applications/product/widget/facility/FacilityForms.xml
ofbiz/branches/release13.07/applications/product/widget/facility/FacilityScreens.xml
Modified: ofbiz/branches/release13.07/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.groovy
URL: http://svn.apache.org/viewvc/ofbiz/branches/release13.07/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.groovy?rev=1748955&r1=1748954&r2=1748955&view=diff
==============================================================================
--- ofbiz/branches/release13.07/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.groovy (original)
+++ ofbiz/branches/release13.07/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.groovy Sat Jun 18 10:37:55 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) {
// ------------------------------
@@ -125,11 +126,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 = delegator.findListIteratorByCondition(prodView, whereCondition, null, null, ['productId'], findOpts);
- 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/release13.07/applications/product/widget/facility/FacilityForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release13.07/applications/product/widget/facility/FacilityForms.xml?rev=1748955&r1=1748954&r2=1748955&view=diff
==============================================================================
--- ofbiz/branches/release13.07/applications/product/widget/facility/FacilityForms.xml (original)
+++ ofbiz/branches/release13.07/applications/product/widget/facility/FacilityForms.xml Sat Jun 18 10:37:55 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/release13.07/applications/product/widget/facility/FacilityScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/branches/release13.07/applications/product/widget/facility/FacilityScreens.xml?rev=1748955&r1=1748954&r2=1748955&view=diff
==============================================================================
--- ofbiz/branches/release13.07/applications/product/widget/facility/FacilityScreens.xml (original)
+++ ofbiz/branches/release13.07/applications/product/widget/facility/FacilityScreens.xml Sat Jun 18 10:37:55 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"/>