---
id: change/bcapps/9784
type: change
title: "#9784 [E-Document Formats] Fix defects in V2 draft migration for XRechnung, PINT A-NZ and Factura-E"
summary: Fixes defects in the V2 draft import for XRechnung, PINT A-NZ and Factura-E. Re-reading an XRechnung draft no longer duplicates lines, and unsupported root elements or namespaces are rejected. PINT A-NZ vendor-matching fallbacks now receive values. Credit notes and corrective invoices now map the original invoice reference so they can be applied.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit e-document xrechnung handler
system: integration
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:10:58.456Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: eaf156e51958ba29644a83b8c992a8bc4eb60ff8
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/9784
    title: "microsoft/BCApps#9784: [E-Document Formats] Fix defects in V2 draft migration for XRechnung, PINT A-NZ and Factura-E"
    date: "2026-07-29"
    commit: eaf156e51958ba29644a83b8c992a8bc4eb60ff8
    t: null
    quote: null
links:
  learn: []
  objects:
    - object/codeunit/11039-de
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 9784
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/9784
kind: pr
base_branch: main
major: "30"
merged_at: "2026-07-29T08:34:17Z"
author: Groenbech96
author_type: User
community_contribution: false
labels:
  - "Team: Integrations"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 5
  additions: 90
  deletions: 4
  al: 1
apps:
  - EDocumentDE
objects_touched:
  - key: codeunit/11039
    page: codeunit/11039-de
    type: codeunit
    id: 11039
    name: E-Document XRechnung Handler
    app: EDocumentDE
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 644279
systems:
  - integration
quote: null
joined_against:
  major: "30"
  commit: a4406cfa9e57437fedc49c53c327a199a854491e
---

# #9784 [E-Document Formats] Fix defects in V2 draft migration for XRechnung, PINT A-NZ and Factura-E

> Fixes defects in the V2 draft import for XRechnung, PINT A-NZ and Factura-E. Re-reading an XRechnung draft no longer duplicates lines, and unsupported root elements or namespaces are rejected. PINT A-NZ vendor-matching fallbacks now receive values. Credit notes and corrective invoices now map the original invoice reference so they can be applied.

[Pull request](https://github.com/microsoft/BCApps/pull/9784) · merged into `main` (BC30) on 2026-07-29 by Groenbech96 · 5 files (+90 -4), 1 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- XRechnung: ReadIntoDraft now calls ResetDraft, so re-runs no longer duplicate lines, and ResetDraft no longer errors when no draft header exists
- XRechnung: unsupported root elements or unexpected namespaces are now rejected with an error
- PINT A-NZ: vendor ID, name and address are now returned to the vendor-matching fallbacks, and credit notes map the billing reference to Applies-to Ext. Invoice No.
- Factura-E: the corrective invoice number now maps to Applies-to Ext. Invoice No. instead of Purchase Order No.
- Three XRechnung regression tests added, mirroring the OIOUBL suite
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 11039 "E-Document XRechnung Handler"](../../objects/codeunit/11039-de.md), EDocumentDE (DE layer): modified

## Context

- Work items: AB#644279
- Labels: Team: Integrations
- Systems: integration

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