---
id: change/bcapps/10182
type: change
title: "#10182 [Bug]: [Subscription Billing] Payment discount on contract invoices comes from the customer, not from the contract's payment terms"
summary: Payment discount percentages on subscription billing invoices now correctly use the contract's payment terms instead of the customer or vendor's payment terms.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit create billing documents
system: development
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:02:29.034Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 684bf7ba00f7a8605e503676b56ccdb4db925875
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/10182
    title: "microsoft/BCApps#10182: [Bug]: [Subscription Billing] Payment discount on contract invoices comes from the customer, not from the contract's payment terms"
    date: "2026-10-05"
    commit: 684bf7ba00f7a8605e503676b56ccdb4db925875
    t: null
    quote: null
links:
  learn: []
  objects:
    - object/codeunit/8060
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 10182
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/10182
kind: pr
base_branch: main
major: "30"
merged_at: "2026-10-05T14:18:31Z"
author: miljance
author_type: User
community_contribution: true
labels:
  - "ADO: Sync"
  - "AL: Apps (W1)"
  - From Fork
  - "Team: Finance"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 2
  additions: 197
  deletions: 1
  al: 1
apps:
  - Subscription Billing
objects_touched:
  - key: codeunit/8060
    page: codeunit/8060
    type: codeunit
    id: 8060
    name: Create Billing Documents
    app: Subscription Billing
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues:
  - 10095
work_items:
  - 651548
systems:
  - development
quote: null
joined_against:
  major: "30"
  commit: ecbc028c25dbe83b61313bc566e6c1d41184bb1c
---

# #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](https://github.com/microsoft/BCApps/pull/10182) · 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

- [Codeunit 8060 "Create Billing Documents"](../../objects/codeunit/8060.md), Subscription Billing: modified

## Context

- Fixes: [#10095 [Bug]: [Subscription Billing] Payment discount on contract invoices comes from the customer, not from the contract's payment terms](https://github.com/microsoft/BCApps/issues/10095) (closed)
- Work items: AB#651548
- Labels: ADO: Sync, AL: Apps (W1), From Fork, Team: Finance
- Systems: development

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