colissimo_label 0.17.0 → 0.18.0
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 +4 -0
- data/lib/colissimo_label/generate_label.rb +23 -4
- data/lib/colissimo_label/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e85c64c5c035a54da59c9695851ad8be29dc0083353f10065dc2b35e9088ee5e
|
|
4
|
+
data.tar.gz: 863ca8375cdf9bacafde3fea451fd695051d3bee5b5b52d1f2f44c606637a441
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 395bd4aa3613b9e253dd641e38d74ed3205768e47ada8d6d07a06372225aa2afd5476b99c4736393b163192e405d832ef08059b3eabeef589a3877887d94e7a0
|
|
7
|
+
data.tar.gz: 4982d55a321d6579a3655c0a3306bd09396a34db819a410fc308931439701a55178da0bdee852674ec2becfa749a71a4c9eb363c1c7a10bcacdcd628f03088b9
|
data/CHANGELOG.md
CHANGED
|
@@ -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(
|
|
102
|
-
}.
|
|
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
|
|
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
|
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.
|
|
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:
|
|
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.
|
|
185
|
+
rubygems_version: 3.2.4
|
|
186
186
|
signing_key:
|
|
187
187
|
specification_version: 4
|
|
188
188
|
summary: Generate Colissimo label for all countries
|