europe 0.0.23 → 0.0.25
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/CHANGELOG.md +8 -0
- data/lib/europe/vat/format.rb +1 -1
- data/lib/europe/vat/rates.rb +10 -10
- data/lib/europe/version.rb +1 -1
- data/test/europe/vat/rates_test.rb +2 -1
- 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: c7e224f623861cce105b5e91602123cdbeec0992108c5dd843bad10a4d6cd52c
|
4
|
+
data.tar.gz: 99c745e6dd699d362f2ac118cb7721e7b97523c42be29f2320a8c23924f5bebb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3bdcdc1ab6dcdafff3f2af14a745cfc8b644891948d6b00d0c2e2b6791893da866805e95f27a232c8f619f6a4d95fe58fe071afef4ac9d43fd3cd559537ef2fa
|
7
|
+
data.tar.gz: 95f2d2670eeb506298751d7e0de15ba544d19407fa10088c2d84b1a273df4a6871c2160fd481f74e57896f5ffada5bcd620dc9beb89f4f0731c72219a12943fa
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,14 @@
|
|
1
1
|
# Change Log
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
|
+
## 0.0.25
|
5
|
+
- A fix for Ireland's VAT numbers, https://github.com/gem-shards/europe.rb/pull/5, thank you again tim-vandecasteele
|
6
|
+
- [Full Changelog](https://github.com/gem-shards/europe.rb/compare/v0.0.24...v0.0.25)
|
7
|
+
## 0.0.24
|
8
|
+
- Changed source for retrieving VAT rates. (https://europa.eu/youreurope/business/taxation/vat/vat-rules-rates/index_en.htm)
|
9
|
+
- Removed UK from VAT rate fallbacks
|
10
|
+
- Updated VAT rates for Slovakia (SK) and Finland (FI)
|
11
|
+
- [Full Changelog](https://github.com/gem-shards/europe.rb/compare/v0.0.23...v0.0.24)
|
4
12
|
## 0.0.23
|
5
13
|
- Added support for new Belgium VAT numbers, thank you tim-vandecasteele
|
6
14
|
- [Full Changelog](https://github.com/gem-shards/europe.rb/compare/v0.0.22...v0.0.23)
|
data/lib/europe/vat/format.rb
CHANGED
data/lib/europe/vat/rates.rb
CHANGED
@@ -8,13 +8,12 @@ module Europe
|
|
8
8
|
module Rates
|
9
9
|
FALLBACK_RATES = {
|
10
10
|
AT: 20.0, BE: 21.0, BG: 20.0, CY: 19.0, CZ: 21.0, DE: 19.0, DK: 25.0, EE: 22.0,
|
11
|
-
EL: 24.0, ES: 21.0, FI:
|
11
|
+
EL: 24.0, ES: 21.0, FI: 25.5, FR: 20.0, HR: 25.0, HU: 27.0, IE: 23.0,
|
12
12
|
IT: 22.0, LT: 21.0, LU: 17.0, LV: 21.0, MT: 18.0, NL: 21.0, PL: 23.0, PT: 23.0,
|
13
|
-
RO: 19.0, SE: 25.0, SI: 22.0, SK:
|
13
|
+
RO: 19.0, SE: 25.0, SI: 22.0, SK: 23.0
|
14
14
|
}.freeze
|
15
|
-
RATES_URL = 'https://
|
16
|
-
'
|
17
|
-
'-electronic-services/vat-rates_en'
|
15
|
+
RATES_URL = 'https://europa.eu/youreurope/business/taxation/vat' \
|
16
|
+
'/vat-rules-rates/index_en.htm'
|
18
17
|
|
19
18
|
def self.retrieve
|
20
19
|
resp = fetch_rates
|
@@ -37,17 +36,18 @@ module Europe
|
|
37
36
|
xml.first.elements.each('tr') do |result|
|
38
37
|
next if result[3].nil?
|
39
38
|
|
40
|
-
rates = filter_rate(result, rates)
|
39
|
+
rates = filter_rate(result, rates || {})
|
41
40
|
end
|
42
41
|
rates
|
43
42
|
end
|
44
43
|
# rubocop:enable Metrics/MethodLength
|
45
44
|
|
46
45
|
def self.filter_rate(result, rates)
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
46
|
+
return unless result[1].text.size == 2
|
47
|
+
|
48
|
+
country = result[1].text
|
49
|
+
rate = result[5].text
|
50
|
+
rates[country.to_sym] = rate.to_f if country && rate
|
51
51
|
rates
|
52
52
|
end
|
53
53
|
|
data/lib/europe/version.rb
CHANGED
@@ -15,7 +15,8 @@ module Europe
|
|
15
15
|
def test_retrieval_of_vat_rates
|
16
16
|
rates = Europe::Vat::Rates.retrieve
|
17
17
|
|
18
|
-
|
18
|
+
# Remove UK from VAT rates
|
19
|
+
assert_equal rates.count, (Europe::Countries::COUNTRIES.keys - [:UK]).count
|
19
20
|
|
20
21
|
assert rates[:NL]
|
21
22
|
assert rates[:DE]
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: europe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gem shards
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: byebug
|