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
Just looking at the patch (not tested), I'm curious why the sign is inverted just for sales with negative discount - what about purchases with negative discount? Is that case also covered?
You where right - the vendor side was not correct. We corrected and refactored the logic. We successfully tested for all four cases. I'll upload the patch.
We run with this patch a couple of days - and it works for all cases.
I conducted tests of your patch but it was doing wrong tax correction posting for the case of positive payment with negative discount.
Example a receipt with value $13, discount $-1 and write-off $-1 -> in this case the tax correction was mistakenly changing sign.
I made a different patch to allow tax correction on negative invoices, can you please test and provide feedback?
Thank you for the correction.
We will apply the patch and test