Add support for exemption reasons as well as code#720
Add support for exemption reasons as well as code#720alvarolivie wants to merge 8 commits intomainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #720 +/- ##
==========================================
- Coverage 93.05% 93.03% -0.03%
==========================================
Files 333 333
Lines 17794 17881 +87
==========================================
+ Hits 16558 16635 +77
- Misses 870 875 +5
- Partials 366 371 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR enhances the EN 16931 addon to support exemption reason notes (BT-120) through a more flexible approach. Instead of using regime-specific scenarios that automatically inject notes, the addon now allows users to provide custom exemption notes that are automatically normalized with the appropriate tax category extensions. The PR also removes deprecated reverse-charge scenarios from the DE and FR regimes, as this functionality is now better handled by the EN16931 addon.
Changes:
- Added validation requiring exempt tax categories to have either a CEF VATEX code or an exemption note explaining the reason
- Implemented automatic normalization of notes with
srcfield matching tax keys (e.g., "exempt", "reverse-charge") to add theuntdid-tax-categoryextension - Removed reverse-charge scenarios from DE and FR regimes since EN16931 addon now handles this more flexibly
Reviewed changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| regimes/fr/scenarios.go | Deleted - removes reverse-charge scenario that added a hardcoded French note |
| regimes/fr/fr.go | Removes reference to invoiceScenarios |
| regimes/de/scenarios.go | Deleted - removes reverse-charge scenario that added a hardcoded German note |
| regimes/de/de.go | Removes reference to invoiceScenarios |
| data/regimes/fr.json | Generated file reflecting removal of scenarios from FR regime |
| data/regimes/de.json | Generated file reflecting removal of scenarios from DE regime |
| addons/eu/en16931/tax_combo.go | Adds validation preventing VATEX codes on non-exempt tax categories |
| addons/eu/en16931/tax_combo_test.go | Updates tests to cover new VATEX validation rules |
| addons/eu/en16931/org.go | Adds normalization logic to set untdid-tax-category extension on notes with tax key src values |
| addons/eu/en16931/en16931.go | Adds documentation explaining exemption notes requirements and usage |
| addons/eu/en16931/bill.go | Adds comprehensive validation for exemption notes including duplicate detection and orphan notes |
| addons/eu/en16931/bill_test.go | Adds extensive test coverage for exemption note validation scenarios |
| data/addons/eu-en16931-v2017.json | Generated file reflecting documentation updates to EN16931 addon |
| examples/de/invoice-de-es-xr.yaml | Updates example to use manual note with src field instead of tax tag |
| examples/de/out/invoice-de-es-xr.json | Generated output showing new note structure with untdid-tax-category extension |
| CHANGELOG.md | Documents the addition of exemption reason notes support |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Pre-Review Checklist
go generate .to ensure that the Schemas and Regime data are up to date.Only after checking off all the previous items: