code change · fixAL Developmentofficial - Microsoftreviewed - checked by Opus

#10182 [Bug]: [Subscription Billing] Payment discount on contract invoices comes from the customer, not from the contract's payment terms

Payment discount percentages on subscription billing invoices now correctly use the contract's payment terms instead of the customer or vendor's payment terms.

Pull request · merged into main (BC30) on 2026-10-05 by miljance (community contribution) · 2 files (+197 -1), 1 AL · fix · tier official · reviewed (checked by Opus)

What changed

  • Invoices created from contracts now take Payment Discount % from the contract’s payment terms, not the customer’s or vendor’s
  • Create Billing Documents re-validates the contract Payment Terms Code after the document date is set
  • Sales and purchase headers are handled differently because their payment terms triggers behave differently
  • Four new tests cover contract terms that grant a discount and contract terms that remove one, for both customers and vendors
  • Before the fix, the payment discount could be missing or larger than the contract terms allow
  • Behaviour changes for users or extensions.

AL objects touched

Context

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