You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by bi...@apache.org on 2008/05/24 11:40:02 UTC
svn commit: r659781 -
/ofbiz/trunk/applications/product/script/org/ofbiz/product/store/ProductStoreServices.xml
Author: bibryam
Date: Sat May 24 02:40:01 2008
New Revision: 659781
URL: http://svn.apache.org/viewvc?rev=659781&view=rev
Log:
When reserving inventory items for a store with multiple facilities, if the are not enough quantities in any facility, use the first facility from the product store facility list to reserve the inventory.
Modified:
ofbiz/trunk/applications/product/script/org/ofbiz/product/store/ProductStoreServices.xml
Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/store/ProductStoreServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/store/ProductStoreServices.xml?rev=659781&r1=659780&r2=659781&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/script/org/ofbiz/product/store/ProductStoreServices.xml (original)
+++ ofbiz/trunk/applications/product/script/org/ofbiz/product/store/ProductStoreServices.xml Sat May 24 02:40:01 2008
@@ -439,7 +439,7 @@
<iterate list-name="productStoreFacilities" entry-name="productStoreFacility">
<!-- in this case quantityNotReserved will always be empty until it finds a facility it can totally reserve from, then it will be 0.0 and we are done -->
- <if-empty field-name="quantityNotReserved">
+ <if-empty field-name="storeFound">
<!-- TODO: must entire quantity be available in one location? -->
<!-- Right now the answer is yes, it only succeeds if one facility has sufficient inventory for the order. -->
<set from-field="parameters.productId" field="callServiceMap.productId"/>
@@ -448,25 +448,25 @@
<result-to-field result-name="availableToPromiseTotal"/>
</call-service>
<clear-field field-name="callServiceMap"/>
-
- <if-compare-field field-name="availableToPromiseTotal" operator="greater-equals" to-field-name="parameters.quantity" type="Double">
- <set-service-fields map-name="parameters" to-map-name="callServiceMap" service-name="reserveProductInventoryByFacility"/>
- <set from-field="productStoreFacility.facilityId" field="callServiceMap.facilityId"/>
- <set from-field="requireInventory" field="callServiceMap.requireInventory"/>
- <set from-field="productStore.reserveOrderEnumId" field="callServiceMap.reserveOrderEnumId"/>
- <call-service service-name="reserveProductInventoryByFacility" in-map-name="callServiceMap">
- <result-to-field result-name="quantityNotReserved"/>
- </call-service>
- <log level="info" message="Inventory IS reserved in facility with id [${productStoreFacility.facilityId}] for product id [${parameters.productId}]; desired quantity was ${parameters.quantity}"/>
+ <if-compare-field field-name="availableToPromiseTotal" operator="greater-equals" to-field-name="parameters.quantity" type="Double">
+ <set field="storeFound" from-field="productStoreFacility"/>
</if-compare-field>
<clear-field field-name="availableToPromiseTotal"/>
- </if-empty>
+ </if-empty>
</iterate>
- <!-- didn't find anything? couldn't reserve the quantity so return the whole thing... -->
- <if-empty field-name="quantityNotReserved">
- <set from-field="parameters.quantity" field="quantityNotReserved"/>
+ <!-- didn't find anything? Take the first facility from list -->
+ <if-empty field-name="storeFound">
+ <first-from-list list-name="productStoreFacilities" entry-name="storeFound"/>
</if-empty>
+ <set-service-fields map-name="parameters" to-map-name="callServiceMap" service-name="reserveProductInventoryByFacility"/>
+ <set from-field="storeFound.facilityId" field="callServiceMap.facilityId"/>
+ <set from-field="requireInventory" field="callServiceMap.requireInventory"/>
+ <set from-field="productStore.reserveOrderEnumId" field="callServiceMap.reserveOrderEnumId"/>
+ <call-service service-name="reserveProductInventoryByFacility" in-map-name="callServiceMap">
+ <result-to-field result-name="quantityNotReserved"/>
+ </call-service>
+ <log level="info" message="Inventory IS reserved in facility with id [${storeFound.facilityId}] for product id [${parameters.productId}]; desired quantity was ${parameters.quantity}"/>
</else>
</if-compare>