Post by John_Ploeg » Tue Dec 01, 2015 9:41 pm

Hello,
At this time we are configuring a new OpenCart webshop. (V 2.0.3.1)
In our shop we sell products with a high VAT rate (21%) and products with a low VAT rate (6%)
Also we need VAT in our shipment costs
We work with a FLAT rate shipping. The buyer always pays 3.95 (incl VAT)

1) When the buyer sells products with a low VAT rate then we need also low VAT rate in the shipping.
2) When the buyer sells products with a high VAT rate then we need also high VAT rate in the shipping.
3) When the buyer sells products with combined VAT rates then we need high VAT rate in the shipping.

in case 1 the shipments costs excl. VAT are 3.95/1.06 = 3.72641 --> with VAT 3,95
in case 2 and 3 the shipments costs excl. are 3.95/1.21 = 3.26446 --> with VAT 3,95

Now the question is: how to get this functionality into the shop..??

Newbie

Posts

Joined
Tue Dec 01, 2015 9:28 pm

Post by villagedefrance » Tue Dec 01, 2015 11:50 pm

Ok, I don't really have an answer to this but I am intrigued.

Shipping is usually a service, so the VAT for services should apply. In the UK it is 20%, so I just apply 20% to my shipping costs. Thats it. I don't have to calculate a variable rate according to the products being sold.

If you are in Europe and wish to get a proper EU tax law extension, try to get in touch with OSWorx.

Image
OpenCart custom solutions @ https://villagedefrance.net


User avatar
Active Member

Posts

Joined
Wed Oct 13, 2010 10:35 pm
Location - UK

Post by Johnathan » Wed Dec 02, 2015 12:31 am

OpenCart only supports a single tax class for a shipping cost, and that tax class is determined by your shipping method. So you should contact whoever wrote your shipping extension, and see if they can add the logic that you want.

If it's one of the built-in shipping methods, then you could replace it with one of mine, which support combined tax classes like you describe. (They automatically take the highest tax_class_id, but I can tell you how to take the lowest one if your higher-cost rate has a lower id.) For a flat rate shipping extension for different products, you'd want to get this extension:

• Category & Product-Based Shipping

Feel free to take a look at the screenshots and demo site, and if you're interested let me know at www.getclearthinking.com/contact if you have any further questions.

Image
Image Image Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by vegtrading » Mon Jul 16, 2018 9:50 pm

I know its an old post but did this get a solution? We need the "combined rate" from the question (since it will include the other single VAT options also).

Some line of code that change the VAT shipping calculation.
[Actual paid product VAT/Shipping VAT] = ([Value of products with A VAT]*[VAT A] + [value of products with B VAT]*[VAT B])/[Total product value]

Brgs,
David

Newbie

Posts

Joined
Mon Jul 16, 2018 9:41 pm

Post by Johnathan » Tue Jul 17, 2018 11:10 pm

My previous post still applies, but if you need to tax partial shipping costs for individual items, that's not possible due to how complicated it is. If that's what you need, you're probably going to need to hire someone to write a custom modification for you.

If you need to find a developer, you should post a request in the OpenCart "Commercial Support" forum, which is checked by a number of OpenCart developers. You can also try checking out the OpenCart "Partners" area.

Image
Image Image Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by vegtrading » Wed Jul 18, 2018 1:52 am

Thank you! I did not expect such fast respons :-)

I think perhaps I was unclear (or I read your answer wrong). The only thing that need to combine is the VAT for shipping not per item. That should be a fairy easy calculation.

In our case:
VAT12 = Total VAT payed for all items with 12 % VAT.
VAT25 = Total VAT payed for all items with 25 % VAT.
The shipping VAT should then be a value weighted calculated VAT, just like in the original example. The actual VAT payed total for all items.

A piece of candy 1$ at 12 % VAT -> total cost 1.12 $ and VAT12=0.12$
A pencil 1$ at 25 % VAT -> total cost 1.25$ and VAT = 0.25$
A paper 1$ at 25 % VAT -> total cost 1.25$ and VAT = 0.25$
VAT12 = 0.12 and VAT25 = 0.5
Total cost of products 3$ and total VAT payed 0.62$, the shipping VAT for the package sending the candy and the pencil together is 0.62/3 = 20.67 %.

If shipping is 1$ then the total payed will be 1.12+1.25+1.25+1.21 = 4.83$ and the total VAT 0.83$

In Zencart it was a matter of less than 10 lines of code. I looked at the code for VAT, cart/checkout and Shipping and it does not look impossible (but I have too bad grasp of the opencart structure (and perhaps PHP)) to make the change myself.

But I do hear what you say about commercial support (I actually started by asking our main mod supplier, but due to almost the same misunderstanding I tried here instead).

Brgs,
David

Newbie

Posts

Joined
Mon Jul 16, 2018 9:41 pm

Post by Johnathan » Wed Jul 18, 2018 8:54 pm

Total cost of products 3$ and total VAT payed 0.62$, the shipping VAT for the package sending the candy and the pencil together is 0.62/3 = 20.67 %.

Is this really how your VAT is calculated for shipping? I've never heard of such a system. Which country is this for?

In OpenCart, all taxes need to be set up as a tax rate and a tax class. Shipping costs only get a tax_class_id, which wouldn't be possible with your method of calculation, so you'd definitely need to modify OpenCart to make this calculation. You probably want to modify how the "Taxes" line item calculates itself, which would be in this file:

/catalog/model/total/tax.php
or
/catalog/model/extension/total/tax.php

Image
Image Image Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am

Who is online

Users browsing this forum: No registered users and 4 guests