Author: jleroux
Date: Thu Dec 18 12:15:07 2008
New Revision: 727806
URL:
http://svn.apache.org/viewvc?rev=727806&view=revLog:
A patch from William Perng " Incorrect return amount when order is paid by the same paymentMethodId more than one time" (
https://issues.apache.org/jira/browse/OFBIZ-2092) - OFBIZ-2092
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=727806&r1=727805&r2=727806&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 Thu Dec 18 12:15:07 2008
@@ -235,6 +235,11 @@
if (chargedToPaymentPref.compareTo(ZERO) == 1) {
// key of the resulting map is paymentMethodId or paymentMethodTypeId if the paymentMethodId is not available
String paymentMethodKey = paymentPref.getString("paymentMethodId") != null ? paymentPref.getString("paymentMethodId") : paymentPref.getString("paymentMethodTypeId");
+ if(paymentMethodAmounts.containsKey(paymentMethodKey)){
+ Double value = (Double)paymentMethodAmounts.get(paymentMethodKey);
+ if(value != null)
+ chargedToPaymentPref = chargedToPaymentPref.add(new BigDecimal(value.doubleValue()));
+ }
paymentMethodAmounts.put(paymentMethodKey, new Double(chargedToPaymentPref.setScale(scale, rounding).doubleValue()));
}
}