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:38:31 UTC
svn commit: r958473 -
/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
Author: mor
Date: Mon Jun 28 06:38:30 2010
New Revision: 958473
URL: http://svn.apache.org/viewvc?rev=958473&view=rev
Log:
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/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
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=958473&r1=958472&r2=958473&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 Mon Jun 28 06:38:30 2010
@@ -2077,7 +2077,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