---
id: change/bcapps/12894
type: change
title: "#12894 [PayablesAgent] Add support for credit memos, recognised from the PDF and applied to the original invoice"
summary: The Payables Agent now recognizes vendor credit notes in PDFs (EN 16931 type 381) and creates 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; otherwise it stays unapplied with a warning.
tier: official
language: en
tags:
  - feature
  - main
  - bc30
  - codeunit pa events
  - pagecustomization pa purchase credit memo
  - codeunit payables agent
  - codeunit payables agent upgrade
  - permissionset payables ag. - run
  - pagecustomization pa e-doc. purchase draft
system: copilot
review:
  state: reviewed
  by: opus
  at: "2026-10-23T01:11:43.893Z"
  flags: []
generated:
  at: "2026-11-09T00:15:52.409Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 6bd96fae96d11895971046d5fa2188cc683174be
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/12894
    title: "microsoft/BCApps#12894: [PayablesAgent] Add support for credit memos, recognised from the PDF and applied to the original invoice"
    date: "2026-10-22"
    commit: 6bd96fae96d11895971046d5fa2188cc683174be
    t: null
    quote: recognise a vendor credit note and create a purchase credit memo applied to the original invoice
links:
  learn: []
  objects:
    - object/codeunit/3316
    - object/pagecustomization/pa-purchase-credit-memo
    - object/codeunit/3303
    - object/codeunit/3305
    - object/permissionset/3303
    - object/pagecustomization/pa-e-doc-purchase-draft
    - object/profile/payables-agent
    - object/codeunit/3307
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/faqs-payables-agent
      title: Payables Agent Frequently Asked Questions
      label: possibly related
      why: Describes Payables Agent processing of vendor invoices and credit notes for review.
      by: model
    - to: https://learn.microsoft.com/dynamics365/business-central/payables-agent
      title: Payables Agent Overview in Business Central
      label: possibly related
      why: Explains Payables Agent autonomous processing and draft document creation from email.
      by: model
number: 12894
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/12894
kind: pr
base_branch: main
major: "30"
merged_at: "2026-10-22T22:32:21Z"
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: 9
  additions: 161
  deletions: 25
  al: 8
apps:
  - PayablesAgent
objects_touched:
  - key: codeunit/3316
    page: codeunit/3316
    type: codeunit
    id: 3316
    name: PA Events
    app: PayablesAgent
    status: modified
  - key: pagecustomization/pa purchase credit memo
    page: pagecustomization/pa-purchase-credit-memo
    type: pagecustomization
    id: null
    name: PA Purchase Credit Memo
    app: PayablesAgent
    status: added
  - key: codeunit/3303
    page: codeunit/3303
    type: codeunit
    id: 3303
    name: Payables Agent
    app: PayablesAgent
    status: modified
  - key: codeunit/3305
    page: codeunit/3305
    type: codeunit
    id: 3305
    name: Payables Agent Upgrade
    app: PayablesAgent
    status: modified
  - key: permissionset/3303
    page: permissionset/3303
    type: permissionset
    id: 3303
    name: Payables Ag. - Run
    app: PayablesAgent
    status: modified
  - key: pagecustomization/pa e-doc. purchase draft
    page: pagecustomization/pa-e-doc-purchase-draft
    type: pagecustomization
    id: null
    name: PA E-Doc. Purchase Draft
    app: PayablesAgent
    status: modified
  - key: profile/payables agent
    page: profile/payables-agent
    type: profile
    id: null
    name: Payables Agent
    app: PayablesAgent
    status: modified
  - key: codeunit/3307
    page: codeunit/3307
    type: codeunit
    id: 3307
    name: Payables Agent Setup
    app: PayablesAgent
    status: modified
objects_unjoined: []
obsoletions: []
backports:
  - number: 13143
    base: releases/29.x
    url: https://github.com/microsoft/BCApps/pull/13143
fixes_issues: []
work_items:
  - 650500
systems:
  - copilot
quote: recognise a vendor credit note and create a purchase credit memo applied to the original invoice
joined_against:
  major: "30"
  commit: 15385dede95a4f9e7be01be47c684fc9d654a7ce
---

# #12894 [PayablesAgent] Add support for credit memos, recognised from the PDF and applied to the original invoice

> The Payables Agent now recognizes vendor credit notes in PDFs (EN 16931 type 381) and creates 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; otherwise it stays unapplied with a warning.

[Pull request](https://github.com/microsoft/BCApps/pull/12894) · merged into `main` (BC30) on 2026-10-22 by Explorer986 · 9 files (+161 -25), 8 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, anything else to an invoice
- Creates purchase credit memos with the same draft and task experience as invoices
- Applies only to the stated invoice when exactly one open posted invoice of the pay-to vendor matches in an applicable currency; otherwise leaves it unapplied with a warning
- Draft gets an editable Applies-to Vendor Inv. No. field and a read-only outcome field
- Amount signs are normalised and the match is re-checked at finalization
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 3316 "PA Events"](../../objects/codeunit/3316.md), PayablesAgent: modified
- [pagecustomization "PA Purchase Credit Memo"](../../objects/pagecustomization/pa-purchase-credit-memo.md), PayablesAgent: added
- [Codeunit 3303 "Payables Agent"](../../objects/codeunit/3303.md), PayablesAgent: modified
- [Codeunit 3305 "Payables Agent Upgrade"](../../objects/codeunit/3305.md), PayablesAgent: modified
- [Permission set 3303 "Payables Ag. - Run"](../../objects/permissionset/3303.md), PayablesAgent: modified
- [pagecustomization "PA E-Doc. Purchase Draft"](../../objects/pagecustomization/pa-e-doc-purchase-draft.md), PayablesAgent: modified
- [Profile "Payables Agent"](../../objects/profile/payables-agent.md), PayablesAgent: modified
- [Codeunit 3307 "Payables Agent Setup"](../../objects/codeunit/3307.md), PayablesAgent: modified

## Also merged into

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

## Context

- Work items: AB#650500
- Labels: AL: Apps (W1), Team: Finance
- Systems: copilot
- From the description: "recognise a vendor credit note and create a purchase credit memo applied to the original invoice"

## Possibly related

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

- [Payables Agent Frequently Asked Questions](https://learn.microsoft.com/dynamics365/business-central/faqs-payables-agent) — possibly related: Describes Payables Agent processing of vendor invoices and credit notes for review. (model-linked)
- [Payables Agent Overview in Business Central](https://learn.microsoft.com/dynamics365/business-central/payables-agent) — possibly related: Explains Payables Agent autonomous processing and draft document creation from email. (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).
