[
https://issues.apache.org/jira/browse/OFBIZ-4326?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13056364#comment-13056364
]
Stéphane DUCAS commented on OFBIZ-4326:
---------------------------------------
Hello Jacques and Paul.
@Jacques: No problem 'll do that for the next patches thx for advises
@Paul: You're right that my fix wasn't enough in my case.
First I noticed that when I Recalculate Order the amount of the vat correction
was changing (at last step).. I think the cause is that the amount is rounded
at UI side so when the user press recalculate order the itemPrice is rounded
(EG:: without recalculation itemPrice=20.895, with recalculation
itemPrice=20.90).
tax included are calculated with the itemPrice (rounded when recalculated) and
vat correction is calculated with the not rounded price (the one in database
wich is almost always three decimals because it is the result of a division).
So in addition to my fix I hacked ShoppingCartItem.java at line 1211 to round
the basePrice at two decimals. (I post the patch now). In fact the new patch
patch may be enought so you can maybe forget about the old one.. or neither of
them is the correct way to do it.. but with them I can have VAT included price
of 24.99 EUR from the shopping cart to the invoice with or without order
recalculation.
I'm sorry I can't look deeply for the causes and propose the right patch
beacause I have to hurry for my customer but I will study more precisly the
issue when my project is done.
> VAT Correction for ProductPrice that has priceWithTax =N is not correct (with
> patch)
> ------------------------------------------------------------------------------------
>
> Key: OFBIZ-4326
> URL: https://issues.apache.org/jira/browse/OFBIZ-4326
> Project: OFBiz
> Issue Type: Bug
> Components: accounting
> Affects Versions: SVN trunk
> Reporter: Stéphane DUCAS
> Priority: Minor
> Attachments: OFBIZ-4326_round_price_in_cart.patch,
> vatCorrection.patch, vatCorrection_2.patch, vatCorrection_2.patch
>
>
> The VAT correction adjustment is not correct because it's based on the price
> not rounded (while tax adjustment is calculated from the rounded price).
> I provide the patch for that.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira