[OFBiz] SVN: r6035 - in trunk/applications/product:
webapp/facility/WEB-INF/actions/facility
webapp/facility/facility widget/facility
jacopo at svn.ofbiz.org
jacopo at svn.ofbiz.org
Sat Oct 29 08:55:06 EDT 2005
Author: jacopo
Date: 2005-10-29 07:54:53 -0500 (Sat, 29 Oct 2005)
New Revision: 6035
Modified:
trunk/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.bsh
trunk/applications/product/webapp/facility/facility/FacilityForms.xml
trunk/applications/product/widget/facility/FacilityScreens.xml
Log:
Applied patch that adds a drop down to list inventory levels by supplier.
Thanks to Ray Barlow for this (OFBIZ-557).
Modified: trunk/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.bsh
===================================================================
--- trunk/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.bsh 2005-10-29 10:07:47 UTC (rev 6034)
+++ trunk/applications/product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.bsh 2005-10-29 12:54:53 UTC (rev 6035)
@@ -32,6 +32,7 @@
import org.ofbiz.entity.transaction.*;
import org.ofbiz.entity.model.DynamicViewEntity;
import org.ofbiz.entity.model.ModelKeyMap;
+import org.ofbiz.entity.util.EntityFindOptions;
import org.ofbiz.widget.html.*;
@@ -72,6 +73,15 @@
conditionMap.put("productCategoryId", productCategoryId);
}
+ if (productSupplierId != null && productSupplierId.length() > 0) {
+ prodView.addMemberEntity("SPPR", "SupplierProduct");
+ prodView.addViewLink("PRFA", "SPPR", Boolean.FALSE, ModelKeyMap.makeKeyMapList("productId"));
+ prodView.addAlias("SPPR", "partyId");
+ conditionMap.put("partyId", 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,
@@ -82,7 +92,7 @@
List prods = null;
try {
beganTransaction = TransactionUtil.begin();
- prodsEli = delegator.findListIteratorByCondition(prodView, whereCondition, null, null, UtilMisc.toList("productId"), null);
+ prodsEli = delegator.findListIteratorByCondition(prodView, whereCondition, null, null, UtilMisc.toList("productId"), findOpts);
prods = prodsEli.getCompleteList();
prodsEli.close();
} catch (GenericEntityException e) {
Modified: trunk/applications/product/webapp/facility/facility/FacilityForms.xml
===================================================================
--- trunk/applications/product/webapp/facility/facility/FacilityForms.xml 2005-10-29 10:07:47 UTC (rev 6034)
+++ trunk/applications/product/webapp/facility/facility/FacilityForms.xml 2005-10-29 12:54:53 UTC (rev 6035)
@@ -43,6 +43,14 @@
</entity-options>
</drop-down>
</field>
+ <field name="productSupplierId" title="${uiLabelMap.ProductSupplier}" widget-style="selectBox">
+ <drop-down allow-empty="true">
+ <entity-options entity-name="PartyRoleAndPartyDetail" key-field-name="partyId" description="${groupName} [${partyId}]">
+ <entity-constraint name="roleTypeId" value="SUPPLIER" operator="equals"/>
+ <entity-order-by field-name="partyId"/>
+ </entity-options>
+ </drop-down>
+ </field>
<field name="offsetQty" title="${uiLabelMap.ProductQtyOffset}"><text/></field>
<field name="submitButton" title="${uiLabelMap.CommonFind}" widget-style="smallSubmit">
<submit button-type="button"/>
Modified: trunk/applications/product/widget/facility/FacilityScreens.xml
===================================================================
--- trunk/applications/product/widget/facility/FacilityScreens.xml 2005-10-29 10:07:47 UTC (rev 6034)
+++ trunk/applications/product/widget/facility/FacilityScreens.xml 2005-10-29 12:54:53 UTC (rev 6035)
@@ -185,6 +185,7 @@
<set field="facilityId" from-field="parameters.facilityId"/>
<set field="productTypeId" from-field="parameters.productTypeId"/>
<set field="productCategoryId" from-field="parameters.productCategoryId"/>
+ <set field="productSupplierId" from-field="parameters.productSupplierId"/>
<set field="offsetQty" from-field="parameters.offsetQty"/>
<script location="component://product/webapp/facility/WEB-INF/actions/facility/ViewFacilityInventoryByProduct.bsh"/>
More information about the Svn
mailing list