colissimo_label 0.17.0 → 0.18.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: b0418c3a7ede6f7d791adabea6b53e62aaf802d79158ba341ef237e16fdf05a2
4
- data.tar.gz: 4963bb501b435a6a57cb75f9012c99b8b2751aa4637fc6a6e4cb77d8c2a56691
3
+ metadata.gz: e85c64c5c035a54da59c9695851ad8be29dc0083353f10065dc2b35e9088ee5e
4
+ data.tar.gz: 863ca8375cdf9bacafde3fea451fd695051d3bee5b5b52d1f2f44c606637a441
5
5
  SHA512:
6
- metadata.gz: 27537e4c5f176cec0495a824252cf0d63d7a31c033ea3f9ba5f1bf7caf641fcec0a6f218ad2377ae2ff3698a00653e56ddad9d2bc04f4298b9c22ccabd0ad030
7
- data.tar.gz: 917e2721f7d594cc9d3ff995b0260bb454122138a3787dff7ef268b2911ec10ff130f82a2db725a1507a5cdafc7610657b21893361a6cccab3a0a7c61d96b4b3
6
+ metadata.gz: 395bd4aa3613b9e253dd641e38d74ed3205768e47ada8d6d07a06372225aa2afd5476b99c4736393b163192e405d832ef08059b3eabeef589a3877887d94e7a0
7
+ data.tar.gz: 4982d55a321d6579a3655c0a3306bd09396a34db819a410fc308931439701a55178da0bdee852674ec2becfa749a71a4c9eb363c1c7a10bcacdcd628f03088b9
@@ -1,3 +1,7 @@
1
+ ## 0.18.0
2
+
3
+ - Add new fields for UK after Brexit
4
+
1
5
  ## 0.17.0
2
6
 
3
7
  - Add Sweden to mandatory signature countries
@@ -17,6 +17,7 @@ class ColissimoLabel::GenerateLabel
17
17
  @customs_data = options.fetch(:customs_data, nil)
18
18
  @with_signature = options.fetch(:with_signature, false)
19
19
  @insurance_value = options.fetch(:insurance_value, nil)
20
+ @eori_number = options.fetch(:eori_number, nil)
20
21
  @label_output_format = options.fetch(:label_output_format, 'PDF_10x15_300dpi')
21
22
  @errors = []
22
23
  end
@@ -98,8 +99,9 @@ class ColissimoLabel::GenerateLabel
98
99
  "addressee": {
99
100
  "address": format_addressee
100
101
  }
101
- }.merge(customs)
102
- }.compact)
102
+ }.merge(customs_letter)
103
+ }.merge(customs_fields)
104
+ .compact)
103
105
  end
104
106
 
105
107
  # Services =>
@@ -168,7 +170,7 @@ class ColissimoLabel::GenerateLabel
168
170
  end
169
171
 
170
172
  # Déclaration douanière de type CN23
171
- def customs
173
+ def customs_letter
172
174
  if require_customs?
173
175
  {
174
176
  "customsDeclarations": {
@@ -203,8 +205,25 @@ class ColissimoLabel::GenerateLabel
203
205
  end
204
206
  end
205
207
 
208
+ def customs_fields
209
+ if require_customs?
210
+ {
211
+ "fields": {
212
+ "customField": [
213
+ {
214
+ "key": 'EORI',
215
+ "value": @eori_number
216
+ }
217
+ ]
218
+ }
219
+ }
220
+ else
221
+ {}
222
+ end
223
+ end
224
+
206
225
  def require_customs?
207
- %w[CH NO US].include?(@destination_country)
226
+ %w[CH NO US GB].include?(@destination_country)
208
227
  end
209
228
 
210
229
  # Certains pays, comme l'Allemagne, requiert une signature pour la livraison
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ColissimoLabel
4
- VERSION = '0.17.0'.freeze
4
+ VERSION = '0.18.0'.freeze
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: colissimo_label
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.0
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - FloXcoder
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-10-07 00:00:00.000000000 Z
11
+ date: 2021-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -182,7 +182,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
182
182
  - !ruby/object:Gem::Version
183
183
  version: '0'
184
184
  requirements: []
185
- rubygems_version: 3.1.3
185
+ rubygems_version: 3.2.4
186
186
  signing_key:
187
187
  specification_version: 4
188
188
  summary: Generate Colissimo label for all countries