From: Scott G. <le...@ea...> - 2007-07-24 09:14:58
|
Author: lektran Date: 2007-07-24 02:14:21 -0700 (Tue, 24 Jul 2007) New Revision: 3957 Modified: versions/1.0/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java Log: OFBIZ trunk 556341, release4.0 557575 Fixed a rounding issue relating to BillingAccount's maxAmount, patch from Rashko Rejmer (OFBIZ-1143) Modified: versions/1.0/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java =================================================================== --- versions/1.0/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java 2007-07-24 09:11:24 UTC (rev 3956) +++ versions/1.0/trunk/applications/order/src/org/ofbiz/order/shoppingcart/ShoppingCart.java 2007-07-24 09:14:21 UTC (rev 3957) @@ -4223,6 +4223,9 @@ } } + BigDecimal amountBd = new BigDecimal(amount.doubleValue()); + amountBd = amountBd.setScale(scale, rounding); + // create the OrderPaymentPreference record GenericValue opp = delegator.makeValue("OrderPaymentPreference", new HashMap()); opp.set("paymentMethodTypeId", valueObj.getString("paymentMethodTypeId")); @@ -4231,7 +4234,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]); |