[jira] [Commented] (OFBIZ-10500) Tax calculation incorrect when creating orders

2019-01-10 Thread Ankush Upadhyay (JIRA)


[ 
https://issues.apache.org/jira/browse/OFBIZ-10500?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16740072#comment-16740072
 ] 

Ankush Upadhyay commented on OFBIZ-10500:
-

[~FrankH],

Sorry for late reply.

I also did check with turned on the show prices including tax option in store 
setting but still getting same result I posted in my previous comment.

Here are the steps with attached screenshots:
 # Load data I posted in my previous comment.
 #  From Stores, turned on the *Show prices with VAT tax included* flag 
including Vat Tax Auth Geo ID and Vat Tax Auth Party ID.
 # Now place order for demo customer and selected currency as EUR and shipping 
address as *Surinamestraat 27, 2585 GJ Den Haag, Netherlands*

After these steps still I can see expected results that attached in previous 
screenshot.

 

Please reviewed attached screenshots and let me know If I am missing something.

> Tax calculation incorrect when creating orders
> --
>
> Key: OFBIZ-10500
> URL: https://issues.apache.org/jira/browse/OFBIZ-10500
> Project: OFBiz
>  Issue Type: Bug
>  Components: order
>Affects Versions: Release Branch 16.11
> Environment: OpenJDK 1.8.0_151 64bit on Ubuntu 16.04
>Reporter: Frank Herrman
>Assignee: Ankush Upadhyay
>Priority: Major
> Attachments: Invoice.png, Schermafbeelding 2018-07-30 om 
> 10.15.51.png, Schermafbeelding 2018-07-30 om 10.16.16.png, VAT.png
>
>
> After a 
> [discussion|https://lists.apache.org/thread.html/adf568edad92255340697f78ea4f34a07e328cc1689b8fb73e16fa53@%3Cuser.ofbiz.apache.org%3E]
>  on the user mailinglist we concluded there seems to be an issue with the tax 
> calculations.
> *Steps to reproduce*
>  * Create a tax authority for a specific country (e.g. The Netherlands in my 
> case)
>  * Set sales tax rate of 21% for your store with this Tax Authority
>  * Create a product and enter a price either including or excluding taxes and 
> set the corresponding flag for tax included y/n.
>  * Go to the order manager and order entry. Fill in the details, select the 
> product and go to the review page. It now shows the incorrect sales tax and 
> price.
> Let's say we have a product of 20 euro incl. taxes. With 21% that comes down 
> to 3.47 euro of taxes and a price of 16.53 euro. Instead Ofbiz shows a price 
> of 20 euro excl. taxes and adds 4.20 euros in taxes.
> *What I tried*
> Changing the price to price excl. VAT and set the flag to 'N' and visa versa. 
> Both gave the same error. 
> *Possible solution*
> I digged into the code and ended up in the file:
> {{ applications/order/groovyScripts/entry/OrderReadHelper.java}}
> The function in line 2401
> {code:java}
> public static BigDecimal getOrderItemSubTotal(GenericValue orderItem, 
> List adjustments, boolean forTax, boolean forShipping){code}
> returns the price of one item there. It uses this piece of code:
> {code:java}
> orderItem.getBigDecimal("unitPrice");{code}
> The line item is always the price including taxes. When I adjust this price 
> (by dividing it by 1.21) I do get the correct price in the review page. I do 
> not, however, get the right tax amount. This is calculated elsewhere and 
> still using the 20 euro price I guess. Anyway, it does show I was in the 
> right spot.
> I'm not familiar enough with Ofbiz to create a full patch, but I think the 
> easiest way to go is to add another column to order items where the value 
> excl. taxes is stored which can be used in places where needed. This does not 
> affect the whole system. On the other hand I'm not sure where the order items 
> are stored, since when you are on the review page it is not stored in 
> database yet. Probably just in the session? Should make things even easier.
> The attachments show an example. I have stored a product of 20 euro 
> (screenshot directly taken from the database tool) and I have set-up a tax 
> exempt in this case for a customer which shows 4.20 euro sales tax. If I turn 
> off the tax exempt the grand total becomes 24.20 euros, so it is not related 
> to the exempt.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10500) Tax calculation incorrect when creating orders

2018-11-25 Thread Frank Herrman (JIRA)


[ 
https://issues.apache.org/jira/browse/OFBIZ-10500?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16698586#comment-16698586
 ] 

Frank Herrman commented on OFBIZ-10500:
---

Hi [~ankush.upadhyay] , thank you for looking into it. In hindsight I think it 
is related to the 'show prices including tax' option in the store settings. If 
you put that to 'yes' it is incorrect.

> Tax calculation incorrect when creating orders
> --
>
> Key: OFBIZ-10500
> URL: https://issues.apache.org/jira/browse/OFBIZ-10500
> Project: OFBiz
>  Issue Type: Bug
>  Components: order
>Affects Versions: Release Branch 16.11
> Environment: OpenJDK 1.8.0_151 64bit on Ubuntu 16.04
>Reporter: Frank Herrman
>Assignee: Ankush Upadhyay
>Priority: Major
> Attachments: Invoice.png, Schermafbeelding 2018-07-30 om 
> 10.15.51.png, Schermafbeelding 2018-07-30 om 10.16.16.png, VAT.png
>
>
> After a 
> [discussion|https://lists.apache.org/thread.html/adf568edad92255340697f78ea4f34a07e328cc1689b8fb73e16fa53@%3Cuser.ofbiz.apache.org%3E]
>  on the user mailinglist we concluded there seems to be an issue with the tax 
> calculations.
> *Steps to reproduce*
>  * Create a tax authority for a specific country (e.g. The Netherlands in my 
> case)
>  * Set sales tax rate of 21% for your store with this Tax Authority
>  * Create a product and enter a price either including or excluding taxes and 
> set the corresponding flag for tax included y/n.
>  * Go to the order manager and order entry. Fill in the details, select the 
> product and go to the review page. It now shows the incorrect sales tax and 
> price.
> Let's say we have a product of 20 euro incl. taxes. With 21% that comes down 
> to 3.47 euro of taxes and a price of 16.53 euro. Instead Ofbiz shows a price 
> of 20 euro excl. taxes and adds 4.20 euros in taxes.
> *What I tried*
> Changing the price to price excl. VAT and set the flag to 'N' and visa versa. 
> Both gave the same error. 
> *Possible solution*
> I digged into the code and ended up in the file:
> {{ applications/order/groovyScripts/entry/OrderReadHelper.java}}
> The function in line 2401
> {code:java}
> public static BigDecimal getOrderItemSubTotal(GenericValue orderItem, 
> List adjustments, boolean forTax, boolean forShipping){code}
> returns the price of one item there. It uses this piece of code:
> {code:java}
> orderItem.getBigDecimal("unitPrice");{code}
> The line item is always the price including taxes. When I adjust this price 
> (by dividing it by 1.21) I do get the correct price in the review page. I do 
> not, however, get the right tax amount. This is calculated elsewhere and 
> still using the 20 euro price I guess. Anyway, it does show I was in the 
> right spot.
> I'm not familiar enough with Ofbiz to create a full patch, but I think the 
> easiest way to go is to add another column to order items where the value 
> excl. taxes is stored which can be used in places where needed. This does not 
> affect the whole system. On the other hand I'm not sure where the order items 
> are stored, since when you are on the review page it is not stored in 
> database yet. Probably just in the session? Should make things even easier.
> The attachments show an example. I have stored a product of 20 euro 
> (screenshot directly taken from the database tool) and I have set-up a tax 
> exempt in this case for a customer which shows 4.20 euro sales tax. If I turn 
> off the tax exempt the grand total becomes 24.20 euros, so it is not related 
> to the exempt.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10500) Tax calculation incorrect when creating orders

2018-11-24 Thread Ankush Upadhyay (JIRA)


[ 
https://issues.apache.org/jira/browse/OFBIZ-10500?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16697808#comment-16697808
 ] 

Ankush Upadhyay commented on OFBIZ-10500:
-

[~FrankH],

I tried to replicate the issue reported in ticket description with following 
data:

{code}


 

 

 

 







{code}
And VAT is recorded correctly in OrderAdjustment.amountAlreadyIncluded field. 
Also actual product price and VAT applied is recorded in Order Invoice.
Please review attached screenshots.
 !VAT.png! 
 !Invoice.png! 

 

> Tax calculation incorrect when creating orders
> --
>
> Key: OFBIZ-10500
> URL: https://issues.apache.org/jira/browse/OFBIZ-10500
> Project: OFBiz
>  Issue Type: Bug
>  Components: order
>Affects Versions: Release Branch 16.11
> Environment: OpenJDK 1.8.0_151 64bit on Ubuntu 16.04
>Reporter: Frank Herrman
>Assignee: Ankush Upadhyay
>Priority: Major
> Attachments: Invoice.png, Schermafbeelding 2018-07-30 om 
> 10.15.51.png, Schermafbeelding 2018-07-30 om 10.16.16.png, VAT.png
>
>
> After a 
> [discussion|https://lists.apache.org/thread.html/adf568edad92255340697f78ea4f34a07e328cc1689b8fb73e16fa53@%3Cuser.ofbiz.apache.org%3E]
>  on the user mailinglist we concluded there seems to be an issue with the tax 
> calculations.
> *Steps to reproduce*
>  * Create a tax authority for a specific country (e.g. The Netherlands in my 
> case)
>  * Set sales tax rate of 21% for your store with this Tax Authority
>  * Create a product and enter a price either including or excluding taxes and 
> set the corresponding flag for tax included y/n.
>  * Go to the order manager and order entry. Fill in the details, select the 
> product and go to the review page. It now shows the incorrect sales tax and 
> price.
> Let's say we have a product of 20 euro incl. taxes. With 21% that comes down 
> to 3.47 euro of taxes and a price of 16.53 euro. Instead Ofbiz shows a price 
> of 20 euro excl. taxes and adds 4.20 euros in taxes.
> *What I tried*
> Changing the price to price excl. VAT and set the flag to 'N' and visa versa. 
> Both gave the same error. 
> *Possible solution*
> I digged into the code and ended up in the file:
> {{ applications/order/groovyScripts/entry/OrderReadHelper.java}}
> The function in line 2401
> {code:java}
> public static BigDecimal getOrderItemSubTotal(GenericValue orderItem, 
> List adjustments, boolean forTax, boolean forShipping){code}
> returns the price of one item there. It uses this piece of code:
> {code:java}
> orderItem.getBigDecimal("unitPrice");{code}
> The line item is always the price including taxes. When I adjust this price 
> (by dividing it by 1.21) I do get the correct price in the review page. I do 
> not, however, get the right tax amount. This is calculated elsewhere and 
> still using the 20 euro price I guess. Anyway, it does show I was in the 
> right spot.
> I'm not familiar enough with Ofbiz to create a full patch, but I think the 
> easiest way to go is to add another column to order items where the value 
> excl. taxes is stored which can be used in places where needed. This does not 
> affect the whole system. On the other hand I'm not sure where the order items 
> are stored, since when you are on the review page it is not stored in 
> database yet. Probably just in the session? Should make things even easier.
> The attachments show an example. I have stored a product of 20 euro 
> (screenshot directly taken from the database tool) and I have set-up a tax 
> exempt in this case for a customer which shows 4.20 euro sales tax. If I turn 
> off the tax exempt the grand total becomes 24.20 euros, so it is not related 
> to the exempt.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (OFBIZ-10500) Tax calculation incorrect when creating orders

2018-08-06 Thread Frank Herrman (JIRA)


[ 
https://issues.apache.org/jira/browse/OFBIZ-10500?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16570076#comment-16570076
 ] 

Frank Herrman commented on OFBIZ-10500:
---

[~sharan], it seems related, but not the same. Issue #7138 is more of a feature 
request where my question is a bug. The calculation is simply wrong. To me it 
seems the VAT/Sales tax functionality was originally developed with the US 
market in mind. Then in the past there has been an update  which supports most 
other countries, including European as well. Still this does not completely 
feels like a solid solution. You can set tax rates per product and per tax 
authority which is connected to a region, but in a lot of cases it doesn't work 
as expected. From my point of view it should work similar to software like 
Magento:
 * Define the different tax rates (in The Netherlands that would be 6% (food, 
books etc) or 21% (all other)).
 * For each product select which rate to use. When a tax rate changes (e.g., 
21% used to be 19% a couple of years ago), you simply change the rate and all 
products attached to it will be updated as well.
 * When entering a price of a product, enter the price including or excluding 
taxes and flag it accordingly. This is already in place in Ofbiz, but seems not 
to be working correctly everywhere (at least not in the order management/entry 
screen, that is my issue)
 * Per country select the tax authority. One authority can have multiple 
countries (if you sale from The Netherlands you pay taxes in The Netherlands, 
no matter to whom you are selling)
 * Per party you should have a possibility to override this
 * Per party you should also have the possibility to check a box for a VAT 
exempt

It seems to be working for all scenarios described here:

https://cwiki.apache.org/confluence/display/OFBIZ/VAT

> Tax calculation incorrect when creating orders
> --
>
> Key: OFBIZ-10500
> URL: https://issues.apache.org/jira/browse/OFBIZ-10500
> Project: OFBiz
>  Issue Type: Bug
>  Components: order
>Affects Versions: Release Branch 16.11
> Environment: OpenJDK 1.8.0_151 64bit on Ubuntu 16.04
>Reporter: Frank Herrman
>Priority: Major
> Attachments: Schermafbeelding 2018-07-30 om 10.15.51.png, 
> Schermafbeelding 2018-07-30 om 10.16.16.png
>
>
> After a 
> [discussion|https://lists.apache.org/thread.html/adf568edad92255340697f78ea4f34a07e328cc1689b8fb73e16fa53@%3Cuser.ofbiz.apache.org%3E]
>  on the user mailinglist we concluded there seems to be an issue with the tax 
> calculations.
> *Steps to reproduce*
>  * Create a tax authority for a specific country (e.g. The Netherlands in my 
> case)
>  * Set sales tax rate of 21% for your store with this Tax Authority
>  * Create a product and enter a price either including or excluding taxes and 
> set the corresponding flag for tax included y/n.
>  * Go to the order manager and order entry. Fill in the details, select the 
> product and go to the review page. It now shows the incorrect sales tax and 
> price.
> Let's say we have a product of 20 euro incl. taxes. With 21% that comes down 
> to 3.47 euro of taxes and a price of 16.53 euro. Instead Ofbiz shows a price 
> of 20 euro excl. taxes and adds 4.20 euros in taxes.
> *What I tried*
> Changing the price to price excl. VAT and set the flag to 'N' and visa versa. 
> Both gave the same error. 
> *Possible solution*
> I digged into the code and ended up in the file:
> {{ applications/order/groovyScripts/entry/OrderReadHelper.java}}
> The function in line 2401
> {code:java}
> public static BigDecimal getOrderItemSubTotal(GenericValue orderItem, 
> List adjustments, boolean forTax, boolean forShipping){code}
> returns the price of one item there. It uses this piece of code:
> {code:java}
> orderItem.getBigDecimal("unitPrice");{code}
> The line item is always the price including taxes. When I adjust this price 
> (by dividing it by 1.21) I do get the correct price in the review page. I do 
> not, however, get the right tax amount. This is calculated elsewhere and 
> still using the 20 euro price I guess. Anyway, it does show I was in the 
> right spot.
> I'm not familiar enough with Ofbiz to create a full patch, but I think the 
> easiest way to go is to add another column to order items where the value 
> excl. taxes is stored which can be used in places where needed. This does not 
> affect the whole system. On the other hand I'm not sure where the order items 
> are stored, since when you are on the review page it is not stored in 
> database yet. Probably just in the session? Should make things even easier.
> The attachments show an example. I have stored a product of 20 euro 
> (screenshot directly taken from the database tool) and I have set-up a tax 
> exempt in this case for a customer which shows 4.20 

[jira] [Commented] (OFBIZ-10500) Tax calculation incorrect when creating orders

2018-08-06 Thread Sharan Foga (JIRA)


[ 
https://issues.apache.org/jira/browse/OFBIZ-10500?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16570057#comment-16570057
 ] 

Sharan Foga commented on OFBIZ-10500:
-

Hi [~FrankH] I did a quick search for VAT in Jira and found OFBIZ-7138.It has a 
similar issue to what you need to solve. I'm wondering if we should take a look 
at all the other VAT related JIRAs to see if we can consolidate them to get a 
fixed set of requirements. Thoughts?

> Tax calculation incorrect when creating orders
> --
>
> Key: OFBIZ-10500
> URL: https://issues.apache.org/jira/browse/OFBIZ-10500
> Project: OFBiz
>  Issue Type: Bug
>  Components: order
>Affects Versions: Release Branch 16.11
> Environment: OpenJDK 1.8.0_151 64bit on Ubuntu 16.04
>Reporter: Frank Herrman
>Priority: Major
> Attachments: Schermafbeelding 2018-07-30 om 10.15.51.png, 
> Schermafbeelding 2018-07-30 om 10.16.16.png
>
>
> After a 
> [discussion|https://lists.apache.org/thread.html/adf568edad92255340697f78ea4f34a07e328cc1689b8fb73e16fa53@%3Cuser.ofbiz.apache.org%3E]
>  on the user mailinglist we concluded there seems to be an issue with the tax 
> calculations.
> *Steps to reproduce*
>  * Create a tax authority for a specific country (e.g. The Netherlands in my 
> case)
>  * Set sales tax rate of 21% for your store with this Tax Authority
>  * Create a product and enter a price either including or excluding taxes and 
> set the corresponding flag for tax included y/n.
>  * Go to the order manager and order entry. Fill in the details, select the 
> product and go to the review page. It now shows the incorrect sales tax and 
> price.
> Let's say we have a product of 20 euro incl. taxes. With 21% that comes down 
> to 3.47 euro of taxes and a price of 16.53 euro. Instead Ofbiz shows a price 
> of 20 euro excl. taxes and adds 4.20 euros in taxes.
> *What I tried*
> Changing the price to price excl. VAT and set the flag to 'N' and visa versa. 
> Both gave the same error. 
> *Possible solution*
> I digged into the code and ended up in the file:
> {{ applications/order/groovyScripts/entry/OrderReadHelper.java}}
> The function in line 2401
> {code:java}
> public static BigDecimal getOrderItemSubTotal(GenericValue orderItem, 
> List adjustments, boolean forTax, boolean forShipping){code}
> returns the price of one item there. It uses this piece of code:
> {code:java}
> orderItem.getBigDecimal("unitPrice");{code}
> The line item is always the price including taxes. When I adjust this price 
> (by dividing it by 1.21) I do get the correct price in the review page. I do 
> not, however, get the right tax amount. This is calculated elsewhere and 
> still using the 20 euro price I guess. Anyway, it does show I was in the 
> right spot.
> I'm not familiar enough with Ofbiz to create a full patch, but I think the 
> easiest way to go is to add another column to order items where the value 
> excl. taxes is stored which can be used in places where needed. This does not 
> affect the whole system. On the other hand I'm not sure where the order items 
> are stored, since when you are on the review page it is not stored in 
> database yet. Probably just in the session? Should make things even easier.
> The attachments show an example. I have stored a product of 20 euro 
> (screenshot directly taken from the database tool) and I have set-up a tax 
> exempt in this case for a customer which shows 4.20 euro sales tax. If I turn 
> off the tax exempt the grand total becomes 24.20 euros, so it is not related 
> to the exempt.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)