Skip to content

[Bug]: Add "VATEX Code" field to VAT Clause table in E-Document Core to support BT-121 (TaxExemptionReasonCode) export #7545

@miljance

Description

@miljance

Describe the issue

The E-Document Core app currently has no dedicated field on the VAT Clause table to store a structured VATEX exemption reason code (BT-121 per PEPPOL BIS Billing 3.0). As a result, any E-Document format implementation (xRechnung, ZUGFeRD, PEPPOL BIS, etc.) that needs to export cbc:TaxExemptionReasonCode has no reliable, standardised source field to read from in Business Central.

The [PEPPOL VATEX code list] defines dozens of specific machine-readable exemption codes (e.g., VATEX-EU-132-1I for education, VATEX-EU-AE for reverse charge, VATEX-EU-G for export outside the EU, VATEX-EU-IC for intra-community supply, etc.).

Currently, the VAT Clause table only holds a Code (used as a lookup key) and a Description (human-readable text). Neither is designed or intended to carry a structured VATEX code string. Format-specific implementations are therefore forced to either:

  • Hard-code a single VATEX code (e.g. VATEX-EU-O), or
  • Misuse the Code field of the VAT Clause as the VATEX code, which breaks the semantic purpose of that field.

The correct fix is to add a dedicated VATEX Code field to the VAT Clause table in E-Document Core, so that all E-Document format implementations can read from a single, well-defined field. The existing Description field on VAT Clause already maps naturally to BT-120 (cbc:TaxExemptionReason).

Expected behavior

A new field - VATEX Code (e.g. type Text[30] or Code[30]) - should be added to the VAT Clause table (and its corresponding page) in the E-Document Core app.

  • Users can populate this field with a valid VATEX code from the [CEF VATEX code list] (e.g. VATEX-EU-132-1I, VATEX-EU-AE, VATEX-EU-G, VATEX-EU-IC, VATEX-EU-O, etc.).
  • E-Document format implementations (xRechnung, ZUGFeRD, PEPPOL BIS, etc.) can then read VAT Clause."VATEX Code" as the source for cbc:TaxExemptionReasonCode (BT-121).
  • The existing VAT Clause.Description continues to serve as the source for cbc:TaxExemptionReason (BT-120).
  • When the VATEX Code field is blank, format implementations should fall back to their existing behaviour (no breaking change).

Steps to reproduce

  1. Open Business Central with E-Document Core installed.
  2. Navigate to VAT Clauses (search via Tell Me).
  3. Observe that the table and page have no field for a structured VATEX exemption reason code.
  4. Configure a VAT Posting Setup line with Tax Category = E and a VAT Clause assigned.
  5. Create and post a Sales Invoice that uses this VAT Posting Setup.
  6. Generate an E-Document (any format requiring BT-121 — xRechnung, ZUGFeRD, PEPPOL BIS).
  7. Inspect the exported XML:
    • Actual: cbc:TaxExemptionReasonCode is either missing or hard-coded by the format implementation — it cannot be driven by user configuration in E-Document Core.
    • Expected: cbc:TaxExemptionReasonCode should be populated from a dedicated VATEX Code field on the VAT Clause record linked to the invoice line.

Additional context

I will provide a fix for a bug

  • I will provide a fix for a bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    AI-TriageManually trigger or re-trigger an AI triage assessmentApprovedThe issue is approvedIntegrationGitHub request for Integration area

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions