#9222 [Main]- When issuing a prepayment invoice with an invoice discount applied, the prepayment amount does not take into account the total amount including tax.
Fixed an issue where prepayment invoices with invoice discounts applied were not correctly including tax when the prepayment include tax setting was enabled. The reconciliation logic now uses the tax-inclusive amount as the target when calculating the prepayment difference.
- 3files
- 1AL files
- 1objects
Pull request · merged into main (BC30) on 2026-07-14 by DhavalMore88 (community contribution) · 3 files (+166 -3), 1 AL · fix · tier official · reviewed (checked by Opus)
What changed
- Prepayment amount calculation now properly accounts for tax when invoice discount is applied
- The UpdateDifferenceAmount procedure uses tax-inclusive amount for reconciliation when Prepmt. Include Tax is true
- Issue only affected the invoice-discount code path; non-discount and non-include-tax scenarios unaffected
- Added test cases for Canada and US locales to verify correct tax handling
- Behaviour changes for users or extensions.
AL objects touched
- Codeunit 442 “Sales-Post Prepayments”, Base Application (CA layer): modified
Context
- Work items: AB#641621
- Labels: ADO: Sync, From Fork, Team: Finance
- Systems: sales
Possibly related
No source states these links: they share an object, a model read them, or a person found the same subject.
- Create prepayment invoices — possibly related: Create prepayment invoices that calculate amounts including tax and discounts. (model-linked)
- Invoice prepayments — possibly related: Prepayment invoice posting with invoice discounts and tax calculations for sales orders. (model-linked)
Source: metadata of a merged pull request in microsoft/BCApps (bcapps): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).