---
id: change/bcapps/9860
type: change
title: "#9860 [Bug]: [DE] XRechnung/ZUGFeRD - Item Charge lines exported without a valid unit of measure code (BR-CL-23 / BR-23 on BT-130)"
summary: Item charge lines are now correctly exported as allowances or charges in XRechnung and ZUGFeRD documents instead of fabricated invoice lines, with configurable mapping strategies to comply with EN 16931 validation rules.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - pageextension e-doc item charges de
  - codeunit e-document de helper
  - codeunit export xrechnung document
  - codeunit export zugferd document
  - permissionset e-doc. core - objects
  - tableextension e-doc. item charge
system: integration
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:06:15.279Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: 3170e9f6b457c4bf293b9de044547f09b31ebca9
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/9860
    title: "microsoft/BCApps#9860: [Bug]: [DE] XRechnung/ZUGFeRD - Item Charge lines exported without a valid unit of measure code (BR-CL-23 / BR-23 on BT-130)"
    date: "2026-09-05"
    commit: 3170e9f6b457c4bf293b9de044547f09b31ebca9
    t: null
    quote: null
links:
  learn: []
  objects:
    - object/pageextension/11036-de
    - object/codeunit/11038-de
    - object/codeunit/13916-de
    - object/codeunit/13917-de
    - object/permissionset/6100
    - object/tableextension/6536
    - object/pageextension/6537
    - object/enum/6535
    - object/codeunit/6246
    - object/enum/6534
    - object/table/6103
    - object/page/6133
    - object/enum/6533
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 9860
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/9860
kind: pr
base_branch: main
major: "30"
merged_at: "2026-09-05T18:48:10Z"
author: miljance
author_type: User
community_contribution: true
labels:
  - "ADO: Sync"
  - "AL: Apps (W1)"
  - From Fork
  - "Ownership: Needs Review"
  - "Team: Other"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 21
  additions: 5873
  deletions: 54
  al: 14
apps:
  - EDocument
  - EDocumentDE
objects_touched:
  - key: pageextension/11036
    page: pageextension/11036-de
    type: pageextension
    id: 11036
    name: E-Doc Item Charges DE
    app: EDocumentDE
    status: added
  - key: codeunit/11038
    page: codeunit/11038-de
    type: codeunit
    id: 11038
    name: E-Document DE Helper
    app: EDocumentDE
    status: modified
  - key: codeunit/13916
    page: codeunit/13916-de
    type: codeunit
    id: 13916
    name: Export XRechnung Document
    app: EDocumentDE
    status: modified
  - key: codeunit/13917
    page: codeunit/13917-de
    type: codeunit
    id: 13917
    name: Export ZUGFeRD Document
    app: EDocumentDE
    status: modified
  - key: permissionset/6100
    page: permissionset/6100
    type: permissionset
    id: 6100
    name: E-Doc. Core - Objects
    app: EDocument
    status: modified
  - key: tableextension/6536
    page: tableextension/6536
    type: tableextension
    id: 6536
    name: E-Doc. Item Charge
    app: EDocument
    status: added
  - key: pageextension/6537
    page: pageextension/6537
    type: pageextension
    id: 6537
    name: E-Doc. Item Charges
    app: EDocument
    status: added
  - key: enum/6535
    page: enum/6535
    type: enum
    id: 6535
    name: Item Charge Mapping Override
    app: EDocument
    status: added
  - key: codeunit/6246
    page: codeunit/6246
    type: codeunit
    id: 6246
    name: E-Doc. Item Charge Mapping
    app: EDocument
    status: added
  - key: enum/6534
    page: enum/6534
    type: enum
    id: 6534
    name: Item Charge E-Doc. Structure
    app: EDocument
    status: added
  - key: table/6103
    page: table/6103
    type: table
    id: 6103
    name: E-Document Service
    app: EDocument
    status: modified
  - key: page/6133
    page: page/6133
    type: page
    id: 6133
    name: E-Document Service
    app: EDocument
    status: modified
  - key: enum/6533
    page: enum/6533
    type: enum
    id: 6533
    name: Item Charge E-Invoice Mapping
    app: EDocument
    status: added
objects_unjoined:
  - path: src/Apps/DE/EDocumentDE/app/src/EDocumentServiceDE.PageExt.al
    status: modified
    reason: not-in-snapshot
obsoletions: []
backports:
  - number: 11099
    base: releases/29.x
    url: https://github.com/microsoft/BCApps/pull/11099
fixes_issues:
  - 8417
work_items:
  - 641600
systems:
  - integration
  - inventory
quote: null
joined_against:
  major: "30"
  commit: f18567dc08e2bd162bf192e1da4d714b57eb099f
---

# #9860 [Bug]: [DE] XRechnung/ZUGFeRD - Item Charge lines exported without a valid unit of measure code (BR-CL-23 / BR-23 on BT-130)

> Item charge lines are now correctly exported as allowances or charges in XRechnung and ZUGFeRD documents instead of fabricated invoice lines, with configurable mapping strategies to comply with EN 16931 validation rules.

[Pull request](https://github.com/microsoft/BCApps/pull/9860) · merged into `main` (BC30) on 2026-09-05 by miljance (community contribution) · 21 files (+5873 -54), 14 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- New Item Charge E-Invoice Mapping setting on E-Document Service: Automatic, document-level or line-level allowance/charge, or line with unit code
- Per-item-charge override for mapping, reason text, reason code and fallback unit code
- Automatic mode uses Value Entry assignments to choose line-level or document-level, with integration events to override the result
- XRechnung and ZUGFeRD exporters emit allowance/charge structures and adjust totals and tax subtotals accordingly
- Removes a duplicate features key that stopped the DE demo data app from compiling
- Behaviour changes for users or extensions.

## AL objects touched

- [Page extension 11036 "E-Doc Item Charges DE"](../../objects/pageextension/11036-de.md), EDocumentDE (DE layer): added
- [Codeunit 11038 "E-Document DE Helper"](../../objects/codeunit/11038-de.md), EDocumentDE (DE layer): modified
- [Codeunit 13916 "Export XRechnung Document"](../../objects/codeunit/13916-de.md), EDocumentDE (DE layer): modified
- [Codeunit 13917 "Export ZUGFeRD Document"](../../objects/codeunit/13917-de.md), EDocumentDE (DE layer): modified
- [Permission set 6100 "E-Doc. Core - Objects"](../../objects/permissionset/6100.md), EDocument: modified
- [Table extension 6536 "E-Doc. Item Charge"](../../objects/tableextension/6536.md), EDocument: added
- [Page extension 6537 "E-Doc. Item Charges"](../../objects/pageextension/6537.md), EDocument: added
- [Enum 6535 "Item Charge Mapping Override"](../../objects/enum/6535.md), EDocument: added
- [Codeunit 6246 "E-Doc. Item Charge Mapping"](../../objects/codeunit/6246.md), EDocument: added
- [Enum 6534 "Item Charge E-Doc. Structure"](../../objects/enum/6534.md), EDocument: added
- [Table 6103 "E-Document Service"](../../objects/table/6103.md), EDocument: modified
- [Page 6133 "E-Document Service"](../../objects/page/6133.md), EDocument: modified
- [Enum 6533 "Item Charge E-Invoice Mapping"](../../objects/enum/6533.md), EDocument: added
- `src/Apps/DE/EDocumentDE/app/src/EDocumentServiceDE.PageExt.al`: modified, not in the BC30 snapshot

## Also merged into

- [#11099](https://github.com/microsoft/BCApps/pull/11099) into `releases/29.x` on 2026-09-14

## Context

- Fixes: [#8417 [Bug]: [DE] XRechnung/ZUGFeRD - Item Charge lines exported without a valid unit of measure code (BR-CL-23 / BR-23 on BT-130)](https://github.com/microsoft/BCApps/issues/8417) (closed)
- Work items: AB#641600
- Labels: ADO: Sync, AL: Apps (W1), From Fork, Ownership: Needs Review, Team: Other
- Systems: integration, inventory

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