code change · fixSales & Receivablesofficial - Microsoftreviewed - checked by Opus

#13503 [Main]-Prepayment amounts are incorrectly recalculated in statistics after partial posting when Prepmt. Amt. to Deduct Excl. VAT is manually adjusted

Fixed the Sales Line prepayment recalculation so Prepmt. Line Amount no longer grows past the invoiced prepayment after a partial posting where Prepmt Amt to Deduct was raised manually. Statistics now show stable values, and the remaining quantity can be posted.

Pull request · merged into main (BC30) on 2026-11-18 by DhavalMore88 (community contribution) · 14 files (+322 -0), 12 AL · fix · tier official · reviewed (checked by Opus)

What changed

  • Added local procedure CapPrepmtLineAmountAfterOverDeduction, called in UpdatePrepmtAmounts after the Prepmt. Line Amount recalculation
  • When an amount was deducted and the recalculated value exceeds both Prepmt. Amt. Inv. and the line’s total prepayment, it is capped at the larger of the two
  • Fixes the false ‘prepayment invoices not posted’ error when posting the remaining quantity
  • Recalculation was triggered on closing Statistics via ReleaseSalesDocument.CalcAndUpdateVATOnLines and UpdateVATOnLines
  • Applied in W1 and 11 localization layers, with regression tests in W1 and RU
  • Behaviour changes for users or extensions.

AL objects touched

  • Table 37 “Sales Line”, Base Application: modified
  • src/Layers/BE/BaseApp/Sales/Document/SalesLine.Table.al: modified, not in the BC30 snapshot

Context

  • Work items: AB#657599
  • Labels: ADO: Sync, From Fork, Ownership: Manual, Team: Finance
  • Systems: sales
  • From the description: “Prepayment amounts are incorrectly recalculated in statistics after partial posting when Prepmt. Amt. to Deduct Excl. VAT is manually adjusted.”

No source states these links: they share an object, a model read them, or a person found the same subject.

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