svn commit: r639505 - in /ofbiz/trunk/applications/product: script/org/ofbiz/product/inventory/InventoryServices.xml servicedef/services_facility.xml

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

svn commit: r639505 - in /ofbiz/trunk/applications/product: script/org/ofbiz/product/inventory/InventoryServices.xml servicedef/services_facility.xml

jacopoc
Author: jacopoc
Date: Thu Mar 20 17:40:14 2008
New Revision: 639505

URL: http://svn.apache.org/viewvc?rev=639505&view=rev
Log:
New service that, for each product with a negative reservation in the order, calls the reassignInventoryReservations service.
Based on a patch from Sumit Pandit.

Modified:
    ofbiz/trunk/applications/product/script/org/ofbiz/product/inventory/InventoryServices.xml
    ofbiz/trunk/applications/product/servicedef/services_facility.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=639505&r1=639504&r2=639505&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 Thu Mar 20 17:40:14 2008
@@ -942,6 +942,32 @@
         </if-not-empty>
     </simple-method>
 
+    <simple-method method-name="balanceOrderItemsWithNegativeReservations" short-description="To balance order items with negative reservations">
+        <entity-condition entity-name="OrderItemShipGrpInvResAndItem" list-name="oisgirais">
+            <condition-list combine="and">
+                <condition-expr field-name="orderId" operator="equals" env-name="parameters.orderId"/>
+                <condition-expr field-name="quantityNotAvailable" operator="greater" value="0"/>
+                <condition-expr field-name="quantityNotAvailable" operator="not-equals" value=""/>
+                <condition-expr field-name="quantityNotAvailable" operator="not-equals" env-name="nullField"/>
+            </condition-list>
+        </entity-condition>
+        <iterate list-name="oisgirais" entry-name="oisgir">
+            <set field="orderItems.${oisgir.orderItemSeqId}" from-field="oisgir"/>
+        </iterate>
+        <now-timestamp-to-env env-name="nowTimestamp"/>
+        <iterate-map key-name="orderItemSeqId" value-name="oisgir" map-name="orderItems">
+            <set field="reassignInventoryReservationsCtx.productId" from-field="oisgir.productId"/>
+            <set field="reassignInventoryReservationsCtx.facilityId" from-field="oisgir.facilityId"/>
+            <if-not-empty field-name="oisgir.shipBeforeDate">
+                <set field="reassignInventoryReservationsCtx.fromDate" from-field="oisgir.shipBeforeDate"/>
+            <else>
+                <set field="reassignInventoryReservationsCtx.fromDate" from-field="nowTimestamp"/>
+            </else>
+            </if-not-empty>
+            <call-service service-name="reassignInventoryReservations" in-map-name="reassignInventoryReservationsCtx"/>
+        </iterate-map>
+     </simple-method>
+
     <!-- Inventory Transfer Services -->
     <simple-method method-name="createInventoryTransfer" short-description="Create an Inventory Transfer">
 

Modified: ofbiz/trunk/applications/product/servicedef/services_facility.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/servicedef/services_facility.xml?rev=639505&r1=639504&r2=639505&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/servicedef/services_facility.xml (original)
+++ ofbiz/trunk/applications/product/servicedef/services_facility.xml Thu Mar 20 17:40:14 2008
@@ -250,6 +250,11 @@
         <attribute name="facilityId" type="String" mode="IN" optional="false"/>
         <attribute name="fromDate" type="String" mode="IN" optional="true"/>
     </service>
+    <service name="balanceOrderItemsWithNegativeReservations" engine="simple"
+                location="org/ofbiz/product/inventory/InventoryServices.xml" invoke="balanceOrderItemsWithNegativeReservations">
+        <description>For each product with a negative reservation in the order, calls reassignInventoryReservations</description>
+        <attribute name="orderId" type="String" mode="IN" optional="false"/>
+    </service>
 
     <service name="reserveAnInventoryItem" engine="simple"
             location="org/ofbiz/product/inventory/InventoryReserveServices.xml" invoke="reserveAnInventoryItem" auth="true">