Cancelled move does not revert tax line computation
For example when canceling a supplier invoice, the generated move has the amount signs inverted also for the tax line amount.
The tax codes are defined using the type invoice
or credit
based on the amount sign. But some tax code may include only the invoice
or only the credit
. This means that the canceled move does not revert the computed amount of the tax code in such case.
I propose that we consider a tax line as an invoice if:
- amount is positive and debit or credit are also positive
- amount is negative and debit or credit are also negative.
and the opposite for credit.