Login  Register

Re: Users - Bug in CheckOutHelper.validatePaymentMethods?

Posted by Vinay Agarwal on Apr 20, 2006; 3:54pm
URL: http://ofbiz.116.s1.nabble.com/Users-Bug-in-CheckOutHelper-validatePaymentMethods-tp138582p138585.html

Jacopo,
I haven't been able to reproduce it. So we can assume that it works.
Vinay

-----Original Message-----
From: [hidden email] [mailto:[hidden email]]
On Behalf Of Jacopo Cappellato
Sent: Tuesday, April 18, 2006 10:17 PM
To: OFBiz Users / Usage Discussion
Subject: Re: [OFBiz] Users - Bug in CheckOutHelper.validatePaymentMethods?

Vinay,

I'have reproduced exactly your scenario (same account limit, same orders
same numbers) but I couldn't reproduce the error: however I've used the
Order->Order Entry screens to enter the orders (sorry but at the moment
I cannot test the ecommerce component).
Could you please try to use the Order Manager application to enter your
order and see if it works?

Jacopo

Vinay Agarwal wrote:
> Jacopo,
>
> Further details in case you can't reproduce:
> 79.92 comes from 19.98 * 4
> Part of the data is several days old and may not have been stored using
the

> latest code. I can't imagine getting that small fraction if each order is
> forced to 2 digit resolution with BigDecimal.
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]]
> On Behalf Of Vinay Agarwal
> Sent: Tuesday, April 18, 2006 9:20 AM
> To: 'OFBiz Users / Usage Discussion'
> Subject: Re: [OFBiz] Users - Bug in CheckOutHelper.validatePaymentMethods?
>
> I can't reproduce with demo data since it doesn't have exact prices that
> showed this problem. Here are the details:
> Billing account amount =2000.00
> Pending orders (approved not shipped) = 8 orders 79.92 each
> Billing account balance shown in quick checkout $1,360.64 which is higher
> than the calculated availableAmount of 1360.6399999999.
>
> Regards,
> Vinay Agarwal
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]]
> On Behalf Of Jacopo Cappellato
> Sent: Tuesday, April 18, 2006 8:23 AM
> To: OFBiz Users / Usage Discussion
> Subject: Re: [OFBiz] Users - Bug in CheckOutHelper.validatePaymentMethods?
>
> 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
>  
> _______________________________________________
> 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
 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users