svn commit: r774288 - /ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml

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

svn commit: r774288 - /ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml

mor-2
Author: mor
Date: Wed May 13 12:14:37 2009
New Revision: 774288

URL: http://svn.apache.org/viewvc?rev=774288&view=rev
Log:
The existing replacement order (in held status) get cancelled because of return is not recieved in minimum number of days, but if the return is received later
on then a new replacement order should be created for the return received.
Patch from Deepesh Kapoor, part of OFBIZ-2463 (https://issues.apache.org/jira/browse/OFBIZ-2463)

Modified:
    ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml

Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml?rev=774288&r1=774287&r2=774288&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml (original)
+++ ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml Wed May 13 12:14:37 2009
@@ -912,13 +912,25 @@
                 <!-- Get the replacement order and update its status to Approved -->
                 <first-from-list list="returnItems" entry="returnItem"/>
                 <get-related-one relation-name="ReturnItemResponse" value-field="returnItem" to-value-field="returnItemResponse"/>
-                <set field="changeOrderStatusMap.statusId" value="ORDER_APPROVED"/>
-                <set field="changeOrderStatusMap.orderId" from-field="returnItemResponse.replacementOrderId"/>
-                <call-service service-name="changeOrderStatus" in-map-name="changeOrderStatusMap"/>                
+                <entity-one entity-name="OrderHeader" value-field="orderHeader" >
+                    <field-map field-name="orderId" from-field="returnItemResponse.replacementOrderId"/>
+                </entity-one>
+                <if-not-empty field="orderHeader">
+                    <if-compare field="orderHeader.statusId" operator="equals" value="ORDER_HOLD">
+                        <set field="changeOrderStatusMap.statusId" value="ORDER_APPROVED"/>
+                        <set field="changeOrderStatusMap.orderId" from-field="returnItemResponse.replacementOrderId"/>
+                        <call-service service-name="changeOrderStatus" in-map-name="changeOrderStatusMap"/>
+                    </if-compare>
+                    <if-compare field="orderHeader.statusId" operator="equals" value="ORDER_CANCELLED">
+                        <set field="createOrderMap.returnId" from-field="parameters.returnId"/>
+                        <set field="createOrderMap.returnTypeId" value="RTN_WAIT_REPLACE_RES"/>
+                        <call-service service-name="processReplacementReturn" in-map-name="createOrderMap"/>
+                    </if-compare>
+            </if-not-empty>                                
             </if-not-empty>
-        </if-compare>    
-    </simple-method>    
-    
+        </if-compare>
+    </simple-method>
+  
     <simple-method method-name="processReplaceImmediatelyReturn" short-description="Process the replacements in a immediate return">
         <set field="inMap.returnId" from-field="parameters.returnId"/>
         <set field="inMap.returnTypeId" value="RTN_REPLACE_IMMEDIAT"/>