This section describes how VAT is calculated for the order.
VAT (Value Added Tax) calculation is done based on the rules defined by the tax department. The default implementation comply with the tax rules of Sweden. For any other country, these rules may differ and therefore the VAT calculation might need modifications. The default implementation of the VAT calculation can be changed in the pricing rules plugin.
VAT components in order grand total
The following items in an order contain a component of VAT:
- Order rows: VAT for individual items purchased.
- Delivery: VAT for delivery service.
- Fees: VAT for other services which resulted in the fee.
- Discounts: VAT reduction as a result of the discount.
Calculating order row VAT
The order row VAT is calculated as:
VAT amount = (Unit List Price x Quantity - Order Row Total Discount) x VAT Percentage
If a campaign is applied, the order row might have a special campaign price, called UnitCampaignPrice. In that case, the formula used will contain the unit campaign price instead of the unit list price, like this:
VAT amount = (Unit Campaign Price x Quantity - Order Row Total Discount) x VAT Percentage
The VAT percentage above is determined by the TAX department for the types of items sold. In Sweden, for most articles this is 25%. But there are special reduced tax catagories, for example 12% for food and 6% for printed material such as books.
The VAT percentages for different tax classes is configured back office > Settings. More info on how to define the tax classes is here.
In the Products area you set a tax class for the article. The tax class will apply to all variants of the article:
- Go to Products > select an article > Edit.
- Select the Price tab and then select a tax class in the Tax class drop-down.
You can choose to display the price including or excluding VAT in the product lists:
- Click Pricelist in the Products area and double click a price list.
- Select Yes or No for Include VAT.
VAT on delivery and fees
VAT on delivery and fees is calculated as a weighted average percentage, based on the VAT amounts on the order rows. This is in accordance with the Swedish VAT regulations as of September 2002. Please refer to the following pages on the Swedish Tax Agency's website (in Swedish):
The calculation formula is best understood using an example:
Example 1:
In the above example, the order contains two items, with two different VAT percentages. Goods with the unit price 100, 25% VAT and printed material worth 100 with 6% VAT. It has a delivery cost of 100 before VAT and fees of 100 before VAT. Also it has a campaign discount of 100 after VAT, and an order discount of 100 after VAT. (These fields are shown in bold font.)
The weighted average VAT percentage for delivery cost, fees and discounts is 15.50%. It is calculated as 31 / 200 , where 31 is the total order row VAT, and 200 is the order row total before VAT.
Example 2: Now, let's double the quantity field and observe that the weighted average VAT percentage does not change.
The weighted average VAT % = 62 / 400 = 15.50%.
Example 3: Observe how the weighted average VAT percentage changes if we change the composition of the items bought. Say we buy 3 items from printed material and 1 item from goods.
The weighted average VAT % = 43 / 400 = 10.75%.
Note that order row total without VAT is still 400, but there is less VAT because of 6% VAT for the printed material. This results in a proportionate VAT reduction of the delivery cost and fee VAT. They are reduced from 15.50 to 10.75, even though the delivery cost without VAT remained constant at 100.
Calculation of VAT for discounts is similar to fees and deliveries. It uses the same weighted average VAT percentage explained above.
However, unlike fees and deliveries, order level discounts are specified with VAT. So, the total discount amount does not change. But, the VAT amount included in the discount will change.
Note in example 1, 2 and 3 above, the order level discount with VAT remains at 100. However, in example 3 the amount of VAT included is 9.71 which is less than 13.42 as in example 2.
Implications of VAT for discounts
When a merchant gives an order level discount (e.g.: X amount off campaign), the actual cost to the merchant would be the amount without VAT. This is because VAT is recoverable for the merchant.
Therefore, in example 2 above, the real campaign discount cost for the merchant is 86.58, while in example 3 it is 90.29.