---
id: change/bcapps/12967
type: change
title: "#12967 [29.x]Incorrect Purchase Credit Memo created when Customer and Vendor Subscription Contracts have the same Contract Number."
summary: Fixed incorrect purchase credit memo creation when customer and vendor subscription contracts share the same contract number by filtering billing totals by partner in addition to contract number.
tier: official
language: en
tags:
  - fix
  - releases/29.x
  - bc29
  - codeunit billing proposal
  - table billing line
system: sales
review:
  state: reviewed
  by: opus
  at: "2026-10-22T01:10:58.676Z"
  flags: []
generated:
  at: "2026-10-24T01:02:25.817Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 197bed54ee37fba7b5d2ef2499d3c7244835256a
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/12967
    title: "microsoft/BCApps#12967: [29.x]Incorrect Purchase Credit Memo created when Customer and Vendor Subscription Contracts have the same Contract Number."
    date: "2026-10-21"
    commit: 197bed54ee37fba7b5d2ef2499d3c7244835256a
    t: null
    quote: The billing total that decides between an invoice and a credit memo filtered only by Subscription Contract No.
links:
  learn: []
  objects:
    - object/codeunit/8062
    - object/table/8061
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/SRB/sales/credit-memo-cancellation
      title: Credit memos and cancellation
      label: possibly related
      why: Explains credit memo creation for subscription billing contracts, core to the incorrect credit memo issue being fixed.
      by: model
    - to: https://learn.microsoft.com/dynamics365/business-central/SRB/working-with-contracts/vendor-contract-integration-purchase-invoice
      title: Vendor contract integration in purchase invoices
      label: possibly related
      why: Documents vendor contract integration in purchase invoices and billing, relevant to the subscription contract credit memo bug.
      by: model
number: 12967
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/12967
kind: pr
base_branch: releases/29.x
major: "29"
merged_at: "2026-10-21T11:28:41Z"
author: neeleshsinghal
author_type: User
community_contribution: false
labels:
  - "AL: Apps (W1)"
  - "Team: Finance"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 3
  additions: 164
  deletions: 25
  al: 2
apps:
  - Subscription Billing
objects_touched:
  - key: codeunit/8062
    page: codeunit/8062
    type: codeunit
    id: 8062
    name: Billing Proposal
    app: Subscription Billing
    status: modified
  - key: table/8061
    page: table/8061
    type: table
    id: 8061
    name: Billing Line
    app: Subscription Billing
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 654959
systems:
  - sales
quote: The billing total that decides between an invoice and a credit memo filtered only by Subscription Contract No.
joined_against:
  major: "29"
  commit: e9be5bb80644ee0302e5a7eb3b0b01e1c91cb5fc
---

# #12967 [29.x]Incorrect Purchase Credit Memo created when Customer and Vendor Subscription Contracts have the same Contract Number.

> Fixed incorrect purchase credit memo creation when customer and vendor subscription contracts share the same contract number by filtering billing totals by partner in addition to contract number.

[Pull request](https://github.com/microsoft/BCApps/pull/12967) · merged into `releases/29.x` (BC29) on 2026-10-21 by neeleshsinghal · 3 files (+164 -25), 2 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Billing total calculations now filter by both subscription contract number and partner
- Prevents customer contract credit memo lines from affecting vendor contract invoice type
- Addresses issue where shared contract numbers caused wrong document type generation
- Changes made in BillingLine and BillingProposal objects
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 8062 "Billing Proposal"](../../objects/codeunit/8062.md), Subscription Billing: modified
- [Table 8061 "Billing Line"](../../objects/table/8061.md), Subscription Billing: modified

## Context

- Work items: AB#654959
- Labels: AL: Apps (W1), Team: Finance
- Systems: sales
- From the description: "The billing total that decides between an invoice and a credit memo filtered only by Subscription Contract No."

## Possibly related

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

- [Credit memos and cancellation](https://learn.microsoft.com/dynamics365/business-central/SRB/sales/credit-memo-cancellation) — possibly related: Explains credit memo creation for subscription billing contracts, core to the incorrect credit memo issue being fixed. (model-linked)
- [Vendor contract integration in purchase invoices](https://learn.microsoft.com/dynamics365/business-central/SRB/working-with-contracts/vendor-contract-integration-purchase-invoice) — possibly related: Documents vendor contract integration in purchase invoices and billing, relevant to the subscription contract credit memo bug. (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).
