---
id: change/bcapps/10446
type: change
title: '#10446 [Bug][Subscription Billing] "Subscription Lines - Overdue" cue counts lines of contracts that already ended'
summary: Fixed the Overdue Subscription Lines cue and page to exclude subscription lines that have been billed past their term end date, eliminating false positives in the overdue count and improving accuracy by checking billing progress rather than relying on a stale flag.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - page customer contract line subp.
  - page customer contract lines
  - table overdue subscription line
  - table subscription line
  - page vendor contract line subpage
system: sales
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:02:00.875Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 399ca135e6d9b9369501e4899aab934ccc9b6e5b
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/10446
    title: 'microsoft/BCApps#10446: [Bug][Subscription Billing] "Subscription Lines - Overdue" cue counts lines of contracts that already ended'
    date: "2026-10-07"
    commit: 399ca135e6d9b9369501e4899aab934ccc9b6e5b
    t: null
    quote: A new `internal procedure IsBilledUntilEndOfTerm()` on table `8059 "Subscription Line"` answers the question "has this line already been billed past its term?"
links:
  learn: []
  objects:
    - object/page/8068
    - object/page/8075
    - object/table/8007
    - object/table/8059
    - object/page/8078
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 10446
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/10446
kind: pr
base_branch: main
major: "30"
merged_at: "2026-10-07T15:37:42Z"
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: 6
  additions: 148
  deletions: 39
  al: 5
apps:
  - Subscription Billing
objects_touched:
  - key: page/8068
    page: page/8068
    type: page
    id: 8068
    name: Customer Contract Line Subp.
    app: Subscription Billing
    status: modified
  - key: page/8075
    page: page/8075
    type: page
    id: 8075
    name: Customer Contract Lines
    app: Subscription Billing
    status: modified
  - key: table/8007
    page: table/8007
    type: table
    id: 8007
    name: Overdue Subscription Line
    app: Subscription Billing
    status: modified
  - key: table/8059
    page: table/8059
    type: table
    id: 8059
    name: Subscription Line
    app: Subscription Billing
    status: modified
  - key: page/8078
    page: page/8078
    type: page
    id: 8078
    name: Vendor Contract Line Subpage
    app: Subscription Billing
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues:
  - 10357
work_items:
  - 652996
systems:
  - sales
quote: A new `internal procedure IsBilledUntilEndOfTerm()` on table `8059 "Subscription Line"` answers the question "has this line already been billed past its term?"
joined_against:
  major: "30"
  commit: 9df55025ee6eb2a1346ddad3a8a55d1ba1ff75aa
---

# #10446 [Bug][Subscription Billing] "Subscription Lines - Overdue" cue counts lines of contracts that already ended

> Fixed the Overdue Subscription Lines cue and page to exclude subscription lines that have been billed past their term end date, eliminating false positives in the overdue count and improving accuracy by checking billing progress rather than relying on a stale flag.

[Pull request](https://github.com/microsoft/BCApps/pull/10446) · merged into `main` (BC30) on 2026-10-07 by miljance (community contribution) · 6 files (+148 -39), 5 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Added `IsBilledUntilEndOfTerm()` procedure to determine if a subscription line has been fully billed through its term end date
- Extracted shared filter logic into `FilterOverdueServiceCommitments` to prevent divergence between count and list paths
- Replaced three separate hand-written predicates with the new common procedure on related pages
- Count operation optimized to avoid record-by-record loops for common cases
- Added comprehensive tests covering billed, closed, and future end-date scenarios
- Behaviour changes for users or extensions.

## AL objects touched

- [Page 8068 "Customer Contract Line Subp."](../../objects/page/8068.md), Subscription Billing: modified
- [Page 8075 "Customer Contract Lines"](../../objects/page/8075.md), Subscription Billing: modified
- [Table 8007 "Overdue Subscription Line"](../../objects/table/8007.md), Subscription Billing: modified
- [Table 8059 "Subscription Line"](../../objects/table/8059.md), Subscription Billing: modified
- [Page 8078 "Vendor Contract Line Subpage"](../../objects/page/8078.md), Subscription Billing: modified

## Context

- Fixes: [#10357 [Bug][Subscription Billing] "Subscription Lines - Overdue" cue counts lines of contracts that already ended](https://github.com/microsoft/BCApps/issues/10357) (closed)
- Work items: AB#652996
- Labels: ADO: Sync, AL: Apps (W1), From Fork, Team: Finance
- Systems: sales
- From the description: "A new `internal procedure IsBilledUntilEndOfTerm()` on table `8059 "Subscription Line"` answers the question "has this line already been billed past its term?""

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