Login  Register

Re: Users - Bug in CheckOutHelper.validatePaymentMethods?

Posted by Jacopo Cappellato on Apr 18, 2006; 4:22pm
URL: http://ofbiz.116.s1.nabble.com/Users-Bug-in-CheckOutHelper-validatePaymentMethods-tp138582p138588.html

Vinay,

I'm rather sure that the problem you have described is caused by a
recent refactoring I did to the
BillingAccountWorker.getBillingAccountBalance
method that now uses BigDecimals instead of Doubles...
However I cannot reproduce it, I'm sorry.

Could you give me information on how to reproduce it with the OFBiz demo
data? (The amount of the billing account, the items you have ordered etc...)

Thanks,

Jacopo


Jacopo Cappellato wrote:

> Vinay,
>
> yes you are right... I'll do my best to fix it today.
>
> Jacopo
>
> Vinay Agarwal wrote:
>> 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
>
>  
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.ofbiz.org/mailman/listinfo/users
>

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