[Bug]: Incorrect Prepayment GST Calculation (Only in AU)
Nobody has claimed this yet.
- Dominant language
- AL
- Stars
- 683
- Forks
- 459
- Avg merge
- 3d 26m
- Merged PRs (30d)
- 633
Description
Describe the issue
Credit / re-invoice for order lines with more than one prepayment will calculate incorrect GST when the final invoice is re-posted.
[!NOTE]
The bug only exists in AU.
Expected behavior
Prepmt. VAT Base Amt. also needs to be updated here:
for Credit Memo Document Type (blue)
SalesLine."Prepmt. VAT Base Amt." = SalesLine."Prepmt. VAT Base Amt." - TempOriginalSalesLine."Prepmt. VAT Base Amt."
and otherwise (Red)
SalesLine."Prepmt. VAT Base Amt." = SalesLine."Prepmt. VAT Base Amt." + TempOriginalSalesLine."Prepmt. VAT Base Amt."
Steps to reproduce
NOTE: need to have two lines on SO, so that the SO is not finalised and deleted when the first 'final' invoice is posted.
- SO with two item lines
- ensure that GST is calculated for the order lines
- Post prepayment invoice 1 (20% or both lines)
- Post cash receipt and apply to prepayment invoice
- Change prepayment to 50% on one line.
- Post prepayment invoice 2
- Post cash receipt and apply to prepayment invoice
- Post final invoice for the item line with two prepayments - select serial number
- enter qty to ship, qty to invoice for one item line
- SO is partially shipped and invoiced
- GST on invoice is correct.
Create CR/Adj Note
9. Copy Document -> select final invoice
[!NOTE]
On the unposted credit, it looks like the item is credited at full amount, no prepayment reversal is made.
GST is for the full amount
Preview posting does show the prepayment reversal entries
- When the credit is posted, the prepayment line is generated
- the credit then reflects the lesser amount.
- Ledger entries are OK
[!NOTE]
Qty. to Ship and Qty. to Invoice are re-instated on the sales order line when the credit is posted.
This is how we are able to do the posting of the second invoice and create the incorrect GST entries
- Post final invoice 2 for the item line with two prepayments
- select serial number
- enter qty to ship, qty to invoice for one item line
- GST for prepayment reversal is incorrect
- Posted sales invoice shows correct amount
- But the customer ledger entry and the GL Entries are incorrect
Additional context
This is the issue #1776 from https://github.com/microsoft/BusinessCentralApps/
PR of Proposed Solution: #1880 from https://github.com/microsoft/BusinessCentralApps/
I will provide a fix for a bug
- I will provide a fix for a bug
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with BusinessCentralApps issue #1776 and proposed solution PR #1880, which are the referenced prior work. Review the prepayment GST calculation for credit memo and non-credit-memo paths, focusing on SalesLine."Prepmt. VAT Base Amt." and TempOriginalSalesLine."Prepmt. VAT Base Amt.". Done means the supplied AU reproduction produces correct GST, customer ledger entries, and GL entries.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100