0

We have a PHP online shop which is filled with pre-tax prices - the customer has the following bill:

Beer, VAT 10%, Price 1.99 $, Amount 15

Bread, VAT 10%, Price 0.73 $, Amount 5

Wine, VAT 13%, Price 4.77 $, Amount 7

Glasses, VAT 20%, Price 7.66 $, Amount 5

Voucher, 15 % off

Shipping costs, VAT 20%, Price 5.97 $

Possibility 1: Calculate the overall before-vat price and deduct it later

a) Calculate overall for different tax rates

  1. For 10% VAT: 1.99 * 15 + 0.73 * 5 = 33.50 $
  2. For 13% VAT: 4.77 * 7 = 33.39 $
  3. For 20% VAT: 7.66 * 5 + 5.97 = 44.27 $

b) Apply voucher

  1. For 10% VAT: 33.50*0.85 = 28.48 $
  2. For 13% VAT: 33.39*0.85 = 28.38 $
  3. For 20% VAT: 44.27*0.85 = 37.63 $

c) Deduct VAT: VAT = (pre-tax price / (100 + tax rate) ) * tax rate

  1. For 10% VAT: VAT = (28.48 / (100 + 10)) * 10 = 2.59 $
  2. For 13% VAT: VAT = (28.38 / (100 + 13)) * 13 = 3.26 $
  3. For 20% VAT: VAT = (37.63 / (100 + 20)) * 20 = 6.27 $

d)

  • Final VAT = 12.12 $
  • Price after tax = 44.27 + 33.39 + 33.50 - 12.12 = 99.04 $
  • Price total = 111.16 $

Possibility 2: Calculate the price per row, deduct VAT per row

a) Calculate row prices

  1. Beer: 1.99 * 15 = 29.85 $
  2. Bread: 0.73 * 5 = 3.65 $
  3. Wine: 4.77 * 7 = 33.39 $
  4. Glasses: 7.66 * 5 = 38.30 $
  5. Shipping costs: 5.97 $

b) Apply voucher

  1. Beer: 29.85 * 0.85 = 25.37 $
  2. Bread: 3.65 * 0.85 = 3.10 $
  3. Wine: 33.39 * 0.85 = 28.38 $
  4. Glasses: 38.30 * 0.85 = 32.56 $
  5. Shipping costs: 5.97 * 0.85 = 5.07 $

c) Deduct VAT:

  1. Beer: (25.37 / (100 + 10)) * 10 = 2.31 $
  2. Bread: (3.10 / (100 + 10)) * 10 = 0.28 $
  3. Wine: (28.38 / (100 + 13)) * 13 = 3.26 $
  4. Glasses: (32.56 / (100 + 20)) * 20 = 5.43 $
  5. Shipping costs: (5.07 / (100 + 20)) * 20 = 0.84 $

d)

  • Final VAT = 12.12 $
  • Price after tax = 99.04 $
  • Price total = 111.16 $

Note: Bad example but with bad roundings the VAT could be slightly different.

Possibility 3: Calculate before-vat price per product and sum up later

a) Apply voucher + b) deduct VAT

  1. Beer: (1.99 * 0.85 / (100 + 10)) * 10 = 0.15 $
  2. Bread: (0.73 * 0.85 / (100 + 10)) * 10 = 0.06 $
  3. Wine: (4.77 * 0.85 / (100 + 13)) * 13 = 0.47 $
  4. Glasses: (7.66 * 0.85 / (100 + 20)) * 20 = 1.09 $
  5. Shipping costs: (5.97 * 0.85 / (100 + 20)) * 20 = 0.85 $

c) Calculate row tax (and usually prices but we dont need em here)

  1. Beer: 0.15 * 15 = 2.25 $
  2. Bread: 0.06 * 5 = 0.30 $
  3. Wine: 0.47 * 7 = 3.29 $
  4. Glasses: 1.09 * 5 = 5.45 $
  5. Shipping costs: 0.85 * 1 = 0.85 $

d)

  • Final VAT = 12.14 $
  • Price after tax = 99.02 $
  • Price total = 111.16 $

As you can see there is a little difference in the final VAT in example 3.

My question is: Which kind of calculation is correct? Which is incorrect and why? Which is the correct order of actions to calculate the VAT inside the checkout of an online shop (there are still different orders possible which I did not list in the example)?

This is especially important to know as I have a shop with B2B customers which see the prices excluding VAT.

Blackbam
  • 17,496
  • 26
  • 97
  • 150

1 Answers1

0

Actually each method is correct in terms of legal issues. In terms of best practice VAT should be internally calculated as precise as possible therefore calculate every value with exact floats for the whole cart.

Blackbam
  • 17,496
  • 26
  • 97
  • 150