Shopping Cart Calculation Behavior

 Objective
As incredible as it may seem, the calculation behavior excluding VAT and including VAT doesn't provide the same results according to the location where the numbers are rounded off!

This strange phenomenon is the result of the mathematical rule "the sum of the parts is not equal to the whole" (or "the sum of the rounded numbers is not equal to the rounded number of the sum"). This may be surprising, but good common sense allows us to observe that this is a common phenomenon. Anyone who's ever played Belote has applied this rule in their lifetime. The game consists of 162 points, and we round to 10 when we count. If one team has 96 points and the other has 66 points, we round these numbers off to 100 and 70. When added together, the total is 170. However, if you round off 162 (the sum of 96 + 66), you get 160!
 
 Calculation Example Excluding VAT
Let's look at a product that costs 3 GBP (Excl. VAT). When a professional customer buys 1000 units, that comes to 3,000 GBP (Excl. VAT). They pay a VAT of 17.5% on 3,000 GBP (Excl. VAT), or 525 GBP. Therefore, the total including VAT is 3,525 GBP (Incl. VAT).

Elements Price Qty.  Total Price
My item for sale
(Code: XYZ)
3.00 GBP 1000 3,0000.00 GBP
Subtotal: 3,000.00 GBP
Sales Tax
VAT 525.00 GBP
Total Price: 3,525.00 GBP
 
 Calculation Example Including VAT
This same product is now sold to a nonprofessional customer. The prices are displayed Including VAT. 3 GBP (Excl. VAT) x 1.175 gives you 3.525 GBP (Incl. VAT), or 3.53 GBP (Incl. VAT) by rounding to the second decimal place. If the customer buys 1000 products, the total will be 3,530 GBP (Incl. VAT)!

Elements Price Qty.  Total Price
My item for sale
(Code: XYZ)
3.53 GBP 1000 3,530.00 GBP
Subtotal: 3,530.00 GBP
Total Price: 3,530.00 GBP
 
 2 Dynamic Calculation Methods
The Actinic system integrates 2 distinct calculation methods depending on whether the customer's products are proposed Including VAT or Excluding VAT. These methods are dynamically replaced when, in a shop displaying prices including VAT, the customer declares that they are a foreign customer at the time of payment, and are therefore not subject to the VAT.

Of course, in most cases, the calculations are symmetric and there are only a few particular cases, like the one previously mentioned (small price leading to a considerable price difference when multiplied by a large quantity), where differences appear.

Example excluding VAT with a standard product
Elements Price Qty.  Total Price
My item for sale
(Code: XYZ)
120.00 GBP 1 120.00 GBP
Subtotal: 120.00 GBP
Sales Tax
VAT 21.00 GBP
Total Price: 141.00 GBP


Example including VAT with a standard product
Elements Price Qty.  Total Price
My item for sale
(Code: XYZ)
141.00 GBP 1 141.00 GBP
Subtotal: 141.00 GBP
Total Price: 141.00 GBP


With this double calculation method, you can be sure that each order acknowledgment is "correct", that is to say that the numbers that are displayed will have the same results if the customer takes a calculator and recalculates the prices.
 
 Problem With "Correct" Prices Including VAT
In numerous cases, if you sell your products Incl. VAT, you want to display round numbers, such as 15.00 GBP, 30.00 GBP, or 100.00 GBP.

The problem with this is that if you have a price Excl. VAT with 2 decimal places, then it is sometimes impossible to get a round number. Let's take the example of 15.00 GBP.

If you take 12.76 GBP as the amount Excl. VAT and you multiply it by the VAT (17.5%), you get 14.993, which rounds off to 14.99!

If you take 12.77 GBP as the amount Excl. VAT and you multiply it by the VAT, you get 15.00475, which rounds off to 15.01!

The only solution is to use an amount Excl. VAT with 3 decimal places, or 12.766 GBP (Excl. VAT), which gives you 15 GBP (Incl. VAT) when you round off to 2 decimal places (Incl. VAT).

This is an excellent solution which, in most cases, gives this type of result:

Elements Price Qty.  Total Price
My item for sale
(Code: XYZ)
15.00 GBP 100 1,500.00 GBP
Subtotal: 1,500.00 GBP
Total Price: 1,500.00 GBP


However, it has its VAT exclusive counterpart (foreign customer, or professional customer).

Indeed, the price Excl. VAT has 3 decimal places (12.766 GBP).

If the customer orders a single product, this additional decimal place isn't consequential. On the other hand, as soon as this number with three decimal places is multiplied by a large number, the third decimal place will start to affect the outcome. This point is illustrated in the following order:

Elements Price Qty.  Total Price
My item for sale
(Code: XYZ)
12.76 GBP 100 1,276.60 GBP
Subtotal: 1,276.60 GBP
Sales Tax
VAT 223.41 GBP
Total Price: 1,500.01 GBP


As you can see, there is no way for the customer to understand how 12.76 x 100 = 1276.60! The only solution would be to display the 3 decimal places, but this isn't acceptable. Of course, this is a special case, but it merits a bit of reflection.
 

Add to favorites: http://www.oxatis.co.uk/Help/HelpCenterContent.asp?ActionID=512&TID=1226&MID=9000%7C55319&LangID=1
© 2001-2018 Oxatis. All rights reserved.