You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2007/04/30 15:48:33 UTC

svn commit: r533746 - in /ofbiz/trunk/applications/order: script/org/ofbiz/order/order/OrderReturnServices.xml servicedef/secas.xml servicedef/services_return.xml src/org/ofbiz/order/order/OrderReturnServices.java

Author: jacopoc
Date: Mon Apr 30 06:48:32 2007
New Revision: 533746

URL: http://svn.apache.org/viewvc?view=rev&rev=533746
Log:
Very first draft of the implementation for cross-ship replacement returns.

Modified:
    ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml
    ofbiz/trunk/applications/order/servicedef/secas.xml
    ofbiz/trunk/applications/order/servicedef/services_return.xml
    ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java

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?view=diff&rev=533746&r1=533745&r2=533746
==============================================================================
--- ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml (original)
+++ ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml Mon Apr 30 06:48:32 2007
@@ -747,4 +747,15 @@
             <call-service service-name="updateReturnItem" in-map-name="returnItemMap"/>
         </iterate>
     </simple-method>
+
+    <simple-method method-name="processWaitReplacementReturn" short-description="Process the replacements in a wait return">
+        <set field="inMap.returnId" from-field="parameters.returnId"/>
+        <set field="inMap.returnTypeId" value="RTN_REPLACE"/>
+        <call-service service-name="processReplacementReturn" in-map-name="inMap"/>
+    </simple-method>
+    <simple-method method-name="processCrossShipReplacementReturn" short-description="Process the replacements in a cross-ship return">
+        <set field="inMap.returnId" from-field="parameters.returnId"/>
+        <set field="inMap.returnTypeId" value="RTN_CSREPLACE"/>
+        <call-service service-name="processReplacementReturn" in-map-name="inMap"/>
+    </simple-method>
 </simple-methods>

Modified: ofbiz/trunk/applications/order/servicedef/secas.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/secas.xml?view=diff&rev=533746&r1=533745&r2=533746
==============================================================================
--- ofbiz/trunk/applications/order/servicedef/secas.xml (original)
+++ ofbiz/trunk/applications/order/servicedef/secas.xml Mon Apr 30 06:48:32 2007
@@ -140,13 +140,14 @@
     <eca service="updateReturnHeader" event="commit">
         <condition field-name="statusId" operator="equals" value="RETURN_ACCEPTED"/>
         <condition field-name="currentStatusId" operator="not-equals" value="RETURN_ACCEPTED"/>
+        <action service="processCrossShipReplacementReturn" mode="sync"/>
         <action service="createTrackingCodeOrderReturns" mode="sync"/>
         <action service="sendReturnAcceptNotification" mode="async" persist="true"/>
     </eca>
     <eca service="updateReturnHeader" event="commit">
         <condition field-name="statusId" operator="equals" value="RETURN_RECEIVED"/>
         <condition field-name="currentStatusId" operator="not-equals" value="RETURN_RECEIVED"/>
-        <action service="processReplacementReturn" mode="sync"/>
+        <action service="processWaitReplacementReturn" mode="sync"/>
         <action service="processCreditReturn" mode="sync"/>
         <action service="processRefundReturn" mode="sync"/>
     </eca>
@@ -171,7 +172,7 @@
 
     <eca service="updateReturnStatusFromReceipt" event="global-commit">
         <condition field-name="returnHeaderStatus" operator="equals" value="RETURN_RECEIVED"/>
-        <action service="processReplacementReturn" mode="sync" persist="true"/>
+        <action service="processWaitReplacementReturn" mode="sync" persist="true"/>
         <action service="processCreditReturn" mode="sync" persist="true"/>
         <action service="processRefundReturn" mode="sync" persist="true"/>
     </eca>

Modified: ofbiz/trunk/applications/order/servicedef/services_return.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services_return.xml?view=diff&rev=533746&r1=533745&r2=533746
==============================================================================
--- ofbiz/trunk/applications/order/servicedef/services_return.xml (original)
+++ ofbiz/trunk/applications/order/servicedef/services_return.xml Mon Apr 30 06:48:32 2007
@@ -214,6 +214,17 @@
             location="org.ofbiz.order.order.OrderReturnServices" invoke="processReplacementReturn">
         <description>Process the replacements in a return</description>
         <attribute name="returnId" type="String" mode="IN" optional="false"/>
+        <attribute name="returnTypeId" type="String" mode="IN" optional="false"/>
+    </service>
+    <service name="processWaitReplacementReturn" engine="simple" auth="true"
+            location="org/ofbiz/order/order/OrderReturnServices.xml" invoke="processWaitReplacementReturn">
+        <description>Process the replacements in a wait return</description>
+        <attribute name="returnId" type="String" mode="IN" optional="false"/>
+    </service>
+    <service name="processCrossShipReplacementReturn" engine="simple" auth="true"
+            location="org/ofbiz/order/order/OrderReturnServices.xml" invoke="processCrossShipReplacementReturn">
+        <description>Process the replacements in a cross-ship return</description>
+        <attribute name="returnId" type="String" mode="IN" optional="false"/>
     </service>
     <service name="updateReturnStatusFromReceipt" engine="simple"
             location="org/ofbiz/order/order/OrderReturnServices.xml" invoke="updateReturnStatusFromReceipt">

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java?view=diff&rev=533746&r1=533745&r2=533746
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java Mon Apr 30 06:48:32 2007
@@ -1267,6 +1267,7 @@
         LocalDispatcher dispatcher = dctx.getDispatcher();
         GenericDelegator delegator = dctx.getDelegator();
         String returnId = (String) context.get("returnId");
+        String returnTypeId = (String) context.get("returnTypeId");
         GenericValue userLogin = (GenericValue) context.get("userLogin");
         Locale locale = (Locale) context.get("locale");
 
@@ -1275,7 +1276,7 @@
         try {
             returnHeader = delegator.findByPrimaryKey("ReturnHeader", UtilMisc.toMap("returnId", returnId));
             if (returnHeader != null) {
-                returnItems = returnHeader.getRelatedByAnd("ReturnItem", UtilMisc.toMap("returnTypeId", "RTN_REPLACE"));
+                returnItems = returnHeader.getRelatedByAnd("ReturnItem", UtilMisc.toMap("returnTypeId", returnTypeId));
             }
         } catch (GenericEntityException e) {
             Debug.logError(e, "Problems looking up return information", module);