When adding a purchase invoice via the API the VAT is incorrect. It seems to be getting added twice and then only deducted once. If I click Modify and then Save it puts itself right.
How the invoice looks after creation:
How the invoice looks immediately after clicking Modify -> Save
The second screenshot is the correct values.