Posted by
Vinay Agarwal on
Apr 18, 2006; 5:19pm
URL: http://ofbiz.116.s1.nabble.com/Users-Bug-in-CheckOutHelper-validatePaymentMethods-tp138582p138589.html
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