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 2014/09/20 17:11:49 UTC

svn commit: r1626455 - /ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java

Author: ashish
Date: Sat Sep 20 15:11:49 2014
New Revision: 1626455

URL: http://svn.apache.org/r1626455
Log:
Applied fix from jira issue - OFBIZ-5017 - Quick Refund Entire Order create a Payment without the Adjustment Item amount. 
Sharing latest comment from Arun: Issue of shipping adjustments in the 'Quick Refund Entire Order' process is not regenerating but return total was calculating wrong (greater than order total) during this process. Please find attached patch for the same.
Thanks Arun and Deepak for the contribution. 

Modified:
    ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java

Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java?rev=1626455&r1=1626454&r2=1626455&view=diff
==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/order/OrderReadHelper.java Sat Sep 20 15:11:49 2014
@@ -1759,7 +1759,10 @@ public class OrderReadHelper {
             if ((returnedItem.get("returnPrice") != null) && (returnedItem.get("returnQuantity") != null)) {
                 returnedAmount = returnedAmount.add(returnedItem.getBigDecimal("returnPrice").multiply(returnedItem.getBigDecimal("returnQuantity")).setScale(scale, rounding));
             }
-            Map<String, Object> itemAdjustmentCondition = UtilMisc.toMap("returnId", returnedItem.get("returnId"), "returnItemSeqId", returnedItem.get("returnItemSeqId"), "returnTypeId", returnTypeId);
+            Map<String, Object> itemAdjustmentCondition = UtilMisc.toMap("returnId", returnedItem.get("returnId"), "returnItemSeqId", returnedItem.get("returnItemSeqId"));; 
+            if (UtilValidate.isNotEmpty(returnTypeId)) {
+                itemAdjustmentCondition.put("returnTypeId", returnTypeId);
+            }
             returnedAmount = returnedAmount.add(getReturnAdjustmentTotal(orderHeader.getDelegator(), itemAdjustmentCondition));
             if (orderId.equals(returnedItem.getString("orderId")) && (!returnHeaderList.contains(returnedItem.getString("returnId")))) {
                 returnHeaderList.add(returnedItem.getString("returnId"));