eu_vat_rates_data 2026.9.29 → 2026.11.28
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 +4 -4
- data/data/eu-vat-rates-data.json +1 -1
- data/lib/eu_vat_rates_data/version.rb +1 -1
- data/lib/eu_vat_rates_data.rb +5 -2
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6427d5974387318da878edbebc919e64150742cae2bba873f7fec249d41ed82b
|
|
4
|
+
data.tar.gz: 14a2c1073b64c03cce5ada4e589a6063da089601795cfd43d2149af71ee90bad
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 87300dccf0e664190e800f5806f7f15ad954a0297e37a4675101d94e5515508784333cc1ebee0b196cb528c27ca27cf9363815d1e10f33904c69a36f97f9b72a
|
|
7
|
+
data.tar.gz: dcecd3ad1252370aa9f03a99c7915cc0ba39ca6c917db371da0e400b18183562ac439fb30c7a4fe6ae9592e4e541139bccbeff92b16e1bdccd9893f7387101a8
|
data/data/eu-vat-rates-data.json
CHANGED
data/lib/eu_vat_rates_data.rb
CHANGED
|
@@ -71,7 +71,7 @@ module EuVatRatesData
|
|
|
71
71
|
|
|
72
72
|
# Return true if vat_id matches the expected format for its country.
|
|
73
73
|
# Input must include the country code prefix (e.g. "ATU12345678").
|
|
74
|
-
# Returns false
|
|
74
|
+
# Returns false for unknown country codes or when the ID does not match.
|
|
75
75
|
# Note: Greece uses the "EL" prefix, not "GR".
|
|
76
76
|
# @param vat_id [String] VAT number string including country code prefix
|
|
77
77
|
# @return [Boolean]
|
|
@@ -82,7 +82,10 @@ module EuVatRatesData
|
|
|
82
82
|
code = "GR" if code == "EL"
|
|
83
83
|
rate = get_rate(code)
|
|
84
84
|
return false unless rate && rate["pattern"]
|
|
85
|
-
|
|
85
|
+
# Most patterns carry the country prefix; the rest (NO, TR, UA, ...) describe
|
|
86
|
+
# the number without it and are tested against the part after the code.
|
|
87
|
+
subject = rate["pattern"].match?(/\A\^[A-Z]{2}/) ? vat_id : vat_id[2..]
|
|
88
|
+
!!(subject.upcase =~ /\A#{rate["pattern"]}\z/)
|
|
86
89
|
end
|
|
87
90
|
|
|
88
91
|
# Return the ISO 8601 date when EU data was last fetched from EC TEDB.
|
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.
|
|
4
|
+
version: 2026.11.28
|
|
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-
|
|
11
|
+
date: 2026-11-28 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Daily-checked European VAT rates with standard and reduced rate types,
|
|
14
14
|
offline access, local VAT metadata, and VAT number format validation.
|