Problem with different Taxes for products

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
izaquieltome
Posts: 9
Joined: 19 Mar 2019, 06:54

Problem with different Taxes for products

Post by izaquieltome » 14 Sep 2023, 13:06

Hello guys,

I am facing the following problem:
I am setting up a Shop for an austrian vineyard. Now as by law we have to configure the shop so it uses the taxes of the delivery-countries - so far so good.

Now I figured out, there is a Plugin "tax rates", where I can configure a Tax Rate like this:

country-taxrates : {"AT":"20","DE":"19","IT":"22","NL":"21","DK":"25","BE":"21","FR":"20","EE":"20","FI":"24","HR":"25","HU":"27","PL":"23","SE":"25","SI":"22","SK":"20","BG":"20","CZ":"21"}

Till this point it all works perfectly.
Now my problem:
In Austria we have different Tax-Rates for different kinds of products.
So we have 20% and 13% - which both use the same taxrates fr foreign countries.

So, a possible configuration should look like this:
country-taxrates : {"AT":"20","DE":"19","IT":"22","NL":"21","DK":"25","BE":"21","FR":"20","EE":"20","FI":"24","HR":"25","HU":"27","PL":"23","SE":"25","SI":"22","SK":"20","BG":"20","CZ":"21"}

country-taxrates : {"AT":"13","DE":"19","IT":"22","NL":"21","DK":"25","BE":"21","FR":"20","EE":"20","FI":"24","HR":"25","HU":"27","PL":"23","SE":"25","SI":"22","SK":"20","BG":"20","CZ":"21"}

Then we have a tax-rate of 0% for gift-cards - because you can use them on every kind of product, which brings the "Problem" that you can't define the tax beforehand.
so, there would be a third config like:
country-taxrates : {"AT":"0","DE":"19","IT":"22","NL":"21","DK":"25","BE":"21","FR":"20","EE":"20","FI":"24","HR":"25","HU":"27","PL":"23","SE":"25","SI":"22","SK":"20","BG":"20","CZ":"21"}
(and maybe it also hsas to be 0% for other countries).

But here's the Thing: as long as I just use one config - all perfect.
If I try to add another - nothing works. I even can't save a second taxrates configuration.

If i "exclude" Austria from that list - it also changes taxes in the basket - BUT in the case one switches from like Germany to Austria as delivery-Country - the foreign Tax stays - ehich is not a perfecxt thing.

So - Is there any way I can fix this? Help much appreciated.

My System: Aimeos 23.07.1 for Typo3 12 and PHP 8.2

Best regards and thanks in advance,
Iza

User avatar
aimeos
Administrator
Posts: 8169
Joined: 01 Jan 1970, 00:00

Re: Problem with different Taxes for products

Post by aimeos » 15 Sep 2023, 06:03

How it "should" work if there's no bug:

country-taxrates configuration:
[code{"DE":"19","IT":"22","NL":"21","DK":"25","BE":"21","FR":"20","EE":"20","FI":"24","HR":"25","HU":"27","PL":"23","SE":"25","SI":"22","SK":"20","BG":"20","CZ":"21"}[/code]

Don't configure a tax rate for your own country (AT) to use the tax rate entered along with the price (0%, 13% or 20%). In that case, the tax rate shoudn't be changed if customers enter an AT address.

The problem of switching countries during the checkout process might be solved by adding "setAddress.after" here:
https://github.com/aimeos/aimeos-core/b ... ce.php#L97

The only thing that is really hard to solve is if other countries also have several tax rates that must be used for different kinds of products because then, it's not clear when which tax rate must be used.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

izaquieltome
Posts: 9
Joined: 19 Mar 2019, 06:54

Re: Problem with different Taxes for products

Post by izaquieltome » 20 Sep 2023, 11:52

Thanks for your anwser.

I will try this with the "setAddres.after" :)

When I look at Shop-Systems like PrestaShop e.g. they have features for "Tax rates" - which means you define sets of Tax-Rates for Countries (like the country-taxrates configuration in aimeos) as Datasets - which are applied to a product - not as aimeos does with simple Integer Values.


Maybe this could be a Feature-Request?
Because this would make Aimeos way more flexible for Shops with international Shippings (espacially within the EU).

izaquieltome
Posts: 9
Joined: 19 Mar 2019, 06:54

Re: Problem with different Taxes for products

Post by izaquieltome » 07 Nov 2023, 09:20

As the project came to pause for a while but now is goinig on, I have a new information about the tax-system.

All products have the same Tax in the foreign countries - they only differ in Austria (why soever) except one:
gift cards in the shop are ALWAYS (and for all countries) with 0% tax - and apply when they get used on the total amount of the basket including the tax.

So I would need at least a second tax-group for this one.
As said - every other Shop System I know works with defined Tax-Sets with a base Tax and additional taxes based on country.
This would be a huge addition to aimeos - cause I know that not only austria, but also germany uses different Taxes on different product types. And as in austria - in Germany gift cards also have to be with 0% tax when not specified for which kind of product they can be used.

User avatar
aimeos
Administrator
Posts: 8169
Joined: 01 Jan 1970, 00:00

Re: Problem with different Taxes for products

Post by aimeos » 10 Nov 2023, 08:25

In fact, Aimeos is already supporting different tax rates per price but they are cumulative at the moment (e.g. for state and country taxes). We have to see how we can use that for those setups too.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

izaquieltome
Posts: 9
Joined: 19 Mar 2019, 06:54

Re: Problem with different Taxes for products

Post by izaquieltome » 29 Jan 2024, 08:12

I guess there is still no solution to this.

As I am not the biggest programmer, a question to make this for my shop happen (Because: A Voucher could be bought by someone in Sweden - but could be used by someone in Germany or at the local store in Austria - and we in astria have to add taxes when it's used, not bought).

Where do I adapt the Code, to make like a IF/ELSE part, to say "if product has 0% Tax, stay with 0%" and "if tax is higher than 0, apply tax-rate rules". Any suggestions for this?

Thanks in Advance :)

User avatar
aimeos
Administrator
Posts: 8169
Joined: 01 Jan 1970, 00:00

Re: Problem with different Taxes for products

Post by aimeos » 30 Jan 2024, 08:49

Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply