Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TaxRate <--> TaxCategory relation type #1836

Closed
vladstoick opened this issue Apr 10, 2017 · 1 comment
Closed

TaxRate <--> TaxCategory relation type #1836

vladstoick opened this issue Apr 10, 2017 · 1 comment

Comments

@vladstoick
Copy link
Contributor

Background:

  • A TaxRate belongs to a TaxCategory
  • A Product/ Variant belongs to a Tax Category

Problem:

When adding multiple categories you end up duplicating a lot of tax rates as VAT is applied differently across Europe based on the TaxCategory. For instance some countries have special tax reduction for certain tax categories, while other don't. A rate must exist for each category if you want to properly apply VAT:

def rates_for_item(item)
  applicable_rates(item.order).select { |rate| rate.tax_category_id == item.tax_category_id }
end

This means that even if a tax category doesn't get a special rate for that category you still end up creating a tax rate for that category and that zone. This can lead to the creation of a lot of TaxRate even when they are not necessary as the general VAT can apply to them. This can become problematic for instance when implementing EU VAT where each country (28 at the moment) has different rules (in our (LMN) case books have a VAT of 0% in some countries, while in others they might be fully taxed or other taxes might be implemented).

Potential solution

Allow a TaxRate to have many categories if the rate is the same (the general VAT tax for instance) and make additional TaxRates required if the rate is going to be different.

@mamhoff
Copy link
Contributor

mamhoff commented Apr 10, 2017

Go for it. I see a challenge in administering this nicely in the backend, but from a data architecture standpoint this makes a whole lot of sense. 👍

vladstoick added a commit to vladstoick/solidus that referenced this issue May 23, 2017
Implements solidusio#1836

The current relation between TaxRate and TaxCategory can lead
to unnecessary tax rates if a store has multiple tax categories
and if it supports countries (such as Australia) that have a
standard tax rate. This means that for each TaxCategory, the store
will have an extra tax rate even if the percent is the same.

By transforming this relation to a M-M we can allow stores to
create tax rates that have multiple tax categories.
jordan-brough pushed a commit to Lostmyname/solidus that referenced this issue Jun 2, 2017
Implements solidusio#1836

The current relation between TaxRate and TaxCategory can lead
to unnecessary tax rates if a store has multiple tax categories
and if it supports countries (such as Australia) that have a
standard tax rate. This means that for each TaxCategory, the store
will have an extra tax rate even if the percent is the same.

By transforming this relation to a M-M we can allow stores to
create tax rates that have multiple tax categories.
vladstoick added a commit to Lostmyname/solidus that referenced this issue Aug 4, 2017
Implements solidusio#1836

The current relation between TaxRate and TaxCategory can lead
to unnecessary tax rates if a store has multiple tax categories
and if it supports countries (such as Australia) that have a
standard tax rate. This means that for each TaxCategory, the store
will have an extra tax rate even if the percent is the same.

By transforming this relation to a M-M we can allow stores to
create tax rates that have multiple tax categories.
jordan-brough pushed a commit to Lostmyname/solidus that referenced this issue Dec 12, 2017
Implements solidusio#1836

The current relation between TaxRate and TaxCategory can lead
to unnecessary tax rates if a store has multiple tax categories
and if it supports countries (such as Australia) that have a
standard tax rate. This means that for each TaxCategory, the store
will have an extra tax rate even if the percent is the same.

By transforming this relation to a M-M we can allow stores to
create tax rates that have multiple tax categories.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants