Author: sichen
Date: Mon Jun 11 09:38:09 2007
New Revision: 546188
URL:
http://svn.apache.org/viewvc?view=rev&rev=546188Log:
getRequirementsForSupplier will now get any requirements instead of just Approved ones
Modified:
ofbiz/trunk/applications/order/servicedef/services_requirement.xml
ofbiz/trunk/applications/order/src/org/ofbiz/order/requirement/RequirementServices.java
Modified: ofbiz/trunk/applications/order/servicedef/services_requirement.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services_requirement.xml?view=diff&rev=546188&r1=546187&r2=546188==============================================================================
--- ofbiz/trunk/applications/order/servicedef/services_requirement.xml (original)
+++ ofbiz/trunk/applications/order/servicedef/services_requirement.xml Mon Jun 11 09:38:09 2007
@@ -99,6 +99,9 @@
<attribute mode="IN" name="partyId" type="String" optional="true"/>
<attribute mode="IN" name="unassignedRequirements" type="String" optional="true"/>
<attribute mode="IN" name="currencyUomId" type="String" optional="true"/>
+ <attribute mode="IN" name="statusIds" type="List" optional="true">
+ <description>By default, this service looks for approved requirements. To override this, pass in a list of requirement statusIds to search.</description>
+ </attribute>
<attribute mode="OUT" name="requirementsForSupplier" type="java.util.List" optional="true"/>
<attribute mode="OUT" name="distinctProductCount" type="Integer" optional="true"/>
<attribute mode="OUT" name="quantityTotal" type="Double" optional="true"/>
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/requirement/RequirementServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/requirement/RequirementServices.java?view=diff&rev=546188&r1=546187&r2=546188==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/requirement/RequirementServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/requirement/RequirementServices.java Mon Jun 11 09:38:09 2007
@@ -53,13 +53,18 @@
String partyId = (String) context.get("partyId");
String unassignedRequirements = (String) context.get("unassignedRequirements");
String currencyUomId = (String) context.get("currencyUomId");
+ List statusIds = (List) context.get("statusIds");
try {
List orderBy = UtilMisc.toList("partyId", "requirementId");
List conditions = UtilMisc.toList(
new EntityExpr("requirementTypeId", EntityOperator.EQUALS, "PRODUCT_REQUIREMENT"),
- new EntityExpr("statusId", EntityOperator.EQUALS, "REQ_APPROVED"),
EntityUtil.getFilterByDateExpr()
);
+ if (statusIds != null && statusIds.size() > 0) {
+ conditions.add( new EntityExpr("statusId", EntityOperator.IN, statusIds) );
+ } else {
+ conditions.add( new EntityExpr("statusId", EntityOperator.EQUALS, "REQ_APPROVED") );
+ }
if (requirementConditions != null) conditions.add(requirementConditions);
// we're either getting the requirements for a given supplier, unassigned requirements, or requirements for all suppliers