You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by si...@apache.org on 2006/09/08 19:52:30 UTC
svn commit: r441594 - in /incubator/ofbiz/trunk/applications/product:
config/ webapp/facility/WEB-INF/actions/facility/ webapp/facility/facility/
widget/facility/
Author: sichen
Date: Fri Sep 8 10:52:29 2006
New Revision: 441594
URL: http://svn.apache.org/viewvc?view=rev&rev=441594
Log:
Enhanced view facility inventory by product to search by internalName and ATP - min stock quantities.
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?view=diff&rev=441594&r1=441593&r2=441594
==============================================================================
--- incubator/ofbiz/trunk/applications/product/config/ProductUiLabels.properties (original)
+++ incubator/ofbiz/trunk/applications/product/config/ProductUiLabels.properties Fri Sep 8 10:52:29 2006
@@ -994,8 +994,10 @@
ProductQoh=QOH
ProductQtyReceived=Qty Received
ProductQtyRejected=Qty Rejected
-ProductQtyOffset=QOH minus Min Stock
-ProductQtyOffsetBelow=QOH minus Min Stock <=
+ProductQtyOffsetATP=ATP minus Min Stock
+ProductQtyOffsetQOH=QOH minus Min Stock
+ProductQtyOffsetATPBelow=ATP minus Min Stock <=
+ProductQtyOffsetQOHBelow=QOH minus Min Stock <=
ProductQuantity=Quantity
ProductQuantityAccepted=Quantity Accepted
ProductQuantityIncluded=Quantity Included
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?view=diff&rev=441594&r1=441593&r2=441594
==============================================================================
--- 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 Fri Sep 8 10:52:29 2006
@@ -34,7 +34,11 @@
String searchParameterString = "";
searchParameterString = "action=Y&facilityId=" + facilityId;
-qty = -1;
+
+offsetQOH = -1;
+offsetATP = -1;
+boolean hasOffsetQOH = false;
+boolean hasOffsetATP = false;
List rows = new ArrayList();
@@ -43,12 +47,18 @@
DynamicViewEntity prodView = new DynamicViewEntity();
Map conditionMap = UtilMisc.toMap("facilityId", facilityId);
- if (offsetQty != null && offsetQty.length() > 0) {
+ if (offsetQOHQty != null && offsetQOHQty.length() > 0) {
+ try {
+ offsetQOH = Integer.parseInt(offsetQOHQty);
+ hasOffsetQOH = true;
+ } catch(NumberFormatException nfe) {
+ }
+ }
+ if (offsetATPQty != null && offsetATPQty.length() > 0) {
try {
- qty = Integer.parseInt(offsetQty);
- searchParameterString = searchParameterString + "&offsetQty=" + offsetQty;
+ offsetATP = Integer.parseInt(offsetATPQty);
+ hasOffsetATP = true;
} catch(NumberFormatException nfe) {
- qty = -1;
}
}
@@ -57,6 +67,7 @@
prodView.addMemberEntity("PROD", "Product");
prodView.addViewLink("PROD", "PRFA", Boolean.FALSE, ModelKeyMap.makeKeyMapList("productId"));
+ prodView.addAlias("PROD", "internalName");
prodView.addAlias("PROD", "isVirtual");
prodView.addAlias("PROD", "salesDiscontinuationDate");
if (productTypeId != null && productTypeId.length() > 0) {
@@ -96,6 +107,11 @@
EntityOperator.OR);
whereConditionsList.add(discontinuationDateCondition);
}
+
+ // add search on internal name
+ if (UtilValidate.isNotEmpty(internalName)) {
+ whereConditionsList.add(new EntityExpr("internalName", true, EntityOperator.LIKE, "%" + internalName + "%", true));
+ }
EntityCondition whereCondition = new EntityConditionList(whereConditionsList, EntityOperator.AND);
@@ -133,17 +149,26 @@
} else {
resultOutput = dispatcher.runSync("getInventoryAvailableByFacility", contextInput);
}
- // qty
+
+ // filter for quantities
minimumStockInt = 0;
if (oneProd.get("minimumStock") != null) {
minimumStockInt = (oneProd.getDouble("minimumStock")).intValue();
}
+
quantityOnHandTotalInt = 0;
if (resultOutput.get("quantityOnHandTotal") != null) {
quantityOnHandTotalInt = ((Double)resultOutput.get("quantityOnHandTotal")).intValue();
}
- offsetQtyAvailable = quantityOnHandTotalInt - minimumStockInt;
- if (qty >= 0 && offsetQtyAvailable > qty) continue;
+ offsetQOHQtyAvailable = quantityOnHandTotalInt - minimumStockInt;
+ if (hasOffsetQOH && offsetQOHQtyAvailable > offsetQOH) continue;
+
+ availableToPromiseTotalInt = 0;
+ if (resultOutput.get("availableToPromiseTotal") != null) {
+ availableToPromiseTotalInt = ((Double)resultOutput.get("availableToPromiseTotal")).intValue();
+ }
+ offsetATPQtyAvailable = availableToPromiseTotalInt - minimumStockInt;
+ if (hasOffsetATP && offsetATPQtyAvailable > offsetATP) continue;
oneInventory = new HashMap();
oneInventory.put("productId", oneProd.getString("productId"));
@@ -152,7 +177,8 @@
oneInventory.put("daysToShip", oneProd.getString("daysToShip"));
oneInventory.put("totalQuantityOnHand", resultOutput.get("quantityOnHandTotal"));
oneInventory.put("totalAvailableToPromise", resultOutput.get("availableToPromiseTotal"));
- oneInventory.put("offsetQtyAvailable", offsetQtyAvailable);
+ oneInventory.put("offsetQOHQtyAvailable", offsetQOHQtyAvailable);
+ oneInventory.put("offsetATPQtyAvailable", offsetATPQtyAvailable);
rows.add(oneInventory);
}
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?view=diff&rev=441594&r1=441593&r2=441594
==============================================================================
--- incubator/ofbiz/trunk/applications/product/webapp/facility/facility/FacilityForms.xml (original)
+++ incubator/ofbiz/trunk/applications/product/webapp/facility/facility/FacilityForms.xml Fri Sep 8 10:52:29 2006
@@ -23,6 +23,9 @@
default-title-style="tableheadtext" default-widget-style="tabletext" default-tooltip-style="tabletext">
<field name="facilityId"><hidden/></field>
<field name="action"><hidden value="SEARCH"/></field>
+ <field name="internalName" title="${uiLabelMap.ProductInternalName}" widget-style="inputBox">
+ <text/>
+ </field>
<field name="productTypeId" title="${uiLabelMap.ProductProductType}" widget-style="selectBox">
<drop-down allow-empty="true">
<entity-options entity-name="ProductType" description="${description}"> <!-- [${productTypeId}] -->
@@ -48,11 +51,12 @@
</entity-options>
</drop-down>
</field>
- <field name="offsetQty" title="${uiLabelMap.ProductQtyOffsetBelow}"><text/></field>
- <field name="productsSoldThruTimestamp" title="${uiLabelMap.ProductShowProductsSoldThruTimestamp}">
+ <field name="offsetQOHQty" title="${uiLabelMap.ProductQtyOffsetQOHBelow}" widget-style="inputBox"><text/></field>
+ <field name="offsetATPQty" title="${uiLabelMap.ProductQtyOffsetATPBelow}" widget-style="inputBox"><text/></field>
+ <field name="productsSoldThruTimestamp" title="${uiLabelMap.ProductShowProductsSoldThruTimestamp}" widget-style="inputBox">
<date-time/>
</field>
- <field name="VIEW_SIZE" title="${uiLabelMap.ProductShowProductsPerPage}"><text default-value="50"/></field>
+ <field name="VIEW_SIZE" title="${uiLabelMap.ProductShowProductsPerPage}" widget-style="inputBox"><text default-value="50"/></field>
<field name="submitButton" title="${uiLabelMap.CommonFind}" widget-style="smallSubmit">
<submit button-type="button"/>
</field>
@@ -71,7 +75,8 @@
<field name="daysToShip" title="${uiLabelMap.ProductDaysToShip}" widget-area-style="tabletextright"><display/></field>
<field name="totalAvailableToPromise" title="${uiLabelMap.CommonTotal} ${uiLabelMap.ProductAtp}" widget-area-style="tabletextright"><display/></field>
<field name="totalQuantityOnHand" title="${uiLabelMap.CommonTotal} ${uiLabelMap.ProductQoh}" widget-area-style="tabletextright"><display/></field>
- <field name="offsetQtyAvailable" title="${uiLabelMap.ProductQtyOffset}" widget-area-style="tabletextright"><display/></field>
+ <field name="offsetQOHQtyAvailable" title="${uiLabelMap.ProductQtyOffsetQOH}" widget-area-style="tabletextright"><display/></field>
+ <field name="offsetATPQtyAvailable" title="${uiLabelMap.ProductQtyOffsetATP}" widget-area-style="tabletextright"><display/></field>
</form>
<form name="SearchInventoryItemsParams" type="single" target="SearchInventoryItems"
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?view=diff&rev=441594&r1=441593&r2=441594
==============================================================================
--- incubator/ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml (original)
+++ incubator/ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml Fri Sep 8 10:52:29 2006
@@ -211,8 +211,10 @@
<set field="productTypeId" from-field="parameters.productTypeId"/>
<set field="searchInProductCategoryId" from-field="parameters.searchInProductCategoryId"/>
<set field="productSupplierId" from-field="parameters.productSupplierId"/>
- <set field="offsetQty" from-field="parameters.offsetQty"/>
+ <set field="offsetQOHQty" from-field="parameters.offsetQOHQty"/>
+ <set field="offsetATPQty" from-field="parameters.offsetATPQty"/>
<set field="productsSoldThruTimestamp" from-field="parameters.productsSoldThruTimestamp"/>
+ <set field="internalName" from-field="parameters.internalName"/>
<script location="component://product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.bsh"/>
</actions>