Tax corrections for payment discounts and write off create in certain scenarios wrong Fact_Acct lines because the Debit/Credit logic is not implemented correctly.
Tax corrections lines create Fact_Acct lines on tax account w/o tax rates. To improve tax reporting the appropriate tax rate is added to the corrections.
One scenario issue was corrected with Jira ticket 3281 for SOTrx in the case of payment discount.
The following corrections are implemented in the attached patch
1) In the case of negative invoice inverted posting logic for the tax correction lines is applied
2) Fact_Acct lines for Write Off now implement the inverted posting logic for SOTrx and negative invoice
3) add tax rate to tax correction Fact_Acct lines in order to include discount / write off in tax reporting based on Fact_Acct tax rates; an allocation can correct invoices with multiple tax rates; for each correction the correct tax rate is selected
Accounting Schema's "Tax Correction" = "Write off and Payment Discount"
Invoices with Tax and Payment Discounts
and/or Write Offs in Allocation
Invoice scenarios: SOTrx = Y or N AND invoice Amount negative = Y or N