#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.
- 9files
- 8AL files
- 8objects
Pull request · 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”, PayablesAgent: modified
- pagecustomization “PA Purchase Credit Memo”, PayablesAgent: added
- Codeunit 3303 “Payables Agent”, PayablesAgent: modified
- Codeunit 3305 “Payables Agent Upgrade”, PayablesAgent: modified
- Permission set 3303 “Payables Ag. - Run”, PayablesAgent: modified
- pagecustomization “PA E-Doc. Purchase Draft”, PayablesAgent: modified
- Profile “Payables Agent”, PayablesAgent: modified
- Codeunit 3307 “Payables Agent Setup”, PayablesAgent: modified
Also merged into
- #13143 into
releases/29.xon 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 — possibly related: Describes Payables Agent processing of vendor invoices and credit notes for review. (model-linked)
- Payables Agent Overview in Business Central — 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).