Skip to content
This repository was archived by the owner on Oct 19, 2026. It is now read-only.

[Bug]: xRechnung/ZUGFeRD export missing TaxExemptionReason and unsupported VATEX codes - #29930

Merged
Jesper Schulz-Wedde (JesperSchulz) merged 1 commit into
microsoft:mainfrom
miljance:EDocVATEXCodes
May 6, 2026
Merged

Jesper Schulz-Wedde (JesperSchulz) merged 1 commit into
microsoft:mainfrom
miljance:EDocVATEXCodes

Conversation

@miljance

@miljance Miljan Milosavljević (miljance) commented Apr 10, 2026 •

Copy link
Copy Markdown
Contributor

Important: Depending on : microsoft/BCApps#7640

Summary

VATEX Implementation:

  • Export dynamic VATEX code and tax exemption reason from VAT Posting Setup
  • Support 'Not Subject to VAT' (Category O) via VAT Clause integration
  • Added comprehensive test coverage for XRechnung and ZUGFeRD with all VATEX codes

EN16931 & BR-DE Compliance Fixes:

  • BR-O-02: Skip Seller/Buyer VAT ID only when ALL invoice lines are category 'O' (fixed critical bug: previously skipped if ANY line was 'O', breaking mixed invoices)
  • BR-O-05: Remove tax percent from line-level 'O' category elements
  • BR-DE-14: Always include tax percent at document level

Code Architecture:

  • Split tax category insertion into line-level and document-level procedures
  • Separated AllowanceCharge handling by context (6-param line-level, 11-param document-level)
  • Thread document language code to GetVATClauseInfo for localized exemption descriptions
  • Add IsTaxCategoryNotSubjectToVAT() helper to centralise the 'O' value

Files Changed:

  • XRechnung: Export logic refactored for UBL compliance
  • ZUGFeRD: CII format aligned with EN16931 requirements
  • Tests: Added VATEX scenarios for all supported exemption categories

Work Item(s)

Fixes #29863
Fixes AB#630660

@github-actions github-actions Bot added the linked Issue is linked to a Azure Boards work item label Apr 10, 2026
… rule fixes

**VATEX Implementation:**
- Export dynamic VATEX code and tax exemption reason from VAT Posting Setup
- Support 'Not Subject to VAT' (Category O) via VAT Clause integration
- Added comprehensive test coverage for XRechnung and ZUGFeRD with all VATEX codes

**EN16931 & BR-DE Compliance Fixes:**
- BR-O-02: Skip Seller/Buyer VAT ID only when ALL invoice lines are category 'O'
  (fixed critical bug: previously skipped if ANY line was 'O', breaking mixed invoices)
- BR-O-05: Remove tax percent from line-level 'O' category elements
- BR-DE-14: Always include tax percent at document level

**Code Architecture:**
- Split tax category insertion into line-level and document-level procedures
- Separated AllowanceCharge handling by context (6-param line-level, 11-param document-level)
- Thread document language code to GetVATClauseInfo for localized exemption descriptions
- Add IsTaxCategoryNotSubjectToVAT() helper to centralise the 'O' value

**Files Changed:**
- XRechnung: Export logic refactored for UBL compliance
- ZUGFeRD: CII format aligned with EN16931 requirements
- Tests: Added VATEX scenarios for all supported exemption categories
@JesperSchulz Jesper Schulz-Wedde (JesperSchulz) added the Finance GitHub request for Finance area label Apr 13, 2026
@JesperSchulz Jesper Schulz-Wedde (JesperSchulz) added the processing-PR The PR is currently being reviewed label Apr 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Processing this PR. The branch is now locked 🔒 Please don't push updates unless otherwise agreed.

@JesperSchulz

Copy link
Copy Markdown
Contributor

Compilation fails with:

App\Apps\DE\EDocumentDE\TempSource\app\src\ZUGFeRD\ExportZUGFeRDDocument.Codeunit.al(41,26): error AL0185: Codeunit 'PEPPOL VAT Helper' is missing
App\Apps\DE\EDocumentDE\TempSource\app\src\XRechnung\ExportXRechnungDocument.Codeunit.al(43,26): error AL0185: Codeunit 'PEPPOL VAT Helper' is missing

I cannot seem to find that 'PEPPOL VAT Helper'. Did I somehow revert something?

@JesperSchulz

Copy link
Copy Markdown
Contributor

Compilation fails with:

App\Apps\DE\EDocumentDE\TempSource\app\src\ZUGFeRD\ExportZUGFeRDDocument.Codeunit.al(41,26): error AL0185: Codeunit 'PEPPOL VAT Helper' is missing
App\Apps\DE\EDocumentDE\TempSource\app\src\XRechnung\ExportXRechnungDocument.Codeunit.al(43,26): error AL0185: Codeunit 'PEPPOL VAT Helper' is missing

I cannot seem to find that 'PEPPOL VAT Helper'. Did I somehow revert something?

Ah, this BCApps PR is still pending... Time to get that merged!
microsoft/BCApps#7640

@JesperSchulz
Jesper Schulz-Wedde (JesperSchulz) merged commit c56db41 into microsoft:main May 6, 2026
14 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Finance GitHub request for Finance area linked Issue is linked to a Azure Boards work item processing-PR The PR is currently being reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: xRechnung/ZUGFeRD export missing TaxExemptionReason and unsupported VATEX codes

3 participants