discount / write off tax corrections in allocation post require inverted Debit/Credit logic in certain scenarios; tax rate added to Fact_Acct tax correction postings

Description

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

Environment

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

Activity

Show:
Carlos Ruiz
January 25, 2019, 12:38 PM

Thanks ,

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?

Regards,

Carlos Ruiz

Anton Fildan
January 28, 2019, 6:57 AM

Hallo Carlos,

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.

Regards
Anton Fildan

Anton Fildan
January 30, 2019, 5:18 PM

Hallo Carlos,

We run with this patch a couple of days - and it works for all cases.
Please verify.

Regards
Anton Fildan

Carlos Ruiz
February 17, 2019, 9:12 AM

Hi ,

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?

Regards,

Carlos Ruiz

Anton Fildan
February 17, 2019, 11:17 AM

Hallo Carlos,

Thank you for the correction.
We will apply the patch and test

Regards
Anton Fildan

Assignee

Carlos Ruiz

Reporter

Anton Fildan

Labels

None

Tested By

Anton Fildan

Components

Fix versions

Affects versions

Due date

2019/01/15

Priority

Major
Configure