You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by as...@apache.org on 2009/06/23 17:26:08 UTC

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

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));
                     }
                 }