Error in VAT exemption calculation

34 views
Skip to first unread message

Alessandro Mencarini

unread,
Feb 21, 2012, 9:13:17 AM2/21/12
to spree...@googlegroups.com
Here is the scenario where I found a problem:

Product A costs €10.00, excluded VAT. VAT in Italy is 21%, so I enter the product price as €12.10.
Now, when I ship abroad I have to take VAT off the price. Spree does a nice job but the calculation is wrong. Instead of brining the product price back to €10, it takes the 21% off €12.10, bringing the price to €9.56.

In my installation I've changed the offending lines in the DefaultTax calculator this way: https://gist.github.com/1860175

Is that the best way to achieve it? If it is let me know and I'll make a pull request.

Thanks!

Ryan Bigg

unread,
Feb 21, 2012, 9:17:20 AM2/21/12
to spree...@googlegroups.com
Sure, submit a pull request and we can look over it. I would personally move the round_to_two places lines out into another method that takes a line_item_total argument, mainly because these two lines are very close to being identical.
--
You received this message because you are subscribed to the Google Groups "Spree" group.
To view this discussion on the web visit https://groups.google.com/d/msg/spree-user/-/hiUjGVeJUWAJ.
To post to this group, send email to spree...@googlegroups.com.
To unsubscribe from this group, send email to spree-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/spree-user?hl=en.

complistic

unread,
Feb 22, 2012, 9:07:34 PM2/22/12
to spree...@googlegroups.com
I also found the same error with GST (VAT 10%)

I'm thinking that the reason fo the error is because the DefaultTax calculator is for Sales Tax and not VAT?

The correct GST equations would be:

10ex = 11inc (times by 1.1)
11inc = 10ex (divide by 1.1)
10ex = 1gst (times by 0.1)
11inc = 1gst (times by 0.11)


complistic

unread,
Feb 22, 2012, 9:15:25 PM2/22/12
to spree...@googlegroups.com
opps i made a error on that last equation..

should be:
11inc = 1gst (divide by 11)

So $11 Includes $1 GST (VAT 10%)
Reply all
Reply to author
Forward
0 new messages