valvat 0.7.4 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +1 -2
- data.tar.gz.sig +0 -0
- data/CHANGES.md +10 -1
- data/lib/valvat/checksum/ie.rb +21 -4
- data/lib/valvat/locales/de.yml +2 -2
- data/lib/valvat/locales/es.yml +1 -1
- data/lib/valvat/version.rb +1 -1
- data/spec/valvat/checksum/ie_spec.rb +4 -3
- metadata +3 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 79684651874cf4d58e4fa26f42f2d9d5cc50062ee037fb82ba8169e709c02362
|
4
|
+
data.tar.gz: ca34ff6b3180cafb8b2b3420f446b9d98bbb69332bd3154d26f310fbdae0aaa6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d099131f4af7e62d3d4e1299b30def47b673bd15008504548ca91d2857afc3dd6f8dc4b411016ab131e6c96919d58405a29a6ccb5f2693932c197ad7339e76ea
|
7
|
+
data.tar.gz: 7e47436428dfbb34a2b005b12de9d73f11ede715eb825aaf85f2b0a9012062950073ced9581a908002b4e8dc4e1d5fef22fe88fd2022b528072eb92ce668b89a
|
checksums.yaml.gz.sig
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
+�\��G_�E.Ѯ�R���Q��%)i"�����i��%�yT൝�bѦ�K��a��]i봿�0��� 1�ɢ'�m}6��(�M0��⎞�r��"�rq�������� ��rm�<�|�c��P�}��6]q�W���dw�cFԍ��
|
1
|
+
g��[~`�B5c8p������<��*{Ǐ`�?��J~�\���C]�����i�|���O9�И�U�� ͌�����l9�zgr�l<Ix9�܁�����\�8��{���;,\ʖ��\_l�hqy�Y�پzݩMnD �6��>s��Qo��OX�7�9[XKQ�L��?���M�ĜF�%ݹ�])�xv���'���7���'hY_y�ѽ��RN�c\]c�h�[��H��Ҵ#^���y� P�������
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGES.md
CHANGED
@@ -1,6 +1,15 @@
|
|
1
1
|
### dev
|
2
2
|
|
3
|
-
[full changelog](http://github.com/yolk/valvat/compare/v0.
|
3
|
+
[full changelog](http://github.com/yolk/valvat/compare/v0.8.0...master)
|
4
|
+
|
5
|
+
### 0.8.0 / 2019-07-19
|
6
|
+
|
7
|
+
[full changelog](http://github.com/yolk/valvat/compare/v0.7.4...v0.8.0)
|
8
|
+
|
9
|
+
* Added support for new IE vat number format, with 2 letters (by [lluis](https://github.com/lluis))
|
10
|
+
* Added support for spanish NIE Y and Z in checksums (by [descala](https://github.com/descala))
|
11
|
+
* Added catalan translation (by [descala](https://github.com/descala))
|
12
|
+
* Fixed spanish invalid vat message (by [descala](https://github.com/descala))
|
4
13
|
|
5
14
|
### 0.7.4 / 2018-11-21
|
6
15
|
|
data/lib/valvat/checksum/ie.rb
CHANGED
@@ -2,15 +2,23 @@ class Valvat
|
|
2
2
|
module Checksum
|
3
3
|
class IE < Base
|
4
4
|
def check_digit
|
5
|
-
sum_figures_by do |fig, i|
|
5
|
+
total = sum_figures_by do |fig, i|
|
6
6
|
fig*(i+2)
|
7
|
-
end
|
7
|
+
end
|
8
|
+
if str_wo_country.size == 9
|
9
|
+
total += (CHARS.index(str_wo_country[8]) * 9)
|
10
|
+
end
|
11
|
+
total.modulo(23)
|
8
12
|
end
|
9
13
|
|
10
14
|
CHARS = "WABCDEFGHIJKLMNOPQRSTUV".split("")
|
11
15
|
|
12
16
|
def given_check_digit
|
13
|
-
|
17
|
+
if str_wo_country.size == 9
|
18
|
+
CHARS.index(str_wo_country[7])
|
19
|
+
else
|
20
|
+
CHARS.index(given_check_digit_str)
|
21
|
+
end
|
14
22
|
end
|
15
23
|
|
16
24
|
def str_wo_country
|
@@ -22,6 +30,15 @@ class Valvat
|
|
22
30
|
str
|
23
31
|
end
|
24
32
|
end
|
33
|
+
|
34
|
+
def figures_str
|
35
|
+
if super.size == 8
|
36
|
+
super[0...-1]
|
37
|
+
else
|
38
|
+
super
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
25
42
|
end
|
26
43
|
end
|
27
|
-
end
|
44
|
+
end
|
data/lib/valvat/locales/de.yml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
de:
|
2
2
|
errors:
|
3
3
|
messages:
|
4
|
-
invalid_vat: ist keine gültige %{country_adjective}
|
4
|
+
invalid_vat: ist keine gültige %{country_adjective} USt-IdNr.
|
5
5
|
valvat:
|
6
6
|
country_adjectives:
|
7
7
|
eu: europäische
|
@@ -31,4 +31,4 @@ de:
|
|
31
31
|
ro: rumänische
|
32
32
|
se: schwedische
|
33
33
|
si: slowenische
|
34
|
-
sk: slowakische
|
34
|
+
sk: slowakische
|
data/lib/valvat/locales/es.yml
CHANGED
data/lib/valvat/version.rb
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Valvat::Checksum::IE do
|
4
|
-
%w(IE8473625E IE0123459N IE9B12345N
|
4
|
+
%w(IE8473625E IE0123459N IE9B12345N IE1113571MH IE2973912UH IE2974611LH
|
5
|
+
IE2974901UH IE3200115LH IE3206791MH IE3208913KH IE3214048CH).each do |valid_vat|
|
5
6
|
it "returns true on valid vat #{valid_vat}" do
|
6
|
-
expect(Valvat::Checksum.validate(valid_vat)).to eql(true)
|
7
|
+
expect(Valvat::Checksum.validate(valid_vat)).to eql(true), valid_vat
|
7
8
|
end
|
8
9
|
|
9
10
|
invalid_vat = "#{valid_vat[0..-4]}#{valid_vat[-2]}#{valid_vat[-3]}#{valid_vat[-1]}"
|
@@ -12,4 +13,4 @@ describe Valvat::Checksum::IE do
|
|
12
13
|
expect(Valvat::Checksum.validate(invalid_vat)).to eql(false)
|
13
14
|
end
|
14
15
|
end
|
15
|
-
end
|
16
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: valvat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Munz
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
+geYZL6mqiC8PV6OizVNrC3Y9HZVdmsF/le1wG2TOTPRwJwzazvHtiFR3ZQhWjNP
|
31
31
|
wsi9UxM8N9c=
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date:
|
33
|
+
date: 2019-07-19 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: savon
|
@@ -204,8 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
204
204
|
- !ruby/object:Gem::Version
|
205
205
|
version: '0'
|
206
206
|
requirements: []
|
207
|
-
|
208
|
-
rubygems_version: 2.7.6
|
207
|
+
rubygems_version: 3.0.3
|
209
208
|
signing_key:
|
210
209
|
specification_version: 4
|
211
210
|
summary: Validates european vat numbers. Standalone or as a ActiveModel validator.
|
metadata.gz.sig
CHANGED
Binary file
|