posting of Allocation with a AR Credit Memos with discount, the tax-correction has the wrong sign
Description
Environment
Attachments
- 28 Jun 2021, 06:05 AM
- 11 Jun 2021, 02:05 PM
- 11 Jun 2021, 02:05 PM
- 11 Jun 2021, 10:32 AM
Activity
Patric June 14, 2021 at 5:54 AM
Hi @Carlos Ruiz ,
okay, i will work on a solution.
Many thanks for your answer.
Regards,
Patric
Carlos Ruiz June 12, 2021 at 11:28 AM
You’re right @Patric
I wrote:
When the discount of $1 is applied - the algorithm splits the discount in $0.92 to a real discount and $0.08 to tax correction. Which is OK provided some currency rounding adjustments.
But checking the numbers the correct calculation must be to split the discount in $0.94 and $0.06 - and changing that sign probably makes the trick.
Would be good to write a unit test case to validate the results with more variations.
Patric June 12, 2021 at 9:54 AM
Hi @Carlos Ruiz ,
the issue that i tried to show is not the calculation itself.
The calculation of the amount is right. But the marked posting
record in my Screenshot for the tax-correction has the wrong sign
in my opinion.
When we create a AR Credit Memo and posting it, then the
tax due is diminished, calculated based of the amount
of the Credit Memo. Now we are granting a discount of the Credit Memo.
Then the Tax-Correction have to post a proportionate tax burden.
The system post for tax due a minus sign in credit, this is a
reduction in the tax burden.
Meaning it's add the correction on the already booked tax relief.
Regards,
Patric
Carlos Ruiz June 11, 2021 at 2:05 PM
In other words, this is your partial allocation (with strange but predictable results)
This is the full allocation (with correct results)
Carlos Ruiz June 11, 2021 at 1:52 PM
Hi @Patric - in the screenshot you provided in mattermost the allocation is 51.50
61.90 - 1.70 discount for the invoice
and
10.40 - 0.20 discount for the credit memo
that’s wrong - the allocation must be for $52
62.40 - 1.20 discount for the invoice
and
10.40 - 0.20 discount for the credit memo
With this allocation the tax correction is right (with some rounding issues).
This is the ending result
The tax calculated for the invoice minus credit memo is $50*6% = $3
When the discount of $1 is applied - the algorithm splits the discount in $0.92 to a real discount and $0.08 to tax correction. Which is OK provided some currency rounding adjustments.
And your example is a partial payment - the results are similar, but leaving unpaid amounts.
Regards,
Carlos Ruiz
By posting (AR)Credit Memo with discount and tax-correction=Write-off and Discount in Accounting Schema.
The posted amount for Tax correction of Discount and Tax has the wrong sign.
See Attachment: wrongPosting.jpeg
Chat: https://mattermost.idempiere.org/idempiere/pl/krwocfqgf3y9idau7dun694uyy