Skip to content

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

Open
miljance wants to merge 1 commit intomicrosoft:mainfrom
miljance:EDocVATEXCodes
Open

[Bug]: xRechnung/ZUGFeRD export missing TaxExemptionReason and unsupported VATEX codes#29930
miljance wants to merge 1 commit intomicrosoft:mainfrom
miljance:EDocVATEXCodes

Conversation

@miljance
Copy link
Copy Markdown
Contributor

@miljance miljance commented Apr 10, 2026

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

@miljance miljance requested a review from a team as a code owner April 10, 2026 19:51
@miljance miljance requested a review from dmc-dk April 10, 2026 19:51
@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

linked Issue is linked to a Azure Boards work item

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant