---
id: change/bcapps/12855
type: change
title: "#12855 [E-Documents] Add support for credit memos, recognised from the PDF and applied to the original invoice"
summary: E-Documents now recognize vendor credit notes in PDFs and create purchase credit memos instead of invoices. A credit memo is applied to the invoice printed on the document only when exactly one open posted invoice of the pay-to vendor matches in an applicable currency; otherwise it stays unapplied with a warning.
tier: official
language: en
tags:
  - feature
  - main
  - bc30
  - codeunit e-document subscribers
  - codeunit e-doc. create purch. cr. memo
  - codeunit e-doc. purch. doc. helper
  - codeunit edoc prepare cr. memo draft
  - page e-doc. purchase draft subform
  - page e-doc. readable purchase doc.
system: integration
review:
  state: reviewed
  by: opus
  at: "2026-10-22T01:10:52.904Z"
  flags: []
generated:
  at: "2026-11-07T00:15:21.625Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 5a037d36ec59ca8f9c57a041f06451f640ce8464
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/12855
    title: "microsoft/BCApps#12855: [E-Documents] Add support for credit memos, recognised from the PDF and applied to the original invoice"
    date: "2026-10-21"
    commit: 5a037d36ec59ca8f9c57a041f06451f640ce8464
    t: null
    quote: null
links:
  learn: []
  objects:
    - object/codeunit/6103
    - object/codeunit/6404
    - object/codeunit/6402
    - object/codeunit/6403
    - object/page/6183
    - object/page/6182
    - object/page/6181
    - object/table/6100
    - object/codeunit/6232
    - object/codeunit/6231
    - object/table/6103
    - object/codeunit/6168
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/devenv-extend-edocuments
      title: Extending the e-documents functionality
      label: possibly related
      why: touches Table 6103 "E-Document Service"
      by: code
    - to: https://learn.microsoft.com/dynamics365/business-central/finance-how-use-edocuments-purchase
      title: Use E-Documents in the purchase process
      label: possibly related
      why: touches Page 6181 "E-Document Purchase Draft"
      by: code
    - to: https://learn.microsoft.com/dynamics365/business-central/service-how-create-invoices
      title: Create invoices or credit memos for services
      label: possibly related
      why: E-document credit memo creation and application relates to service invoice and credit memo documentation.
      by: model
number: 12855
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/12855
kind: pr
base_branch: main
major: "30"
merged_at: "2026-10-21T13:04:49Z"
author: Explorer986
author_type: User
community_contribution: false
labels:
  - "AL: Apps (W1)"
  - "Team: Finance"
change_class: code
change_kind: feature
behavior_change: true
breaking: false
files:
  count: 20
  additions: 1797
  deletions: 31
  al: 12
apps:
  - EDocument
objects_touched:
  - key: codeunit/6103
    page: codeunit/6103
    type: codeunit
    id: 6103
    name: E-Document Subscribers
    app: EDocument
    status: modified
  - key: codeunit/6404
    page: codeunit/6404
    type: codeunit
    id: 6404
    name: E-Doc. Create Purch. Cr. Memo
    app: EDocument
    status: modified
  - key: codeunit/6402
    page: codeunit/6402
    type: codeunit
    id: 6402
    name: E-Doc. Purch. Doc. Helper
    app: EDocument
    status: modified
  - key: codeunit/6403
    page: codeunit/6403
    type: codeunit
    id: 6403
    name: EDoc Prepare Cr. Memo Draft
    app: EDocument
    status: modified
  - key: page/6183
    page: page/6183
    type: page
    id: 6183
    name: E-Doc. Purchase Draft Subform
    app: EDocument
    status: modified
  - key: page/6182
    page: page/6182
    type: page
    id: 6182
    name: E-Doc. Readable Purchase Doc.
    app: EDocument
    status: modified
  - key: page/6181
    page: page/6181
    type: page
    id: 6181
    name: E-Document Purchase Draft
    app: EDocument
    status: modified
  - key: table/6100
    page: table/6100
    type: table
    id: 6100
    name: E-Document Purchase Header
    app: EDocument
    status: modified
  - key: codeunit/6232
    page: codeunit/6232
    type: codeunit
    id: 6232
    name: E-Doc. MLLM Schema Helper
    app: EDocument
    status: modified
  - key: codeunit/6231
    page: codeunit/6231
    type: codeunit
    id: 6231
    name: E-Document MLLM Handler
    app: EDocument
    status: modified
  - key: table/6103
    page: table/6103
    type: table
    id: 6103
    name: E-Document Service
    app: EDocument
    status: modified
  - key: codeunit/6168
    page: codeunit/6168
    type: codeunit
    id: 6168
    name: E-Document Upgrade
    app: EDocument
    status: modified
objects_unjoined: []
obsoletions: []
backports:
  - number: 13142
    base: releases/29.x
    url: https://github.com/microsoft/BCApps/pull/13142
fixes_issues: []
work_items:
  - 650500
systems:
  - integration
quote: null
joined_against:
  major: "30"
  commit: eb2bfe5258a473c969a6b85cdc98ce8524408706
---

# #12855 [E-Documents] Add support for credit memos, recognised from the PDF and applied to the original invoice

> E-Documents now recognize vendor credit notes in PDFs and create purchase credit memos instead of invoices. A credit memo is applied to the invoice printed on the document only when exactly one open posted invoice of the pay-to vendor matches in an applicable currency; otherwise it stays unapplied with a warning.

[Pull request](https://github.com/microsoft/BCApps/pull/12855) · merged into `main` (BC30) on 2026-10-21 by Explorer986 · 20 files (+1797 -31), 12 AL · feature · tier official · reviewed (checked by Opus)

## What changed

- Extraction returns the EN 16931 document type code and billing reference; code maps 381 to a credit memo and anything else to an invoice
- Credit memos are applied only to the stated invoice when exactly one open posted invoice of the pay-to vendor matches in an applicable currency
- Otherwise the credit memo is left unapplied with a warning, and finalizing re-checks the match
- Draft gets an editable Applies-to Vendor Inv. No. field and a read-only outcome field
- Amount signs are normalized from the lines first, then the header totals
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 6103 "E-Document Subscribers"](../../objects/codeunit/6103.md), EDocument: modified
- [Codeunit 6404 "E-Doc. Create Purch. Cr. Memo"](../../objects/codeunit/6404.md), EDocument: modified
- [Codeunit 6402 "E-Doc. Purch. Doc. Helper"](../../objects/codeunit/6402.md), EDocument: modified
- [Codeunit 6403 "EDoc Prepare Cr. Memo Draft"](../../objects/codeunit/6403.md), EDocument: modified
- [Page 6183 "E-Doc. Purchase Draft Subform"](../../objects/page/6183.md), EDocument: modified
- [Page 6182 "E-Doc. Readable Purchase Doc."](../../objects/page/6182.md), EDocument: modified
- [Page 6181 "E-Document Purchase Draft"](../../objects/page/6181.md), EDocument: modified
- [Table 6100 "E-Document Purchase Header"](../../objects/table/6100.md), EDocument: modified
- [Codeunit 6232 "E-Doc. MLLM Schema Helper"](../../objects/codeunit/6232.md), EDocument: modified
- [Codeunit 6231 "E-Document MLLM Handler"](../../objects/codeunit/6231.md), EDocument: modified
- [Table 6103 "E-Document Service"](../../objects/table/6103.md), EDocument: modified
- [Codeunit 6168 "E-Document Upgrade"](../../objects/codeunit/6168.md), EDocument: modified

## Also merged into

- [#13142](https://github.com/microsoft/BCApps/pull/13142) into `releases/29.x` on 2026-10-23

## Context

- Work items: AB#650500
- Labels: AL: Apps (W1), Team: Finance
- Systems: integration

## Possibly related

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

- [Extending the e-documents functionality](https://learn.microsoft.com/dynamics365/business-central/dev-itpro/developer/devenv-extend-edocuments) — possibly related: touches Table 6103 "E-Document Service"
- [Use E-Documents in the purchase process](https://learn.microsoft.com/dynamics365/business-central/finance-how-use-edocuments-purchase) — possibly related: touches Page 6181 "E-Document Purchase Draft"
- [Create invoices or credit memos for services](https://learn.microsoft.com/dynamics365/business-central/service-how-create-invoices) — possibly related: E-document credit memo creation and application relates to service invoice and credit memo documentation. (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).
