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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75ee107261db6f4aff8b02691a4808b85287da6e854847f2b4d18d9c5008fc0e
4
- data.tar.gz: ccac031f2420b719dd0837e799d318efcccebef8a7034526fb8b9d0d947f2550
3
+ metadata.gz: 79684651874cf4d58e4fa26f42f2d9d5cc50062ee037fb82ba8169e709c02362
4
+ data.tar.gz: ca34ff6b3180cafb8b2b3420f446b9d98bbb69332bd3154d26f310fbdae0aaa6
5
5
  SHA512:
6
- metadata.gz: edf21f82c687815c8c7bbd4ffdb043f13347a583937e4c8d6f64b34db983d266cc58357f27e999d56f6078e2290f1ed5512348e770c2412a473d4150b7b9ebf3
7
- data.tar.gz: d6bab56ac34a0df94a3f9fbd852d38c05f7ab7608714e2d67d8b2f5658915c9bdb790b652a67c25b493a0fac2311dae1b4a1a3d6345e7ca7ca7c533f138bd0ad
6
+ metadata.gz: d099131f4af7e62d3d4e1299b30def47b673bd15008504548ca91d2857afc3dd6f8dc4b411016ab131e6c96919d58405a29a6ccb5f2693932c197ad7339e76ea
7
+ data.tar.gz: 7e47436428dfbb34a2b005b12de9d73f11ede715eb825aaf85f2b0a9012062950073ced9581a908002b4e8dc4e1d5fef22fe88fd2022b528072eb92ce668b89a
@@ -1,2 +1 @@
1
- "x\�������x=��Lƻ�@߰T�.�+j��Iq��_g�,cjK'_��\BTE�-��D���U����߄�bp3K16E�$c��@E'�fw!���
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�� ͌�����l9zgrl<Ix9�܁�����\�8�� {���;,\ʖ��\_l�hqy�Y�پzݩMnD 6��>s��Qo��OX�7�9[XKQ �L��?���M�ĜF�%ݹ�])�xv���'���7���'hY_y�ѽ��RNc\]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.7.4...master)
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
 
@@ -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.modulo(23)
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
- CHARS.index(given_check_digit_str)
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
@@ -1,7 +1,7 @@
1
1
  de:
2
2
  errors:
3
3
  messages:
4
- invalid_vat: ist keine gültige %{country_adjective} UStId-Nr.
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
@@ -1,7 +1,7 @@
1
1
  es:
2
2
  errors:
3
3
  messages:
4
- invalid_vat: el número de IVA intracomunitario %{country_adjective} no es válido
4
+ invalid_vat: no es un número de IVA intracomunitario %{country_adjective} válido
5
5
  valvat:
6
6
  country_adjectives:
7
7
  eu: europeo
@@ -1,3 +1,3 @@
1
1
  class Valvat
2
- VERSION = "0.7.4"
2
+ VERSION = "0.8.0"
3
3
  end
@@ -1,9 +1,10 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Valvat::Checksum::IE do
4
- %w(IE8473625E IE0123459N IE9B12345N).each do |valid_vat|
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.7.4
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: 2018-11-22 00:00:00.000000000 Z
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
- rubyforge_project:
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