Author: sichen
Date: Wed May 16 14:24:10 2007
New Revision: 538744
URL:
http://svn.apache.org/viewvc?view=rev&rev=538744Log:
Fix a potential problem with null productfacility records when creating requirements
Modified:
ofbiz/branches/release4.0/applications/order/script/org/ofbiz/order/order/OrderServices.xml
Modified: ofbiz/branches/release4.0/applications/order/script/org/ofbiz/order/order/OrderServices.xml
URL:
http://svn.apache.org/viewvc/ofbiz/branches/release4.0/applications/order/script/org/ofbiz/order/order/OrderServices.xml?view=diff&rev=538744&r1=538743&r2=538744==============================================================================
--- ofbiz/branches/release4.0/applications/order/script/org/ofbiz/order/order/OrderServices.xml (original)
+++ ofbiz/branches/release4.0/applications/order/script/org/ofbiz/order/order/OrderServices.xml Wed May 16 14:24:10 2007
@@ -315,7 +315,8 @@
<if-compare field-name="requirementMethodId" operator="equals" value="PRODRQM_ATP">
<!-- get the ATP, QOH quantities and the product facility's minimum stock -->
<call-simple-method method-name="getProductFacilityAndQuantities"/>
-
+
+ <if-not-empty field-name="productFacility">
<!-- are we below minimum stock? this service is supposed to be called after inventory is reserved, so inventory should have been updated already -->
<if-compare-field field-name="availableToPromiseTotal" to-field-name="productFacility.minimumStock" operator="less" type="Double">
<!-- what is the right quantity? It is the lesser of the actual quantity and the quantity required to bring us back up to minimum stock -->
@@ -338,6 +339,7 @@
<set from-field="inventoryItem.facilityId" field="inputMap.facilityId"/>
<call-simple-method method-name="createRequirementAndCommitment"/>
</if-compare-field>
+ </if-not-empty>
</if-compare>
</simple-method>