svn commit: r564359 - in /ofbiz/trunk/applications/order: script/org/ofbiz/order/order/OrderServices.xml servicedef/services.xml

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

svn commit: r564359 - in /ofbiz/trunk/applications/order: script/org/ofbiz/order/order/OrderServices.xml servicedef/services.xml

apatel-2
Author: apatel
Date: Thu Aug  9 12:53:35 2007
New Revision: 564359

URL: http://svn.apache.org/viewvc?view=rev&rev=564359
Log:
Adding a service to check if orderItem is on BackOrder.

Modified:
    ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml
    ofbiz/trunk/applications/order/servicedef/services.xml

Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml?view=diff&rev=564359&r1=564358&r2=564359
==============================================================================
--- ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml (original)
+++ ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderServices.xml Thu Aug  9 12:53:35 2007
@@ -848,5 +848,27 @@
         </if-empty>
         <field-to-result field-name="statusId" map-name="order" result-name="statusId"/>
     </simple-method>
+    
+    <simple-method method-name="checkOrderIsOnBackOrder" short-description="Check if an Order is on Back Order" login-required="false">
+        <set field="orderItemShipGrpInvResLookup.orderId" from-field="parameters.orderId"/>
+        <set field="isBackOrder" value="false" type="Boolean"/>
+        <find-by-and entity-name="OrderItemShipGrpInvRes" map-name="orderItemShipGrpInvResLookup" list-name="orderItemShipGrpInvResList"/>
+        <iterate list-name="orderItemShipGrpInvResList" entry-name="orderItemShipGrpInvRes">
+            <set field="quantityNotAvailable" from-field="orderItemShipGrpInvRes.quantityNotAvailable"/>
+            <if>
+                <condition>
+                    <and>
+                        <not> <if-empty field-name="quantityNotAvailable"/> </not>
+                        <if-compare field-name="quantityNotAvailable" operator="greater" value="0" type="Double"/>
+                    </and>
+                </condition>
+                <then>
+                    <set field="isBackOrder" value="true" type="Boolean"/>
+                </then>
+            </if>
+        </iterate>
+        <field-to-result field-name="isBackOrder" result-name="isBackOrder"/>
+    </simple-method>
 </simple-methods>
+
 

Modified: ofbiz/trunk/applications/order/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services.xml?view=diff&rev=564359&r1=564358&r2=564359
==============================================================================
--- ofbiz/trunk/applications/order/servicedef/services.xml (original)
+++ ofbiz/trunk/applications/order/servicedef/services.xml Thu Aug  9 12:53:35 2007
@@ -806,4 +806,11 @@
         <attribute type="String" mode="IN" name="paid" optional="true"/>
         <attribute type="String" mode="IN" name="shipped" optional="true"/>
     </service>
+    
+    <service name="checkOrderIsOnBackOrder" engine="simple" auth="false"
+            location="org/ofbiz/order/order/OrderServices.xml" invoke="checkOrderIsOnBackOrder">
+        <description>Check if an Order is on Back Order</description>
+        <attribute name="orderId" type="String" mode="IN" optional="false"/>
+        <attribute name="isBackOrder" type="Boolean" mode="OUT" optional="false"/>      
+    </service>
 </services>