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

[RFC][Core][Taxation] Allow configuration of which address to use to match the tax zone #10946

Closed
vvasiloi opened this issue Dec 16, 2019 · 14 comments
Labels
Do not stale Important issues and PRs, that should not be stalled by Stale Bot Feature New feature proposals.

Comments

@vvasiloi
Copy link
Contributor

vvasiloi commented Dec 16, 2019

The OrderTaxesProcessor uses the shipping address to match the tax zone

$shippingAddress = $order->getShippingAddress();
$zone = null;
if (null !== $shippingAddress) {
$zone = $this->zoneMatcher->match($shippingAddress, Scope::TAX);
}

and falls back to the default tax zone
return $zone ?: $this->defaultTaxZoneProvider->getZone($order);

In most cases it works well because usually the shipping and billing addresses yield the same tax zone.
There are situation though, when this creates issues, especially in markets like US or EU.

I'm not sure wherever it should always use the billing address, but it should at least be configurable.
Having a strategy pattern with at least two built-in implementations to handle the tax zone matching, one that uses the billing address and another that uses the shipping address, plus configuration at the channel level will bring more flexibility and will allow more specific customizations without overriding the OrderTaxesProcessor just because of a private method.

Looking forward to other thoughts on this matter.

@lchrusciel lchrusciel added the Feature New feature proposals. label Jan 8, 2020
@stale
Copy link

stale bot commented Apr 7, 2020

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale Issues and PRs with no recent activity, about to be closed soon. label Apr 7, 2020
@lchrusciel lchrusciel added the Do not stale Important issues and PRs, that should not be stalled by Stale Bot label Apr 7, 2020
@stale stale bot removed the Stale Issues and PRs with no recent activity, about to be closed soon. label Apr 7, 2020
@LucaGallinari
Copy link
Contributor

Hi guys, this issue is becoming a priority due to the "new" EU VAT regulations: https://ec.europa.eu/taxation_customs/business/vat/modernising-vat-cross-border-ecommerce_en

As @vvasiloi proposed, it would be great to have a configuration on each tax rates, so that it's possible to choose if the match should be based on the shipping or the billing address.

@CoderMaggie
Copy link
Member

Firstly, I'd like to note that zone matching is for quite some time (since version 1.7) based on the billing address 💪🏼
That will be closing this issue 🔥

But as @LucaGallinari has mentioned the new EU VAT regulations, I'd like to ask if adding a setting on the channel for taxes to be based either on shipping address or billing address, would help?
Moreover, Luca, could you maybe describe how would it help you process the new regulations (I'm considering a doc on that, and your insight would be helpful 🙏🏼 )?

@vanssata
Copy link

vanssata commented May 24, 2021

Firstly, I'd like to note that zone matching is for quite some time (since version 1.7) based on the billing address 💪🏼
That will be closing this issue fire

But as @LucaGallinari has mentioned the new EU VAT regulations, I'd like to ask if adding a setting on the channel for taxes >> to be based either on shipping address or billing address, would help?

The EU does not care where you pay (billing address). They will be interested in where you use the service or product (shipping address).

Until July 1, the current law is for taxes as follows:

  • For services are charged in the country where they are used (shipping(delivery) addresses)
  • For goods (physical products) is charged in the country from which they are sent (channel address)

With the change from July 1, fees will be charged where the service/goods are used/sent (shipping(delivery) address)

@vvasiloi
Copy link
Contributor Author

vvasiloi commented May 25, 2021

Firstly, I'd like to note that zone matching is for quite some time (since version 1.7) based on the billing address 💪🏼
That will be closing this issue 🔥

Now others will complain that it's based on the billing address and not the shipping address, that's why I proposed to make it configurable.
I guess the title is misleading, because the actual request / proposal is:

Having a strategy pattern with at least two built-in implementations to handle the tax zone matching, one that uses the billing address and another that uses the shipping address, plus configuration at the channel level will bring more flexibility and will allow more specific customizations without overriding the OrderTaxesProcessor just because of a private method.

@vvasiloi vvasiloi changed the title [RFC][Core][Taxation] Use billing address to match the tax zone [RFC][Core][Taxation] Allow configuration of which address to use to match the tax zone May 25, 2021
@januzis
Copy link

januzis commented May 25, 2021

Now others will complain that it's based on the billing address and not the shipping address, that's why I proposed to make it configurable.

Agree, since at least for EU based shops selling physical goods to other EU countries, tax zone matching based on the shipping address is always preferred, with the current VAT rules, as well as with the upcoming rule changes.

With the current regulation, if remote sales are under the VAT registration threshold for the target country - no separate tax rate is even necessary, VAT must be paid in the seller's country. E.g. a german shop selling goods to Luxembourg (based on the shipping address), but not more than 100 000 EUR a year, pays german VAT on sales.

With the new regulation, the threshold drops down to 10 000 EUR (EU-wide, not for a single country), so more shops will be over that limit. Using the same example, a german shop selling goods to Luxembourg (based on the shipping address), more than 10 000 EUR a year, will have to pay 17% Luxembourg VAT.

I'm not even sure what is the scenario, where tax zone matching based on the billing address is necessary, maybe when selling non-physical goods, or services? Could someone provide an example?

Either way, configurable tax zone matching strategy would be sensible. At least for our use case, channel-level setting would be enough.

@ikakarov
Copy link

@januzis The payment address is considered to be the address of use of the service / software. Because the service or software does not have a delivery address.

@januzis
Copy link

januzis commented May 25, 2021

@januzis The payment address is considered to be the address of use of the service / software. Because the service or software does not have a delivery address.

Thanks, that makes sense. Again, seems like the proposed strategy pattern already used elsewhere in Sylius would be a sensible solution, covering 99% of use-cases with two default strategy implementations (billing address based and shipping address based matching), and creating a nice integration point for a custom strategy implementation for more advanced use cases (mixed software / physical goods shop, etc.).

@ikakarov
Copy link

@januzis Yes. After 1-juli, sylius model is 100% correct for EU to EU trades. But in this moment big missing part is EU to GB strategy, for my case i just crate custom tax calculator.
Another big problem when use international shipping is missing custom required attribute per country.
For example i need to sell form Italy to Brazil, but need to add required BIC number for Brazilian address, or Personal Customs Clearance Code (PCCC) for south korea.

I crate simple plugin in my project, but not useful for standalone on this moment.

@januzis
Copy link

januzis commented May 25, 2021

@januzis Yes. After 1-juli, sylius model is 100% correct for EU to EU trades.

It's not correct for physical goods, it's currently matching based on the billing address, when the EU VAT rules are based on the recipient's (shipping address) country.

@ikakarov
Copy link

@januzis I agree with you. Current way is every tax in EU to get delivery address (shipping) . If you add only billing, address in checkout orders get this address for shipping. Current way is every tax to calculate only for shipping address after 1-july. From now correct way is tax for goods to calculate form channel country.

GSadee added a commit that referenced this issue Jun 23, 2021
This PR was merged into the 1.11-dev branch.

Discussion
----------

| Q               | A
| --------------- | -----
| Branch?         | master 
| Bug fix?        | no
| New feature?    | no
| BC breaks?      | not sure
| Related tickets | related to #10946
| License         | MIT

![Zrzut ekranu 2021-06-18 o 08 33 40](https://user-images.githubusercontent.com/35863747/122517317-242e4b80-d010-11eb-83ea-0173209f8935.png)
![Zrzut ekranu 2021-06-18 o 08 33 50](https://user-images.githubusercontent.com/35863747/122517321-24c6e200-d010-11eb-9846-1143be126ab8.png)


Commits
-------

ff8d727 [POC] Add change of tax by address
b05e446 Extract service
273c608 Minor fixes
ae32ed2 Rebase and fixes
d9b61b7 Add notes about new param
@vvasiloi
Copy link
Contributor Author

Fixed by #12718

@CoderMaggie
Copy link
Member

Glad we've managed to help (last minute before July 1st 😅 ) 💪🏼

I will just leave a note here that we will be looking at this topic once more, in order to provide a more "UI" solution. As now, you can reconfigure the whole application with the introduced parameter, though it would be awesome to have it configurable at least per channel.

@ikakarov
Copy link

I create very complex solution because every order in my project have two and more tax category.
My solution is:

  • Create custom tax strategy for EU tax rules after 01.07.2021.
  • Create tax zones with countries whit same rate.
  • Get tax rate based on shipping address for stocks.
  • Get tax rate based on billing address for services.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Do not stale Important issues and PRs, that should not be stalled by Stale Bot Feature New feature proposals.
Projects
None yet
Development

No branches or pull requests

7 participants