eu_vat_rates_data 2026.8.13 → 2026.8.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c62370ff31248e9e8423a48b7ccf89e430cb44fa87611f8ab4c64f9eb4d8362d
4
- data.tar.gz: 67a77f3cdebffa3e96aad1ff9f3f7f359ea764cf8c1796b658886b1c41838429
3
+ metadata.gz: 748f3eb527912f5bf182c81af1656e505dc2445fe90a3a881ce1aff80590bffa
4
+ data.tar.gz: 5b562192f979b1875d153e788244a52ede61b060a8df9e405024cb2c954fa0f0
5
5
  SHA512:
6
- metadata.gz: 6aa11a7d0183249888ed564473a7160da82a3fd5047a545063914e2e3f3648600dc4648bfee3f08c570ac50c9e833415ef8ddd4fc644a30907f725cd16ae78d9
7
- data.tar.gz: caf20520cbae2ac8d9a6a3055a58eaaaba10174fed37d54a92a7f9d36008824161363fa824cc675810406e88ac74d9feae7149a4727be9137f7fb058848abd8f
6
+ metadata.gz: ec1701097ea85a055c75ffc06606d3fc0876f9de845290aadf99eddbe3b38b4055d5bb52b897a86d56a88f989d549987e1d13abaf5206c8aa160ce26e7f295a3
7
+ data.tar.gz: 633143e437f7be8eec9ce3198ed1afdffb69f892f3d081bdd683ed20c44cb4ea9215280158cc390a9487c92897016f406d32ba30315abe845aa10fd198b2aaf2
data/README.md CHANGED
@@ -110,6 +110,43 @@ EuVatRatesData.flag("XX") # => "" (empty string for unknown/invalid codes)
110
110
 
111
111
  ---
112
112
 
113
+ ## Example: charging VAT on an invoice
114
+
115
+ Rates on their own rarely answer the question you actually have, which is what
116
+ to put on the invoice. Two rules cover most of it: charge the buyer's domestic
117
+ rate, unless the sale is cross-border B2B inside the EU, where the reverse
118
+ charge applies and you invoice 0%.
119
+
120
+ ```ruby
121
+ # Money in minor units (cents). Never floats.
122
+ def invoice_total(net_cents, seller_country, buyer_country, buyer_vat_id = nil)
123
+ cross_border_b2b = buyer_country != seller_country &&
124
+ !buyer_vat_id.nil? &&
125
+ EuVatRatesData.valid_format?(buyer_vat_id)
126
+
127
+ return { vat_cents: 0, total_cents: net_cents, reverse_charge: true } if cross_border_b2b
128
+
129
+ rate = EuVatRatesData.get_standard_rate(buyer_country)
130
+ vat_cents = (net_cents * rate / 100.0).round
131
+
132
+ { vat_cents: vat_cents, total_cents: net_cents + vat_cents, reverse_charge: false }
133
+ end
134
+
135
+ # Domestic sale in Finland — 25.5%
136
+ invoice_total(10_000, 'FI', 'FI')
137
+ # => { vat_cents: 2550, total_cents: 12550, reverse_charge: false }
138
+
139
+ # Finnish seller, German business buyer — reverse charge
140
+ invoice_total(10_000, 'FI', 'DE', 'DE123456789')
141
+ # => { vat_cents: 0, total_cents: 10000, reverse_charge: true }
142
+ ```
143
+
144
+ `valid_format?` only checks the shape of the number. Applying the reverse charge
145
+ requires the buyer to actually be VAT-registered, which is a VIES lookup — see
146
+ above.
147
+
148
+ ---
149
+
113
150
  ## Data source & update frequency
114
151
 
115
152
  How the daily check works, and what changed when: [vatnode.dev/data](https://vatnode.dev/data?ref=rates-readme-rb).
@@ -1,6 +1,10 @@
1
1
  {
2
- "version": "2026-08-13",
2
+ "version": "2026-08-19",
3
3
  "source": "European Commission TEDB",
4
+ "publisher": {
5
+ "name": "vatnode.dev",
6
+ "url": "https://vatnode.dev"
7
+ },
4
8
  "rates": {
5
9
  "AD": {
6
10
  "country": "Andorra",
@@ -327,8 +331,8 @@
327
331
  ],
328
332
  "super_reduced": null,
329
333
  "parking": null,
330
- "format": "IE + 7 digits + 1–2 letters",
331
- "pattern": "^IE\\d{7}[A-W][A-IW]?$|^IE\\d[A-Z+*]\\d{5}[A-W]$"
334
+ "format": "IE + 7 digits + 1–2 letters, or IE + 1 digit + letter/+/* + 5 digits + 1 letter",
335
+ "pattern": "^IE\\d{7}[A-W][AH]?$|^IE\\d[A-Z+*]\\d{5}[A-W]$"
332
336
  },
333
337
  "IS": {
334
338
  "country": "Iceland",
@@ -1,3 +1,3 @@
1
1
  module EuVatRatesData
2
- VERSION = "2026.8.13"
2
+ VERSION = "2026.8.19"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eu_vat_rates_data
3
3
  version: !ruby/object:Gem::Version
4
- version: 2026.8.13
4
+ version: 2026.8.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Iurii Rogulia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-08-13 00:00:00.000000000 Z
11
+ date: 2026-08-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: VAT rates (standard, reduced, super-reduced, parking) for 45 European
14
14
  countries — EU-27 plus Norway, Switzerland, UK, and more. Includes eu_member flag,