I’m in the process of creating a checkout / shopping cart process for a relatively scenario and would like to check if someone has done this before and what the best or rather financially (tax) correct method is to calculate the VAT and discounts to be tax compliant.
It’s not about the actual programming code but more about the correct sequence or logic that should be followed to be financially correct.
To start with we have ‘Passes’ that allow clients to attend sessions based on the pass ‘credits’ Clients can buy this passes in as standalone items or in ‘packs’. Packs are purely a ‘collection’ or Product / Pass combinations and ONLY has a sales value. VAT for packs is based on the items within the pack. They can also have Promotion Codes that can be applied to a specific product or to the cart value.
There’s also ‘Products’ that can be purchased.
NOTE: All the prices are inclusive of VAT
**So Passes:**
1 - Pass 1 - has 1 credit and price is $25 - vat is 9%
2 - Pass 2 - has 5 credits and price is $100 - vat is 9%
3 - Pass 3 - has 10 credits and price is $180 - vat is 9%
4 - Pass 4 - has 20 credits and price is $340 - vat is 9%
**Products**
1 - Product 1 - price $15 - vat 15%
2 - Product 2 - price $70 - vat 15%
3 - Product 3 - price $11 - vat 9%
**Packs**
1 - Pack 1 - consist of **Pass 1 and Product 1** - price $110
2 - Pack 2 - consist of **Pass 2 and Product 2** - price $165
**Promo Codes**
1 - Promo 1 - ONLY valid on Pass 2 - value 5% of item value
2 - Promo 2 - valid on cart total - value 5% of cart value
Here's 2 sample carts:
**Cart 1**
1 x Pass 3 @ 180 (this is @ 9% VAT inclusive)
1 x Pack 2 @ 165 (this has 2 items with 9% and 15% VAT)
Client added Promo Code 1 (promo is only valid for Pass 2 which is part of the Pack)
**Cart 2**
1 x Product 2 @ $8 (this is @ 15% VAT inclusive)
1 x Pack 1 @ $110 (this has 2 items with 9% and 15% VAT)
1 x Pass 2 @ $100 (this is @ 9% inclusive)
1 x Product 3 @ $11 (this is @ 9% inclusive)
Client added Promo Code 2 (promo code is valid for the total cart value)
So the question is how to 1) apply the discounts for the promo codes entered, 2) calculate the discounts.
As you can see from the data above, a Pack is essentially 1 or more products and has a combined selling value for the items in that pack – ie. a discounted value for the items but at a pack level, and the VAT is inclusive so in order to calculate the VAT in a pack you have to pro-rate the actual selling price of the item within the pack then apply the tax/vat. Add to that the promo coupon and the question is what calculation comes first and do you pro-rate @ the inclusive price level or at the exclusive price level? And for the promo at cart level do you now pro-rate ALL the items in the cart or can you apply the discount of subtotal level which will mean your tax breakdown will be incorrect??
I’m sure there must be a specific sequence this needs to be done at in order to be VAT / TAX compliant but I don’t seem to find anything online that describes the sequence or process of how this should be done.
Will be interesting to see as I have discussed with multiple people and I seem to be getting conflicting approached to do this 🙂
Thanks in advance for your views and comments.