Wrong Vat amount

Hi

I just realise the vat amount and the total amount seem wrong. When i send an amount of 1199 and a 20 tax percentage. I was expecting you to send me back a vat amount of 199 and total amount of 999. However, i am getting back 959.2 and 239.8 which i dont believe is right.

Hi @sampzz

Are you able to share the code you’re sending on the API please, and we can investigate this for you?

When i send a json like this

{
	"payload": {
		"Header": {
			"MessageType":"Request",
			"TestMode":true,
			"SubmissionNumber":"#######",
			"Authentication":{
				"AccNumber":"####",
				"MD5Value":"###########",
				"ApplicationID":"####"
			}
		},
		"Body":{
			"@xmlns":"https://api.quickfile.co.uk",
			"InvoiceData":{
				"InvoiceType":"INVOICE",
				"ClientID":"7",
				"ClientAddress":{
					"Address":"",
					"CountryISO":"GB"
				},
				"Currency":"GBP",
				"TermDays":0,
				"Language":"en",
				"ecVatExempt":true,
				"InvoiceLines":{
					"ItemLines":{
						"ItemLine":[{
							"ItemID":"634701",
							"ItemName":"campaign",
							"ItemDescription":"ss",
							"Tax1":{
								"TaxName":"none",
								"TaxPercentage":20.0,
								"TaxAmount":0.0
							},
							"UnitCost":"1199.0",
							"Qty":1
						}]
					}
				},
				"Scheduling":{
					"SingleInvoiceData":{
						"IssueDate":"2018-11-28"
					}
				}
			}
		}
	}
}

In this example, the VAT amount is set to 0.0:

So no VAT should be showing. Is this the case at the moment, or is it that the amount you’re seeing on the invoice the £239.80 from above?

i just added the taxamount but originally it wasnt there

For what it’s worth, £239.80 is the correct value for 20% VAT on top of an £1199 net.

In fact, now I see you’ve said "ecVatExempt":true so I would expect to see

  • £1,199 as the net
  • £239.80 VAT added on to this
  • £239.80 VAT taken off again at the bottom as EC vat exemption
  • leaving £1,199 as the final invoice total.

the issue is that imagine you have an item that cost 1000. However if you applied vat the value is 1199(We are doing this from our end). The issue now is if i send quickfile 1199 then we have an issue because quickfile does 20 percent of 1199.

QuickFile always works on the basis of net amount and VAT amount, the gross-to-net calculation that you can do in the web invoice entry form is a UI convenience but the API is all in terms of net plus VAT. If you want to create an invoice for £1,199 including VAT then you have to do the gross-to-net calculation before you call the API, and pass the appropriate values (£999.17 net, and 20% VAT of £199.83, the VAT will be gross total divided by 6 and the net will be gross times five-sixths).

That is similar to what we are doing now

@sampzz - given that the example above didn’t have any VAT, can you supply a example of an API call where you’re seeing it being saved incorrectly compared to what you’re sending, please?

I believe something like this

{
	"payload": {
		"Header": {
			"MessageType":"Request",
			"TestMode":true,
			"SubmissionNumber":"#######",
			"Authentication":{
				"AccNumber":"####",
				"MD5Value":"###########",
				"ApplicationID":"####"
			}
		},
		"Body":{
			"InvoiceData":{
				"InvoiceType":"INVOICE",
				"ClientID":"7",
				"ClientAddress":{
					"Address":"",
					"CountryISO":"GB"
				},
				"Currency":"GBP",
				"TermDays":0,
				"Language":"en",
				"ecVatExempt":false,
				"InvoiceLines":{
					"ItemLines":{
						"ItemLine":[{
							"ItemID":"634701",
							"ItemName":"campaign",
							"ItemDescription":"ss",
							"Tax1":{
								"TaxName":"none",
								"TaxPercentage":20.0,
								"TaxAmount":0.0
							},
							"UnitCost":"1199.0",
							"Qty":1
						}]
					}
				},
				"Scheduling":{
					"SingleInvoiceData":{
						"IssueDate":"2018-11-28"
					}
				}
			}
		}
	}
}

Thank you for the example.

As with the first example you provided, you’re providing the VAT at £0.00, and the value of the invoice at £1199.00. So if the invoice is showing £0.00 and a total of £1,199.00, then it’s creating what you’ve given it.

We have fixed the issue. However the invoice wasn’t showing 0.0 it was something like 239.8.

… which is the correct amount of VAT at 20% on top of an 1199 net.

I expect what’s happening here is that the API may be treating your explicit zero for TaxAmount the same as if you had not specified TaxAmount at all, in which case the behaviour is for QuickFile to calculate the VAT amount itself from the net using the specified percentage.

The API never used to support overriding of the VAT amount, it would always calculate from the net and percentage. The ability to override the vat amount to something less than it would have calculated was actually a feature request from me, to allow me to create a representation in QuickFile of my retail EPOS sales, which are a mixture of 20% and zero rated sales. For me the EPOS is the master record (with each separate item recorded at the right VAT rate) and I need QuickFile to match it exactly, but for most normal use cases you’re better off letting QuickFile do the calculations itself.

This topic was automatically closed after 7 days. New replies are no longer allowed.