- last edited on: 2018-06-03
Algorithm For Calculating The Accumulation Of Sums In Tax Groups And The Current Total Sum
In Bulgarian fiscal devices, separate amounts in tax amounts accumulate separately (in different registers). Let us call the accumulated amount in tax group X "CurrentSumForVATGroupX". If the item sold on a given row is placed in tax group X, the formula for calculating the accumulation of amounts in tax groups (and within a fiscal receipt) is the following:

By "RowSumi" we mean the total sum for a given row of sales in a fiscal receipt. The algorithms for calculating and correcting "RowSumi" can be found by way of the links given down below:
- Algorithm for: calculating the sum on a given row of sales in a fiscal receipt;
- Algorithm for: calculating the corrections on a line of the sale through a percentage;
- Algorithm for: calculating corrections on a line of the sale through specifically defined amount;
If we would like to produce the total sum for a given fiscal receipt "TotalVatSum", this can happen through the following formula:

If the information in this article is incomplete or incorrect, don’t hesitate to contact me so I can make the necessary edits.

