svn commit: r564711 - /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: r564711 - /ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml

jonesde
Author: jonesde
Date: Fri Aug 10 11:29:18 2007
New Revision: 564711

URL: http://svn.apache.org/viewvc?view=rev&rev=564711
Log:
A few little improvements in balance inventory, biggest one being the reserve within a facility when re-reserving which it frighteningly wasn't doing before

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?view=diff&rev=564711&r1=564710&r2=564711
==============================================================================
--- ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml (original)
+++ ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml Fri Aug 10 11:29:18 2007
@@ -333,7 +333,7 @@
                     <then>
                         <set field="inventoryItem.availableToPromiseTotal" value="0" type="Double"/>
                         <set field="inventoryItem.quantityOnHandTotal" value="1" type="Double"/>
-                        <log level="always" message="Storing totals [${inventoryItem.inventoryItemId}] for other status [1/0]"/>
+                        <log level="always" message="Storing totals [${inventoryItem.inventoryItemId}] for other status [0/1]"/>
                         <store-value value-name="inventoryItem"/>
                     </then>
                 </else-if>
@@ -654,9 +654,7 @@
     </simple-method>
 
     <simple-method method-name="balanceInventoryItems" short-description="Balances available-to-promise on inventory items">
-        <make-value entity-name="InventoryItem" value-name="lookupPKMap"/>
-        <set-pk-fields value-name="lookupPKMap" map-name="parameters"/>
-        <find-by-primary-key entity-name="InventoryItem" map-name="lookupPKMap" value-name="inventoryItem"/>
+        <entity-one entity-name="InventoryItem" value-name="inventoryItem"/>
 
         <!-- find all items which have a negative ATP -->
         <entity-condition entity-name="InventoryItem" list-name="inventoryItems">
@@ -707,7 +705,7 @@
                              orders appearing on duplicate pick lists -->
 
                     <if-empty field-name="picklistItemList">
-                        <log level="always" message="Order #${oneRelatedRes.orderId} was not found on any picklist for this item [${oneRelatedRes.inventoryItemId}]"/>                                                                  
+                        <log level="info" message="Order [${oneRelatedRes.orderId}] was not found on any picklist for InventoryItem [${oneRelatedRes.inventoryItemId}]"/>                                                                  
                         <if>
                             <condition>
                                 <and>
@@ -764,7 +762,16 @@
             <set field="resMap.requireInventory" value="N"/>
             <set from-field="oisgir.shipGroupSeqId" field="resMap.shipGroupSeqId"/>
             <set from-field="oisgir.sequenceId" field="resMap.sequenceId"/>
-            <call-service service-name="reserveProductInventory" in-map-name="resMap"/>
+            <log level="info" message="Re-reserving product [${resMap.productId}] for order item [${resMap.orderId}:${resMap.orderItemSeqId}] quantity [${resMap.quantity}]; facility [${inventoryItem.facilityId}]"/>
+            <if-empty field-name="inventoryItem.facilityId">
+                <log level="warning" message="In balanceInventoryItems there is no facilityId, so reserving from any facility for order item [${resMap.orderId}:${resMap.orderItemSeqId}]"></log>
+                <call-service service-name="reserveProductInventory" in-map-name="resMap"/>
+                
+                <else>
+                    <set from-field="inventoryItem.facilityId" field="resMap.facilityId"/>
+                    <call-service service-name="reserveProductInventoryByFacility" in-map-name="resMap"/>
+                </else>
+            </if-empty>
             <clear-field field-name="resMap"/>
         </iterate>
     </simple-method>