Author: ashish
Date: Tue Jun 23 15:30:38 2009
New Revision: 787711
URL:
http://svn.apache.org/viewvc?rev=787711&view=revLog:
Applied fix from trunk revision: 787708
Applied patch from jira issue OFBIZ-2652 (Payment preference is not created for replacement order in case of cross ship replacement)
Thanks Mridul for your contribution.
Modified:
ofbiz/branches/release09.04/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
Modified: ofbiz/branches/release09.04/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/branches/release09.04/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java?rev=787711&r1=787710&r2=787711&view=diff==============================================================================
--- ofbiz/branches/release09.04/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java (original)
+++ ofbiz/branches/release09.04/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java Tue Jun 23 15:30:38 2009
@@ -1666,7 +1666,7 @@
orderMap.put("orderAdjustments", UtilMisc.toList(adj));
// Payment preference
- if (additionalItemTotal.compareTo(BigDecimal.ZERO) > 0) {
+ if ((additionalItemTotal.compareTo(BigDecimal.ZERO) > 0) || ("RTN_CSREPLACE".equals(returnTypeId) && orderPriceTotal.compareTo(ZERO) > 0)) {
GenericValue paymentMethod = null;
try {
paymentMethod = returnHeader.getRelatedOne("PaymentMethod");
@@ -1691,6 +1691,9 @@
opp.set("statusId", "PAYMENT_RECEIVED");
}
}
+ if ("RTN_CSREPLACE".equals(returnTypeId)) {
+ opp.set("maxAmount", orderPriceTotal);
+ }
orderMap.put("orderPaymentInfo", UtilMisc.toList(opp));
}
}