Author: sichen
Date: Tue Aug 29 17:36:57 2006 New Revision: 438312 URL: http://svn.apache.org/viewvc?rev=438312&view=rev Log: Improved the product inventory by facility report in facility manager with a flag to control discontinuation date of products which should not be shown, and also to set the number of products per page Modified: incubator/ofbiz/trunk/applications/product/config/ProductUiLabels.properties incubator/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.bsh incubator/ofbiz/trunk/applications/product/webapp/facility/facility/FacilityForms.xml incubator/ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml Modified: incubator/ofbiz/trunk/applications/product/config/ProductUiLabels.properties URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/product/config/ProductUiLabels.properties?rev=438312&r1=438311&r2=438312&view=diff ============================================================================== --- incubator/ofbiz/trunk/applications/product/config/ProductUiLabels.properties (original) +++ incubator/ofbiz/trunk/applications/product/config/ProductUiLabels.properties Tue Aug 29 17:36:57 2006 @@ -996,7 +996,7 @@ ProductQtyReceived=Qty Received ProductQtyRejected=Qty Rejected ProductQtyOffset=QOH minus Min Stock -ProductQtyOffsetBelow=QOH minus Min Stock Below Quantity of +ProductQtyOffsetBelow=QOH minus Min Stock <= ProductQuantity=Quantity ProductQuantityAccepted=Quantity Accepted ProductQuantityIncluded=Quantity Included @@ -1150,6 +1150,8 @@ ProductShortDescription=Short Description ProductShowActive=Show Active ProductShowAll=Show All +ProductShowProductsSoldThruTimestamp=Show Products Sold Thru +ProductShowProductsPerPage=Show Products Per Page ProductShowEmptyItems=Show Empty Items ProductShowProductFacilities=showProductFacilities ProductShowAllFacilities=showAllFacilities Modified: incubator/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.bsh URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.bsh?rev=438312&r1=438311&r2=438312&view=diff ============================================================================== --- incubator/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.bsh (original) +++ incubator/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.bsh Tue Aug 29 17:36:57 2006 @@ -58,6 +58,7 @@ prodView.addMemberEntity("PROD", "Product"); prodView.addViewLink("PROD", "PRFA", Boolean.FALSE, ModelKeyMap.makeKeyMapList("productId")); prodView.addAlias("PROD", "isVirtual"); + prodView.addAlias("PROD", "salesDiscontinuationDate"); if (productTypeId != null && productTypeId.length() > 0) { prodView.addAlias("PROD", "productTypeId"); conditionMap.put("productTypeId", productTypeId); @@ -78,14 +79,25 @@ conditionMap.put("partyId", productSupplierId); searchParameterString = searchParameterString + "&productSupplierId=" + productSupplierId; } - + // set distinct on so we only get one row per product EntityFindOptions findOpts = new EntityFindOptions(true, EntityFindOptions.TYPE_SCROLL_INSENSITIVE, EntityFindOptions.CONCUR_READ_ONLY, true); EntityCondition searchCondition = new EntityFieldMap(conditionMap, EntityOperator.AND); EntityCondition notVirtualCondition = new EntityExpr(new EntityExpr("isVirtual", EntityOperator.EQUALS, null), EntityOperator.OR, new EntityExpr("isVirtual", EntityOperator.NOT_EQUAL, "Y")); - EntityCondition whereCondition = new EntityConditionList(UtilMisc.toList(searchCondition, notVirtualCondition), EntityOperator.AND); + + whereConditionsList = UtilMisc.toList(searchCondition, notVirtualCondition); + // add the discontinuation date condition + if (UtilValidate.isNotEmpty(productsSoldThruTimestamp)) { + EntityCondition discontinuationDateCondition = new EntityConditionList(UtilMisc.toList( + new EntityExpr("salesDiscontinuationDate", EntityOperator.EQUALS, null), + new EntityExpr("salesDiscontinuationDate", EntityOperator.GREATER_THAN, productsSoldThruTimestamp)), + EntityOperator.OR); + whereConditionsList.add(discontinuationDateCondition); + } + + EntityCondition whereCondition = new EntityConditionList(whereConditionsList, EntityOperator.AND); boolean beganTransaction = false; List prods = null; Modified: incubator/ofbiz/trunk/applications/product/webapp/facility/facility/FacilityForms.xml URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/product/webapp/facility/facility/FacilityForms.xml?rev=438312&r1=438311&r2=438312&view=diff ============================================================================== --- incubator/ofbiz/trunk/applications/product/webapp/facility/facility/FacilityForms.xml (original) +++ incubator/ofbiz/trunk/applications/product/webapp/facility/facility/FacilityForms.xml Tue Aug 29 17:36:57 2006 @@ -49,6 +49,10 @@ </drop-down> </field> <field name="offsetQty" title="${uiLabelMap.ProductQtyOffsetBelow}"><text/></field> + <field name="productsSoldThruTimestamp" title="${uiLabelMap.ProductShowProductsSoldThruTimestamp}"> + <date-time/> + </field> + <field name="VIEW_SIZE" title="${uiLabelMap.ProductShowProductsPerPage}"><text default-value="50"/></field> <field name="submitButton" title="${uiLabelMap.CommonFind}" widget-style="smallSubmit"> <submit button-type="button"/> </field> Modified: incubator/ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml URL: http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml?rev=438312&r1=438311&r2=438312&view=diff ============================================================================== --- incubator/ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml (original) +++ incubator/ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml Tue Aug 29 17:36:57 2006 @@ -201,7 +201,7 @@ <set field="titleProperty" value="PageTitleEditFacilityInventoryItems"/> <set field="headerItem" value="facility"/> <set field="tabButtonItem" value="EditFacilityInventoryItems"/> - <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer"/> + <set field="viewIndex" from-field="parameters.VIEW_INDEX" type="Integer" default-value="0"/> <set field="viewSize" from-field="parameters.VIEW_SIZE" type="Integer" default-value="50"/> <!-- This is the target of the search form--> @@ -212,7 +212,8 @@ <set field="searchInProductCategoryId" from-field="parameters.searchInProductCategoryId"/> <set field="productSupplierId" from-field="parameters.productSupplierId"/> <set field="offsetQty" from-field="parameters.offsetQty"/> - + <set field="productsSoldThruTimestamp" from-field="parameters.productsSoldThruTimestamp"/> + <script location="component://product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.bsh"/> </actions> <widgets> |
Free forum by Nabble | Edit this page |