Skip to content

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

@miljance

Description

@miljance

Describe the issue

Item Charges (lines with Type = Charge (Item)) on a Sales Invoice are exported as regular invoice lines (IncludedSupplyChainTradeLineItem in CII). This is acceptable - an invoice line is a valid representation for such a charge. The problem is the unit of measure field: because an item charge has no real unit, the export emits either an empty unit code or PCE. Both fail validation.

EN16931 requires every invoice line (BG-25) to carry a unit of measure code (BT-130), and that code must come from UN/ECE Recommendation 20 (with Rec 21 extension). An empty value violates BR-23, and PCE violates BR-CL-23.

Note: an alternative would be to remodel item charges as document-level or line-level AllowanceCharge elements (BG-20/BG-21/BG-27/BG-28). That is a larger semantic change and is not what this issue requests — the concrete defect is the missing/invalid unit code on the existing line.

Expected behavior

Item Charge lines should continue to be exported as invoice lines, but with a valid UN/ECE Rec 20 unit code. For a charge that has no physical unit of measure, the correct code is C62 ("one"). Emitting C62 resolves both BR-23 and BR-CL-23 while keeping the charge visible as a line item on the invoice.

Steps to reproduce

  1. Use Business Central for Germany with XRechnung or ZUGFeRD E-Document Service configured.
  2. Create a Sales Invoice with at least one normal item line.
  3. Add one or more Item Charge lines (Type = Charge (Item)), e.g. freight, packaging.
  4. Post the invoice and export the E-Document XML.
  5. Validate with an EN16931 / XRechnung validator (e.g. KoSIT / Mustang).
    • Actual result: The item charge line has an empty unit code (or PCE) on BilledQuantity → BR-23 / BR-CL-23 validation errors.
    • Expected result: The line carries unit code C62 and the document validates successfully.

Additional context

including @pri-kise and @marschmar into the loop.

I will provide a fix for a bug

  • I will provide a fix for a bug

Metadata

Metadata

Assignees

Labels

ApprovedThe issue is approvedFinanceGitHub request for Finance area

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions