Hello Bilgin and others,

I found that Manual refund functionality is broken due to this commit . Steps to reproduce the error:

1) Create a sales order from Order manager application with two or more items.

2) Then approve and "Quick ship the entire Order" which will complete the order.

3) Then click on "Create Return" button on Actions Block.

4) You will land on Create new Return Page: Also attaching the screen shot. (Screenshot-1)

5) Click on select all check box and then click on "Return Selected items button."

6) You will find that page is broken. Also attaching the screen shot for the same. (Screenshot-2)

After doing research on this I found that reason for this code failure is in "createReturnAndItemOrAdjustment" simple method in OrderReturnServices.xml. This is because in below given code snippet :

   1    <if-empty field="parameters.returnId">
2 <set-service-fields service-name="createReturnHeader" map="parameters" to-map="returnHeaderInMap"/> 3 <call-service service-name="createReturnHeader" in-map-name="returnHeaderInMap">
   4          <result-to-field result-name="returnId" field="returnId"/>
   5      </call-service>
   6      <check-errors/>
   7      <set field="parameters.returnId" from-field="returnId"/>
   8      <field-to-result field="returnId" result-name="returnId"/>
   9   </if-empty>

parameters.returnId field is always empty when this service is called as "service-multi" even though it is set in line #7.

And if I revert your this commit then this functionality is working fine.
So It will be great if you or any one else, give the reason of this commit and also provide fix or alternate way to solve this issue.

Thanks
--
Divesh Dutta.


[email protected] wrote:
Author: bibryam
Date: Thu Oct 29 21:35:49 2009
New Revision: 831098

URL: http://svn.apache.org/viewvc?rev=831098&view=rev
Log:
Prevent overriding of service results in a service-multi type events.

Modified:
    
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceMultiEventHandler.java

Modified: 
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceMultiEventHandler.java
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceMultiEventHandler.java?rev=831098&r1=831097&r2=831098&view=diff
==============================================================================
--- 
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceMultiEventHandler.java
 (original)
+++ 
ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/event/ServiceMultiEventHandler.java
 Thu Oct 29 21:35:49 2009
@@ -339,7 +339,7 @@
                     if 
(!UtilValidate.isEmpty(result.get(ModelService.SUCCESS_MESSAGE_LIST))) {
                         List<String> newSuccessMessages = 
UtilGenerics.<String>checkList(result.get(ModelService.SUCCESS_MESSAGE_LIST));
                         for (int j = 0; j < newSuccessMessages.size(); j++) {
-                            String newSuccessMessage = 
(String)newSuccessMessages.get(j);
+                            String newSuccessMessage = 
newSuccessMessages.get(j);
                             if (!successMessages.contains(newSuccessMessage)) {
                                 successMessages.add(newSuccessMessage);
                             }
@@ -355,7 +355,7 @@
                         if (resultKey != null && 
!ModelService.RESPONSE_MESSAGE.equals(resultKey) && 
!ModelService.ERROR_MESSAGE.equals(resultKey) &&
                                 !ModelService.ERROR_MESSAGE_LIST.equals(resultKey) && 
!ModelService.ERROR_MESSAGE_MAP.equals(resultKey) &&
                                 !ModelService.SUCCESS_MESSAGE.equals(resultKey) 
&& !ModelService.SUCCESS_MESSAGE_LIST.equals(resultKey)) {
-                            request.setAttribute(resultKey, resultValue);
+                            request.setAttribute(resultKey + curSuffix, 
resultValue);
                         }
                     }
                 }



Reply via email to