svn commit: r576793 - /ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r576793 - /ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml

jonesde
Author: jonesde
Date: Tue Sep 18 02:20:24 2007
New Revision: 576793

URL: http://svn.apache.org/viewvc?rev=576793&view=rev
Log:
Fixed issue where some orderIds added to this list were for non-backordered items; not sure if I like how this service works, but it cancels and re-reserves ALL reservations for the InventoryItem that has the negative ATP, no wonder it takes a while to run sometimes

Modified:
    ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml

Modified: ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml?rev=576793&r1=576792&r2=576793&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml (original)
+++ ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml Tue Sep 18 02:20:24 2007
@@ -728,7 +728,7 @@
         </iterate>
 
         <!-- sort the list by date -->
-        <string-to-list string="reservedDatetime" list-name="orderByList"/>
+        <set field="orderByList[]" value="reservedDatetime"/>
         <set field="orderByList[]" value="sequenceId"/>
         <order-value-list list-name="reservations" order-by-list-name="orderByList"/>
 
@@ -754,6 +754,14 @@
 
         <!-- THEN, re-reserve the cancelled items -->
         <iterate list-name="allReservations" entry-name="oisgir">
+            <!-- maintain a Set (in a Map) of orderIds that we have reallocated for, but only if they had some quantityNotReserved -->
+            <if-not-empty field-name="oisgir.quantityNotAvailable">
+                <if-compare field-name="oisgir.quantityNotAvailable" operator="greater" value="0" type="Double">
+                    <set field="touchedOrderIdMap.${oisgir.orderId}" value="Y"/>
+                    <log level="verbose" message="Adding ${oisgir.orderId} to touchedOrderIdMap"/>
+                </if-compare>
+            </if-not-empty>
+            
             <!-- require inventory is N because it had to be N to begin with to have a negative ATP -->
             <clear-field field-name="resMap"/>
             <set field="resMap.productId" from-field="inventoryItem.productId"/>
@@ -775,13 +783,10 @@
                     <call-service service-name="reserveProductInventoryByFacility" in-map-name="resMap"/>
                 </else>
             </if-empty>
-            
-            <!-- maintain a Set (in a Map) of orderIds that we have reallocated for -->
-            <set field="touchedOrderIdSet.${oisgir.orderId}" value="Y"/>
         </iterate>
         
-        <!-- now go through touchedOrderIdSet keys and make a Set/Map of orderIds that are no longer on back-order -->
-        <iterate-map key-name="touchedOrderId" value-name="throwAwayValue" map-name="touchedOrderIdSet">
+        <!-- now go through touchedOrderIdMap keys and make a Set/Map of orderIds that are no longer on back-order -->
+        <iterate-map key-name="touchedOrderId" value-name="throwAwayValue" map-name="touchedOrderIdMap">
             <set field="checkOrderIsOnBackOrderMap.orderId" from-field="touchedOrderId"/>
             <call-service service-name="checkOrderIsOnBackOrder" in-map-name="checkOrderIsOnBackOrderMap">
                 <result-to-field result-name="isBackOrder"/>