Saturday, August 8, 2015

An explanation on AutoCount GST rounding algorithm

Hi, if you have seen two lines with same amount, but GST amount may be different by 1 cent in AutoCount Accounting. Don’t worry, this is correct as it is caused by the adaptive rounding algorithm used by AutoCount Accounting. Let me explain in detail how this algorithm works in the following paragraph.
Let see the following example:
Line NoQtyUnit PriceTax %GST (Unrounded)GST (Rounded)
1113.116%0.78660.79
2113.116%0.78660.79
3113.116%0.78660.79
410.006%0.00000.00
Total339.332.37

If you calculate the GST line by line and do the rounding to 2 decimal, then the total GST of the above Invoice is 2.37, however, if you use 39.33 x 6% = 2.3598 ~= 2.36, which has 1 cent different. Since most of the time, users would use total amount x 6% to calculate their GST, so we have to resolve this potential 1 cent different issue.
In order to resolve this issue, you can apply this 1 cent to the last row of the invoice, then it will become the below example:
Line NoQtyUnit PriceTax %GST (Unrounded)GST (Rounded)
1113.116%0.78660.79
2113.116%0.78660.79
3113.116%0.78660.79
410.006%0.0000-0.01
Total339.332.36

Then the weird thing is user might ask why the last line (Line No. 4), the unit price is 0.00, but why GST is -0.01.
Then in order to resolve this 1 cent issue, we have derived a rounding algorithm called Adaptive Rounding Algorithm.
The algorithm works from top to bottom.
Line NoQtyUnit PriceTax %GST (Unrounded)Prev Unrounded TotalPrev Rounded TotalGST (Rounded)
1113.116%0.78660.78660.790.79
2113.116%0.78661.57321.570.78
3113.116%0.78662.35982.360.79
410.006%0.00002.35982.360.00
Total339.332.36

The GST of line 1 is just the rounded value of 0.7866, which is 0.79.
The GST of line 2 is Round(0.7866 + 0.7866) – [line 1 GST] = Round(1.5732) – 0.79 = 1.57 – 0.79 = 0.78.
The GST of line 3 is Round(0.7866 + 0.7866 + 0.7866) – [line 1 GST + line 2 GST] = Round(2.3598) – 1.57 = 2.36 – 1.57 = 0.79.
The GST of line 4 is Round(0.7866 + 0.7866 + 0.7866 + 0.0000) – [line 1 GST + line 2 GST + line 3 GST] = Round(2.3598) – 2.36 = 2.36 – 2.36 = 0.00.
The formula is:
Round(Sum of unrounded GST from line 1 to line n) – Sum(GST from line 1 to line n-1)
By using this rounding algorithm, line 4 will not have any GST because the unit price is 0.00, however, it may make the intermediate line has weird GST value such as line 2, which has GST value of 0.78, different from 0.79 of line 1 and line 3.
But because in the end, people tends to check GST of the whole invoice instead of individual item, so we have applied this algorithm in our calculation. In other words, as long as the total GST is correct, then users don’t worry too much about the individual GST amount.
Note: This algorithm has been accepted by Singapore Iras for many years.

No comments:

MSME Digital Grant MADANI - 1st April 2024

1st April 2024 Enquiry Email : admin@hjysolutions.com Contact No : 012-260 1655   Are You Eligible? Malaysian-Owned: MSMEs/Cooperatives must...