Author: sichen
Date: Thu Nov 16 17:28:46 2006
New Revision: 476018

URL: http://svn.apache.org/viewvc?view=rev&rev=476018
Log:
when a return header is updated to canceled, all return items will be updated 
to canceled.  Basically from Ashish Vijaywargiya's patch OFBIZ-462

Modified:
    
incubator/ofbiz/trunk/applications/order/config/OrderErrorUiLabels.properties
    
incubator/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml
    incubator/ofbiz/trunk/applications/order/servicedef/secas.xml
    incubator/ofbiz/trunk/applications/order/servicedef/services_return.xml

Modified: 
incubator/ofbiz/trunk/applications/order/config/OrderErrorUiLabels.properties
URL: 
http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/config/OrderErrorUiLabels.properties?view=diff&rev=476018&r1=476017&r2=476018
==============================================================================
--- 
incubator/ofbiz/trunk/applications/order/config/OrderErrorUiLabels.properties 
(original)
+++ 
incubator/ofbiz/trunk/applications/order/config/OrderErrorUiLabels.properties 
Thu Nov 16 17:28:46 2006
@@ -229,6 +229,7 @@
 OrderSecurityErrorToRunRemoveQuoteCoefficient=Security Error : to run 
removeQuoteCoefficient you must have the ORDERMGR_CREATE or ORDERMGR_ADMIN 
permission
 OrderSecurityErrorToRunRemoveQuoteItem=Security Error : to run removeQuoteItem 
you must have the ORDERMGR_CREATE or ORDERMGR_ADMIN permission
 OrderSecurityErrorToRunRemoveReturnItem=Security Error : to run 
removeReturnItem you must have the ORDERMGR_DELETE or ORDERMGR_ADMIN permission
+OrderSecurityErrorToRunCancelReturnItems = Security Error : to run 
cancelReturnItems you must have the ORDERMGR_DELETE or ORDERMGR_ADMIN permission
 OrderSecurityErrorToRunRemoveTaxRate=Security Error : to run RemoveTaxRate you 
must have the TAXRATE_DELETE or TAXRATE_ADMIN permission
 OrderSecurityErrorToRunUpdateOrderStatusFromReceipt=Security Error : to run 
updateOrderStatusFromReceipt you must have the ORDERMGR_UPDATE or 
ORDERMGR_ADMIN permission
 OrderSecurityErrorToRunUpdateQuote=Security Error : to run updateQuote you 
must have the ORDERMGR_CREATE or ORDERMGR_ADMIN permission

Modified: 
incubator/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml
URL: 
http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml?view=diff&rev=476018&r1=476017&r2=476018
==============================================================================
--- 
incubator/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml
 (original)
+++ 
incubator/ofbiz/trunk/applications/order/script/org/ofbiz/order/order/OrderReturnServices.xml
 Thu Nov 16 17:28:46 2006
@@ -733,4 +733,18 @@
         <set-pk-fields map-name="parameters" value-name="newEntity"/>
         <create-value value-name="newEntity"/>
     </simple-method>
+       
+    <simple-method method-name="cancelReturnItems" short-description="Update a 
ReturnItems">
+        <check-permission permission="ORDERMGR" 
action="_UPDATE"><fail-property resource="OrderErrorUiLabels" 
property="OrderSecurityErrorToRunCancelReturnItems"/></check-permission>
+        <check-errors/>
+        <entity-condition entity-name="ReturnItem" list-name="returnItems" 
distinct="true">
+            <condition-expr field-name="returnId" operator="equals" 
env-name="parameters.returnId"/>
+        </entity-condition>
+        <iterate entry-name="returnItem" list-name="returnItems">
+            <set field="returnItemMap.returnId" 
from-field="parameters.returnId"/>
+            <set field="returnItemMap.returnItemSeqId" 
from-field="returnItem.returnItemSeqId"/>
+            <set field="returnItemMap.statusId" value="RETURN_CANCELLED" />
+            <call-service service-name="updateReturnItem" 
in-map-name="returnItemMap"/>
+        </iterate>
+    </simple-method>
 </simple-methods>

Modified: incubator/ofbiz/trunk/applications/order/servicedef/secas.xml
URL: 
http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/servicedef/secas.xml?view=diff&rev=476018&r1=476017&r2=476018
==============================================================================
--- incubator/ofbiz/trunk/applications/order/servicedef/secas.xml (original)
+++ incubator/ofbiz/trunk/applications/order/servicedef/secas.xml Thu Nov 16 
17:28:46 2006
@@ -157,7 +157,11 @@
         <condition field-name="currentStatusId" operator="not-equals" 
value="RETURN_CANCELLED"/>
         <action service="sendReturnCancelNotification" mode="async" 
persist="true"/>
     </eca>
-
+    <eca service="updateReturnHeader" event="commit">
+        <condition field-name="statusId" operator="equals" 
value="RETURN_CANCELLED"/>
+        <action service="cancelReturnItems" mode="sync" persist="true"/>
+    </eca>
+       
     <eca service="updateReturnItem" event="commit">
         <condition field-name="statusId" operator="equals" 
value="RETURN_RECEIVED"/>
         <condition field-name="currentStatusId" operator="not-equals" 
value="RETURN_RECEIVED"/>

Modified: 
incubator/ofbiz/trunk/applications/order/servicedef/services_return.xml
URL: 
http://svn.apache.org/viewvc/incubator/ofbiz/trunk/applications/order/servicedef/services_return.xml?view=diff&rev=476018&r1=476017&r2=476018
==============================================================================
--- incubator/ofbiz/trunk/applications/order/servicedef/services_return.xml 
(original)
+++ incubator/ofbiz/trunk/applications/order/servicedef/services_return.xml Thu 
Nov 16 17:28:46 2006
@@ -108,7 +108,12 @@
                 all items are paid.</description>
         <attribute name="returnItemResponseId" type="String" mode="IN" 
optional="false"/>
     </service>
-    
+    <service name="cancelReturnItems" engine="simple"
+            location="org/ofbiz/order/order/OrderReturnServices.xml" 
invoke="cancelReturnItems">
+        <description>Cancel ReturnItems and set their status to 
"RETURN_CANCELLED"</description>
+        <attribute name="returnId" type="String" mode="IN" optional="false"/>
+    </service>
+           
     <!-- services for return adjustments -->
     <service name="returnAdjustmentInterface" engine="interface" location="" 
invoke="">
         <description>Return Adjustment Interface</description>


Reply via email to