Rounding
NET, GROSS and VAT values
Terms
-
NET unit price: the net price of one piece (or any other unit) of an item in the invoice
-
Quantity of item: the sold amount of the given item
-
Total value of item: the net unit price of the item multiplied by the quantity of the item
-
VAT value of item: calculated from the total value of the item with the given VAT rate
-
GROSS value of item: the sum of the total value and the VAT value of the item. In case of an invoice issued in a currency other than HUF it is possible to use amounts that are not integers (e.g. 12.45). In the case of invoices in HUF, the amounts of “VAT value of item” and “Total value of item” must be integers. It means that in many cases you have to round the amounts as you will barely get an integer using the 27% VAT rate.
Rounding based on NET value (HUF invoice)
In case you are issuing an invoice for a business partner and not a natural person (B2B), you have to use this method in the following way:
- Take the “Net unit price” (it can be any amount: integer or not).
- Multiply the “Net unit price” with the “Quantity of item”. If the result is not an integer, you must round it. This will be the “Total net value of item”.
- Take the “Total net value of item” and the VAT rate (e.g. 27%) and calculate the VAT amount. If the result is not an integer, you must round it.
- Add the VAT value (integer) and the “Total net value of item” (integer) to get the gross amount. Since both values were integers, the result will be an integer as well.
Rounding based on GROSS value (HUF invoice)
In case you are issuing an invoice to a natural person (B2C) you have to use this method.
- Take the “Gross unit price” (it can be any amount: integer or not).
- Multiply the “Gross unit price” with the “Quantity of item”. If the result is not an integer, you must round it. This will be the “Total gross value of item”.
- From the “Total gross value of item” and the VAT rate calculate the VAT amount. The formula for the calculation is: “Total gross value of item”/(100+VAT rate) x VAT RATE.
Example: I sold 3 pieces of a book that has GROSS price of 500 HUF :
- Gross unit price: 500 HUF
- Quantity: 3 pieces
- Gross value of item: 500 x 3 = 1500 HUF
- VAT rate: 27%
- VAT value: 1500/(100+27) x 27 = 318.89 HUF
Rounding this amount will mean that the VAT amount of the invoice is 319 HUF.
The “Total net value of item” can be calculated by extracting the VAT amount from the “Total gross value of item”. Since both values are integers, the result will be an integer as well. In case you do not keep these rules, Számla Agent will do the rounding in order to comply with the law.
How do I know the number of an invoice and its gross or net value?
Every HTTP response consists of two parts. The first one is the header, and the second one is the body. If the calling party requests the invoice, the body will be a pdf file. The header is always a name=value
pair. In all programming languages that support HTTP requests there is an option to get the values in the header. In Számla Agent you can insert data in the header using the following names always starting with szlahu_
:
-
szlahu_szamlaszam
: the number of the created invoice, URL encoded -
szlahu_nettovegosszeg
: number type data, not URL encoded -
szlahu_bruttovegosszeg
: number type data, not URL encoded -
szlahu_vevoifiokurl
: this is the URL which was sent to the customer in the invoice notification. If online payment is availabe, the customer can use this link for payment. -
szlahu_error
: text of error message, a single sentence, URL encoded -
szlahu_error_code
: number type data, not URL encoded
If there are error codes in the header, the other data (invoice number, gross and net value) will not be present in the header. In case of an XML response, the XML will include that information besides the header fields.