You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by mo...@apache.org on 2010/06/28 08:40:18 UTC

svn commit: r958474 - /ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java

Author: mor
Date: Mon Jun 28 06:40:18 2010
New Revision: 958474

URL: http://svn.apache.org/viewvc?rev=958474&view=rev
Log:
Merged from trunk r958473. Fixed a bug in Vendor Returns. A zero amount purchase order is created for replacement return in approved status but since the purchase order is not associated to the product store any more it was throwing an error.

Modified:
    ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java

Modified: ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java?rev=958474&r1=958473&r2=958474&view=diff
==============================================================================
--- ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java (original)
+++ ofbiz/branches/release10.04/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java Mon Jun 28 06:40:18 2010
@@ -2076,7 +2076,17 @@ public class OrderReturnServices {
                             return ServiceUtil.returnError(ServiceUtil.getErrorMessage(serviceResult));
                         }
                     } else {
-                        OrderChangeHelper.approveOrder(dispatcher, userLogin, createdOrderId);
+                        if ("CUSTOMER_RETURN".equals(returnHeaderTypeId)) {
+                            OrderChangeHelper.approveOrder(dispatcher, userLogin, createdOrderId);
+                        } else {
+                            try {
+                                OrderChangeHelper.orderStatusChanges(dispatcher, userLogin, createdOrderId, "ORDER_APPROVED", null, "ITEM_APPROVED", null);
+                            } catch (GenericServiceException e) {
+                                String errorMessage = "Service invocation error, status changes were not updated for order #" + createdOrderId;
+                                Debug.logError(e, errorMessage, module);
+                                return ServiceUtil.returnError(errorMessage);
+                            }
+                        }
                     }
 
                     // create a ReturnItemResponse and attach to each ReturnItem