microsoft / microsoft/BCApps

[Bug]: Incorrect Prepayment GST Calculation (Only in AU)

Open
#8,896 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Approved Team: Finance
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."

Image
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.

  1. SO with two item lines
    • ensure that GST is calculated for the order lines
  2. Post prepayment invoice 1 (20% or both lines)
  3. Post cash receipt and apply to prepayment invoice
  4. Change prepayment to 50% on one line.
  5. Post prepayment invoice 2
  6. Post cash receipt and apply to prepayment invoice
  7. Post final invoice for the item line with two prepayments - select serial number
    • enter qty to ship, qty to invoice for one item line
  8. 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

  1. 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

  1. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.