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.
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).
@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?
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.
… 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.