svn commit: r787708 - /ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r787708 - /ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReturnServices.java

ashish-18
Author: ashish
Date: Tue Jun 23 15:26:07 2009
New Revision: 787708

URL: http://svn.apache.org/viewvc?rev=787708&view=rev
Log:
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/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=787708&r1=787707&r2=787708&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 Tue Jun 23 15:26:07 2009
@@ -1969,7 +1969,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");
@@ -1994,6 +1994,9 @@
                                 opp.set("statusId", "PAYMENT_RECEIVED");
                             }
                         }
+                        if ("RTN_CSREPLACE".equals(returnTypeId)) {
+                            opp.set("maxAmount", orderPriceTotal);
+                        }
                         orderMap.put("orderPaymentInfo", UtilMisc.toList(opp));
                     }
                 }