Login  Register

Re: Users - Bug in CheckOutHelper.validatePaymentMethods?

Posted by Vinay Agarwal on Apr 16, 2006; 12:24am
URL: http://ofbiz.116.s1.nabble.com/Users-Bug-in-CheckOutHelper-validatePaymentMethods-tp138582p138590.html

I think this is a side effect of back and forth conversion from double to BigDecimal.

 

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Vinay Agarwal
Sent:
Saturday, April 15, 2006 4:07 PM
To: 'OFBiz Users / Usage Discussion'
Subject: [OFBiz] Users - Bug in CheckOutHelper.validatePaymentMethods?

 

Hello,

I just updated to 7304 and I started getting a strange error during checkout (Not enough available on account #{billingAccountId}). The error is generated in CheckOutHelper.validatePaymentMethods as follows

 

        double billingAccountAmt = cart.getBillingAccountAmount();

        double availableAmount = this.availableAccountBalance(billingAccountId);

        if (billingAccountAmt > availableAmount) {

            Map messageMap = UtilMisc.toMap("billingAccountId", billingAccountId);

            errMsg = UtilProperties.getMessage(resource, "checkevents.not_enough_available_on_account", messageMap, (cart != null ? cart.getLocale() : Locale.getDefault()));

            return ServiceUtil.returnError(errMsg);

        }

 

The shopping cart amount is 72.92, billingAccountAmt is 1360.64, and availableAmount is 1360.639999999999. I can’t tell the purpose of these two supposedly identical values and why are they being compared. Although these lines of code hasn’t changed, but something has caused it to not function.

 

Thanks in advance,

Vinay Agarwal


 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users