Dear All,
We have he following scenario:
Invoice with Cash discount has been booked and paid.
Cash discount was used. Parameters are set up in a way to ensure that VAT is reversed on Cash discount.
The following booking is made by the system for the payment, cash discount and VAT reversal:

The VAT code is setup to use UseTax, this is why you can see the VAT booking for both sides.
This is almost correct, the issue is with the VAT amount.
On the GL level it shows and books 215.98 EUR but when you look in to the Posted sales tax the amount is 107.99, exactly the half of it.

Because if this now there is a difference in between the subledger and the ledger balances.
Interestingly only this single invoice payment behaves like this, all other times the payment and the cash discount and the VAT is correctly calculated and booked.
I have tried to recreate this behavior and created the same PO, Invoice, Payment process and now it is done correctly.
However if I undo the settlement of the original invoice and try to book a new payment to it the issue is there again.
Any ideas why this is happening?
Thank you
Emilia