Add Estonia (EE) tax regime - #871
Conversation
Add a new tax regime for Estonia covering VAT, following the structure of the existing EU regimes such as Austria. - VAT category with standard (24%), reduced (13%), super-reduced (9%) and zero rates. The standard rate keeps its historical values (20% from 2009, 22% from 2024, 24% from 2025) so past-dated invoices resolve correctly. - KMKR VAT identity validation: 9-digit format plus the mod-10 weighted checksum, with the EE prefix stripped during normalization. - Credit notes enabled for invoice corrections. Regenerated data/regimes/ee.json and registered the regime in regimes.go.
534ed50 to
dfac148
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #871 +/- ##
==========================================
- Coverage 94.76% 94.76% -0.01%
==========================================
Files 343 345 +2
Lines 18754 18887 +133
==========================================
+ Hits 17773 17898 +125
- Misses 597 601 +4
- Partials 384 388 +4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
samlown
left a comment
There was a problem hiding this comment.
Thanks for this! I'd just check the copy in the description, and the rate assignment.
| VAT (Käibemaks) is applied to most goods and services. The standard rate | ||
| is 24% since 1 July 2025, raised from 22% (in force since 1 January 2024), | ||
| which in turn replaced the long-standing 20% rate in force since 2009. |
There was a problem hiding this comment.
We usually try to avoid adding rates in the description as they're already defined in the tax categories and may become desynchronised.
| }, | ||
| { | ||
| // Higher reduced rate, currently applied to accommodation services. | ||
| Rate: tax.RateReduced, |
There was a problem hiding this comment.
This I think feels more like an "intermediate" rate as opposed to reduced.
| }, | ||
| { | ||
| // Lower reduced rate for books, press publications and certain medicines. | ||
| Rate: tax.RateSuperReduced, |
There was a problem hiding this comment.
This is probably "reduced", unless you see evidence for something different.
|
We also lost the PR checklist here. |
Summary
This PR adds a new tax regime for Estonia (EE). The motivation is the scenario in the assignment: a company already invoicing in one country opens a subsidiary in Estonia, which GOBL did not yet cover.
I used the existing EU regimes (Austria and Ireland) as structural references, since Estonia is an EU member state with a VAT system and the euro.
What's included
generalrate — 24% (current), with historical values kept so past-dated invoices still resolve: 22% since 2024-01-01 and 20% since 2009-07-01.reduced— 13% (accommodation services).super-reduced— 9% (books, press publications, certain medicines).zero— 0% (exports, intra-community supply).tax_identity.go):EE+ 9 digits, validated after the country prefix is stripped during normalization. Includes the mod-10 weighted checksum (weights[3,7,1,3,7,1,3,7]).regimes/regimes.go, generateddata/regimes/ee.json, and aCHANGELOG.mdentry.Tests
regimes/ee/tax_identity_test.go— table tests with real valid KMKR numbers and invalid cases (format, length, un-normalized prefix, bad checksum).regimes/ee/ee_test.go— sanity check of the regime definition.regimes_test.govalidates the newRegimeDefautomatically.Sources
VAT rates and effective dates come from the Estonian Tax and Customs Board (EMTA): https://www.emta.ee/en/business-client/taxes-and-payment/value-added-tax/vat-rates-and-supply-exempt-tax/standard-vat-rate
Scope — what I deliberately left out
To keep the change focused and reviewable, I limited it to what the law requires for correct invoicing, in line with the "minimum complexity for legal correctness" principle:
exempt,reverse-charge, etc.) already cover the common cases.Happy to extend any of the above if you'd prefer it in scope.