Author: lektran
Date: Sat Jul 14 14:25:47 2007
New Revision: 556341
URL:
http://svn.apache.org/viewvc?view=rev&rev=556341Log:
Fixed a rounding issue relating to BillingAccount's maxAmount, patch from Rashko Rejmer (OFBIZ-1143)
Modified:
ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
Modified: ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java?view=diff&rev=556341&r1=556340&r2=556341==============================================================================
--- ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java (original)
+++ ofbiz/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java Sat Jul 14 14:25:47 2007
@@ -4321,6 +4321,9 @@
}
}
+ BigDecimal amountBd = new BigDecimal(amount);
+ amountBd = amountBd.setScale(scale, rounding);
+
// create the OrderPaymentPreference record
GenericValue opp = delegator.makeValue("OrderPaymentPreference", new HashMap());
opp.set("paymentMethodTypeId", valueObj.getString("paymentMethodTypeId"));
@@ -4329,7 +4332,7 @@
opp.set("paymentMethodId", paymentMethodId);
opp.set("finAccountId", finAccountId);
opp.set("billingPostalCode", postalCode);
- opp.set("maxAmount", amount);
+ opp.set("maxAmount", amountBd);
if (refNum != null) {
opp.set("manualRefNum", refNum[0]);
opp.set("manualAuthCode", refNum[1]);