svn commit: r654072 - in /ofbiz/trunk/applications/order: entitydef/eecas.xml script/org/ofbiz/order/order/OrderReturnServices.xml servicedef/secas.xml src/org/ofbiz/order/order/OrderReturnServices.java

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

svn commit: r654072 - in /ofbiz/trunk/applications/order: entitydef/eecas.xml script/org/ofbiz/order/order/OrderReturnServices.xml servicedef/secas.xml src/org/ofbiz/order/order/OrderReturnServices.java

lektran
Author: lektran
Date: Wed May  7 04:24:41 2008
New Revision: 654072

URL: http://svn.apache.org/viewvc?rev=654072&view=rev
Log:
Fix for OFBIZ-1765 reported by Jacopo Cappellato - Replacement returns were creating duplicated replacement orders.  

The problem was that updateReturnHeader was being called and committed a 2nd time before the 1st call had been committed, and somehow that was causing a SECA condition to evaluate to true for both commits instead of just one.

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

Modified: ofbiz/trunk/applications/order/entitydef/eecas.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/entitydef/eecas.xml?rev=654072&r1=654071&r2=654072&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/entitydef/eecas.xml (original)
+++ ofbiz/trunk/applications/order/entitydef/eecas.xml Wed May  7 04:24:41 2008
@@ -27,13 +27,6 @@
         <action service="issueImmediatelyFulfilledOrder" mode="sync"/>
     </eca>
 
-    <!-- Inventory Receive ECAs for Immediately Received Returns -->
-    <eca entity="ReturnHeader" operation="create-store" event="return">
-        <condition field-name="statusId" operator="equals" value="RETURN_ACCEPTED"/>
-        <condition field-name="needsInventoryReceive" operator="equals" value="Y"/>
-        <action service="quickReceiveReturn" mode="sync"/>
-    </eca>
-    
     <eca entity="OrderItem" operation="create-store" event="return">
         <condition field-name="quoteId" operator="is-not-empty"/>
         <action service="checkUpdateQuoteStatus" mode="sync"/>

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=654072&r1=654071&r2=654072&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  7 04:24:41 2008
@@ -114,7 +114,7 @@
 
         <!-- test the total return amount vs the total order amount -->
         <if-compare field-name="parameters.statusId" value="RETURN_ACCEPTED" operator="equals">
-            <!-- get the list of ReturnItems.  Note: return may be assosicated with many different orders -->
+            <!-- get the list of ReturnItems.  Note: return may be associated with many different orders -->
             <entity-condition entity-name="ReturnItem" list-name="returnItems" distinct="true">
                 <condition-expr field-name="returnId" env-name="returnHeader.returnId"/>
             </entity-condition>

Modified: ofbiz/trunk/applications/order/servicedef/secas.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/secas.xml?rev=654072&r1=654071&r2=654072&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/servicedef/secas.xml (original)
+++ ofbiz/trunk/applications/order/servicedef/secas.xml Wed May  7 04:24:41 2008
@@ -169,6 +169,11 @@
     <eca service="updateReturnHeader" event="commit">
         <action service="checkReturnComplete" mode="sync"/>
     </eca>
+    <eca service="updateReturnHeader" event="return">
+        <condition field-name="statusId" operator="equals" value="RETURN_ACCEPTED"/>
+        <condition field-name="needsInventoryReceive" operator="equals" value="Y"/>
+        <action service="quickReceiveReturn" mode="sync"/>
+    </eca>
     <eca service="updateReturnHeader" event="commit">
         <condition field-name="statusId" operator="equals" value="RETURN_ACCEPTED"/>
         <condition field-name="currentStatusId" operator="not-equals" value="RETURN_ACCEPTED"/>

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?rev=654072&r1=654071&r2=654072&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java Wed May  7 04:24:41 2008
@@ -160,7 +160,7 @@
                     throw new GeneralRuntimeException(e.getMessage());
                 }
                 if (itemIssue != null && itemIssue.size() > 0) {
-                    Debug.log("Found item issuance referece", module);
+                    Debug.log("Found item issuance reference", module);
                     // just use the first one for now; maybe later we can find a better way to determine which was the
                     // actual item being returned; maybe by serial number
                     GenericValue issue = EntityUtil.getFirst(itemIssue);