eancom 0.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.DS_Store +0 -0
- data/.gitignore +187 -6
- data/.gitlab-ci.yml +27 -0
- data/.rspec_status +225 -0
- data/.rubocop.yml +2 -0
- data/.ruby-version +1 -0
- data/Gemfile +4 -2
- data/Gemfile.lock +87 -3
- data/bin/console +3 -2
- data/definitions/desadv/d01b.rb +205 -0
- data/definitions/desadv/d96a.rb +108 -73
- data/definitions/segments/alc.rb +236 -0
- data/definitions/segments/ali.rb +93 -0
- data/definitions/segments/bgm.rb +267 -0
- data/definitions/segments/cav.rb +122 -0
- data/definitions/segments/cci.rb +136 -0
- data/definitions/segments/cnt.rb +78 -0
- data/definitions/segments/cps.rb +76 -0
- data/definitions/segments/cux.rb +167 -0
- data/definitions/segments/dtm.rb +159 -0
- data/definitions/segments/ftx.rb +143 -0
- data/definitions/segments/imd.rb +356 -0
- data/definitions/segments/lin.rb +113 -0
- data/definitions/segments/loc.rb +89 -0
- data/definitions/segments/mea.rb +189 -0
- data/definitions/segments/moa.rb +144 -0
- data/definitions/segments/nad.rb +254 -0
- data/definitions/segments/pac.rb +250 -0
- data/definitions/segments/pgi.rb +148 -0
- data/definitions/segments/pia.rb +501 -0
- data/definitions/segments/pri.rb +188 -0
- data/definitions/segments/qty.rb +79 -0
- data/definitions/segments/rff.rb +166 -0
- data/definitions/segments/tax.rb +259 -0
- data/definitions/segments/tdt.rb +254 -0
- data/definitions/segments/una.rb +85 -0
- data/definitions/segments/unb.rb +284 -0
- data/definitions/segments/unh.rb +118 -0
- data/definitions/segments/uns.rb +40 -0
- data/definitions/segments/unt.rb +48 -0
- data/definitions/segments/unz.rb +48 -0
- data/definitions/slsrpt/d01b.rb +201 -0
- data/definitions/slsrpt/d96a.rb +194 -0
- data/eancom.gemspec +9 -5
- data/lib/eancom/definition.rb +1 -1
- data/lib/eancom/edifact/body.rb +63 -0
- data/lib/eancom/edifact/composite.rb +38 -0
- data/lib/eancom/edifact/data.rb +108 -0
- data/lib/eancom/edifact/document.rb +43 -11
- data/lib/eancom/edifact/document_element.rb +26 -0
- data/lib/eancom/edifact/footer.rb +6 -0
- data/lib/eancom/edifact/header.rb +15 -0
- data/lib/eancom/edifact/item.rb +40 -0
- data/lib/eancom/edifact/message.rb +24 -16
- data/lib/eancom/edifact/segment.rb +131 -12
- data/lib/eancom/edifact/segments/alc.rb +61 -0
- data/lib/eancom/edifact/segments/ali.rb +52 -0
- data/lib/eancom/edifact/segments/bgm.rb +45 -0
- data/lib/eancom/edifact/segments/cav.rb +47 -0
- data/lib/eancom/edifact/segments/cci.rb +53 -0
- data/lib/eancom/edifact/segments/cnt.rb +33 -0
- data/lib/eancom/edifact/segments/cps.rb +30 -0
- data/lib/eancom/edifact/segments/cux.rb +60 -0
- data/lib/eancom/edifact/segments/dtm.rb +43 -0
- data/lib/eancom/edifact/segments/ftx.rb +63 -0
- data/lib/eancom/edifact/segments/imd.rb +69 -0
- data/lib/eancom/edifact/segments/lin.rb +43 -0
- data/lib/eancom/edifact/segments/loc.rb +43 -0
- data/lib/eancom/edifact/segments/mea.rb +53 -0
- data/lib/eancom/edifact/segments/moa.rb +45 -0
- data/lib/eancom/edifact/segments/nad.rb +107 -0
- data/lib/eancom/edifact/segments/pac.rb +54 -0
- data/lib/eancom/edifact/segments/pgi.rb +45 -0
- data/lib/eancom/edifact/segments/pia.rb +107 -0
- data/lib/eancom/edifact/segments/pri.rb +54 -0
- data/lib/eancom/edifact/segments/qty.rb +40 -0
- data/lib/eancom/edifact/segments/rff.rb +41 -0
- data/lib/eancom/edifact/segments/tax.rb +72 -0
- data/lib/eancom/edifact/segments/tdt.rb +54 -0
- data/lib/eancom/edifact/segments/una.rb +51 -0
- data/lib/eancom/edifact/segments/unb.rb +69 -0
- data/lib/eancom/edifact/segments/unh.rb +46 -0
- data/lib/eancom/edifact/segments/uns.rb +29 -0
- data/lib/eancom/edifact/segments/unt.rb +28 -0
- data/lib/eancom/edifact/segments/unz.rb +28 -0
- data/lib/eancom/edifact/structure.rb +91 -0
- data/lib/eancom/edifact.rb +45 -12
- data/lib/eancom/factory.rb +8 -7
- data/lib/eancom/parser/document.rb +68 -0
- data/lib/eancom/parser/segment.rb +71 -0
- data/lib/eancom/parser.rb +7 -0
- data/lib/eancom/version.rb +1 -1
- data/lib/eancom.rb +59 -16
- metadata +138 -5
- data/lib/eancom/edifact/element.rb +0 -16
- data/lib/eancom/edifact/envelope.rb +0 -24
@@ -0,0 +1,501 @@
|
|
1
|
+
tag = 'PIA'
|
2
|
+
Eancom.register_segment(tag: tag, klass: Eancom::Edifact::PIA)
|
3
|
+
|
4
|
+
structure = Eancom::Edifact::Structure.new(tag: tag)
|
5
|
+
#==============================================================================
|
6
|
+
# Tag #
|
7
|
+
#==============================================================================
|
8
|
+
tag = Eancom::Edifact::Composite.new()
|
9
|
+
data = Eancom::Edifact::Data.new(
|
10
|
+
type: String,
|
11
|
+
length: 3,
|
12
|
+
description: "Message Header",
|
13
|
+
required: true
|
14
|
+
)
|
15
|
+
tag.add(:tag, data)
|
16
|
+
|
17
|
+
structure << tag
|
18
|
+
#==============================================================================
|
19
|
+
# Product Identifier Code Qualifier #
|
20
|
+
#==============================================================================
|
21
|
+
product_identifier_code_qualifier = Eancom::Edifact::Composite.new()
|
22
|
+
|
23
|
+
data = Eancom::Edifact::Data.new(
|
24
|
+
type: String,
|
25
|
+
length: 1..3,
|
26
|
+
dictionary: {
|
27
|
+
'1' => {
|
28
|
+
description: 'Additional information',
|
29
|
+
identifier: 'additional_information'
|
30
|
+
},
|
31
|
+
'3' => {
|
32
|
+
description: 'Substituted by',
|
33
|
+
identifier: 'substituted_by'
|
34
|
+
},
|
35
|
+
'4' => {
|
36
|
+
description: 'Substituted for',
|
37
|
+
identifier: 'substituted_for'
|
38
|
+
},
|
39
|
+
'5' => {
|
40
|
+
description: 'Product identification',
|
41
|
+
identifier: 'product_identification'
|
42
|
+
}
|
43
|
+
},
|
44
|
+
description: 'product identifier code qualifier',
|
45
|
+
required: true
|
46
|
+
)
|
47
|
+
product_identifier_code_qualifier.add(:product_identifier_code_qualifier, data)
|
48
|
+
|
49
|
+
structure << product_identifier_code_qualifier
|
50
|
+
#==============================================================================
|
51
|
+
# Item Number Identification 1 #
|
52
|
+
#==============================================================================
|
53
|
+
item_number_identification_1 = Eancom::Edifact::Composite.new()
|
54
|
+
|
55
|
+
data = Eancom::Edifact::Data.new(
|
56
|
+
type: String,
|
57
|
+
length: 1..35,
|
58
|
+
description: "Despatch Advice number assigned by the document sender.\nFor global unique identification of documents Global Document Identifier (GDTI) is available.",
|
59
|
+
required: true
|
60
|
+
)
|
61
|
+
item_number_identification_1.add(:item_identifier_1, data)
|
62
|
+
|
63
|
+
data = Eancom::Edifact::Data.new(
|
64
|
+
type: String,
|
65
|
+
length: 1..3,
|
66
|
+
dictionary: {
|
67
|
+
'AC' => {
|
68
|
+
description: 'HIBC (Health Industry Bar Code)',
|
69
|
+
identifier: 'hibc'
|
70
|
+
},
|
71
|
+
'CG' => {
|
72
|
+
description: 'Commodity grouping',
|
73
|
+
identifier: 'commoditiy grouping'
|
74
|
+
},
|
75
|
+
'IB' => {
|
76
|
+
description: 'ISBN (International Standard Book Number)',
|
77
|
+
identifier: 'isbn'
|
78
|
+
},
|
79
|
+
'IN' => {
|
80
|
+
description: "Buyer's item number",
|
81
|
+
identifier: 'buyers_item_number'
|
82
|
+
},
|
83
|
+
'HS' => {
|
84
|
+
description: "Harmonised system",
|
85
|
+
identifier: 'harmonised_system'
|
86
|
+
},
|
87
|
+
'GD' => {
|
88
|
+
description: "Industry sector article group number/product classification code (GS1 Code)",
|
89
|
+
identifier: 'industry_sector_article_group_number_product_classification_code'
|
90
|
+
},
|
91
|
+
'GU' => {
|
92
|
+
description: "Supplier's internal article group number/product classification code (GS1 Code)",
|
93
|
+
identifier: 'suppliers_internal_article_group_number_product_classification_code'
|
94
|
+
},
|
95
|
+
'PV' => {
|
96
|
+
description: 'Promotional variant number',
|
97
|
+
identifier: 'promotional_variant_number'
|
98
|
+
},
|
99
|
+
'SA' => {
|
100
|
+
description: "Supplier's article number",
|
101
|
+
identifier: 'suppliers_article_number'
|
102
|
+
},
|
103
|
+
'SRV' => {
|
104
|
+
description: 'GS1 Global Trade Item Number',
|
105
|
+
identifier: 'gs1_global_trade_item_number'
|
106
|
+
},
|
107
|
+
'SRX' => {
|
108
|
+
description: 'Slaughter number',
|
109
|
+
identifier: 'slaughter_number'
|
110
|
+
},
|
111
|
+
'X2' => {
|
112
|
+
description: 'Ear-tag number (GS1 Temporary Code)',
|
113
|
+
identifier: 'ear_tag_number'
|
114
|
+
}
|
115
|
+
},
|
116
|
+
description: 'Item type identification code',
|
117
|
+
required: true
|
118
|
+
)
|
119
|
+
item_number_identification_1.add(:item_type_identification_code_1, data)
|
120
|
+
|
121
|
+
data = Eancom::Edifact::Data.new(
|
122
|
+
type: String,
|
123
|
+
length: 0..17,
|
124
|
+
description: "Code list identification code",
|
125
|
+
required: false
|
126
|
+
)
|
127
|
+
item_number_identification_1.add(:code_list_identification_code_1, data)
|
128
|
+
|
129
|
+
data = Eancom::Edifact::Data.new(
|
130
|
+
type: String,
|
131
|
+
length: 0..3,
|
132
|
+
dictionary: {
|
133
|
+
'9' => {
|
134
|
+
description: 'GS1',
|
135
|
+
identifier: 'gs1'
|
136
|
+
},
|
137
|
+
'91' => {
|
138
|
+
description: "Assigned by supplier or supplier's agent",
|
139
|
+
identifier: 'assigned_by_supplier_or_suppliers_agent'
|
140
|
+
},
|
141
|
+
'92' => {
|
142
|
+
description: "Assigned by buyer or buyer's agent",
|
143
|
+
identifier: 'assigned_by_buyer_or_buyers_agent'
|
144
|
+
}
|
145
|
+
},
|
146
|
+
description: "Code list responsible agency code",
|
147
|
+
required: false
|
148
|
+
)
|
149
|
+
item_number_identification_1.add(:code_list_responsible_agency_code_1, data)
|
150
|
+
|
151
|
+
structure << item_number_identification_1
|
152
|
+
#==============================================================================
|
153
|
+
# Item Number Identification 2 #
|
154
|
+
#==============================================================================
|
155
|
+
item_number_identification_2 = Eancom::Edifact::Composite.new()
|
156
|
+
|
157
|
+
data = Eancom::Edifact::Data.new(
|
158
|
+
type: String,
|
159
|
+
length: 1..35,
|
160
|
+
description: "Despatch Advice number assigned by the document sender.\nFor global unique identification of documents Global Document Identifier (GDTI) is available.",
|
161
|
+
required: true
|
162
|
+
)
|
163
|
+
item_number_identification_2.add(:item_identifier_2, data)
|
164
|
+
|
165
|
+
data = Eancom::Edifact::Data.new(
|
166
|
+
type: String,
|
167
|
+
length: 1..3,
|
168
|
+
dictionary: {
|
169
|
+
'AC' => {
|
170
|
+
description: 'HIBC (Health Industry Bar Code)',
|
171
|
+
identifier: 'hibc'
|
172
|
+
},
|
173
|
+
'IB' => {
|
174
|
+
description: 'ISBN (International Standard Book Number)',
|
175
|
+
identifier: 'isbn'
|
176
|
+
},
|
177
|
+
'IN' => {
|
178
|
+
description: "Buyer's item number",
|
179
|
+
identifier: 'buyers_item_number'
|
180
|
+
},
|
181
|
+
'PV' => {
|
182
|
+
description: 'Promotional variant number',
|
183
|
+
identifier: 'promotional_variant_number'
|
184
|
+
},
|
185
|
+
'SA' => {
|
186
|
+
description: "Supplier's article number",
|
187
|
+
identifier: 'suppliers_article_number'
|
188
|
+
},
|
189
|
+
'SRV' => {
|
190
|
+
description: 'GS1 Global Trade Item Number',
|
191
|
+
identifier: 'gs1_global_trade_item_number'
|
192
|
+
},
|
193
|
+
'SRX' => {
|
194
|
+
description: 'Slaughter number',
|
195
|
+
identifier: 'slaughter_number'
|
196
|
+
},
|
197
|
+
'GU' => {
|
198
|
+
description: "Supplier's internal article group number/product classification code (GS1 Code)",
|
199
|
+
identifier: 'suppliers_internal_article_group_number_product_classification_code'
|
200
|
+
},
|
201
|
+
'X2' => {
|
202
|
+
description: 'Ear-tag number (GS1 Temporary Code)',
|
203
|
+
identifier: 'ear_tag_number'
|
204
|
+
}
|
205
|
+
},
|
206
|
+
description: 'Item type identification code',
|
207
|
+
required: true
|
208
|
+
)
|
209
|
+
item_number_identification_2.add(:item_type_identification_code_2, data)
|
210
|
+
|
211
|
+
data = Eancom::Edifact::Data.new(
|
212
|
+
type: String,
|
213
|
+
length: 0..17,
|
214
|
+
description: "Code list identification code",
|
215
|
+
required: false
|
216
|
+
)
|
217
|
+
item_number_identification_2.add(:code_list_identification_code_2, data)
|
218
|
+
|
219
|
+
data = Eancom::Edifact::Data.new(
|
220
|
+
type: String,
|
221
|
+
length: 0..3,
|
222
|
+
dictionary: {
|
223
|
+
'9' => {
|
224
|
+
description: 'GS1',
|
225
|
+
identification: 'gs1'
|
226
|
+
},
|
227
|
+
'91' => {
|
228
|
+
description: "Assigned by supplier or supplier's agent",
|
229
|
+
identification: 'assigned_by_supplier_or_suppliers_agent'
|
230
|
+
},
|
231
|
+
'92' => {
|
232
|
+
description: "Assigned by buyer or buyer's agent",
|
233
|
+
identification: 'assigned_by_buyer_or_buyers_agent'
|
234
|
+
}
|
235
|
+
},
|
236
|
+
description: "Code list responsible agency code",
|
237
|
+
required: false
|
238
|
+
)
|
239
|
+
item_number_identification_2.add(:code_list_responsible_agency_code_2, data)
|
240
|
+
|
241
|
+
structure << item_number_identification_2
|
242
|
+
#==============================================================================
|
243
|
+
# Item Number Identification 3 #
|
244
|
+
#==============================================================================
|
245
|
+
item_number_identification_3 = Eancom::Edifact::Composite.new()
|
246
|
+
|
247
|
+
data = Eancom::Edifact::Data.new(
|
248
|
+
type: String,
|
249
|
+
length: 1..35,
|
250
|
+
description: "Despatch Advice number assigned by the document sender.\nFor global unique identification of documents Global Document Identifier (GDTI) is available.",
|
251
|
+
required: true
|
252
|
+
)
|
253
|
+
item_number_identification_3.add(:item_identifier_3, data)
|
254
|
+
|
255
|
+
data = Eancom::Edifact::Data.new(
|
256
|
+
type: String,
|
257
|
+
length: 1..3,
|
258
|
+
dictionary: {
|
259
|
+
'AC' => {
|
260
|
+
description: 'HIBC (Health Industry Bar Code)',
|
261
|
+
identifier: 'hibc'
|
262
|
+
},
|
263
|
+
'IB' => {
|
264
|
+
description: 'ISBN (International Standard Book Number)',
|
265
|
+
identifier: 'isbn'
|
266
|
+
},
|
267
|
+
'IN' => {
|
268
|
+
description: "Buyer's item number",
|
269
|
+
identifier: 'buyers_item_number'
|
270
|
+
},
|
271
|
+
'PV' => {
|
272
|
+
description: 'Promotional variant number',
|
273
|
+
identifier: 'promotional_variant_number'
|
274
|
+
},
|
275
|
+
'SA' => {
|
276
|
+
description: "Supplier's article number",
|
277
|
+
identifier: 'suppliers_article_number'
|
278
|
+
},
|
279
|
+
'SRV' => {
|
280
|
+
description: 'GS1 Global Trade Item Number',
|
281
|
+
identifier: 'gs1_global_trade_item_number'
|
282
|
+
},
|
283
|
+
'SRX' => {
|
284
|
+
description: 'Slaughter number',
|
285
|
+
identifier: 'slaughter_number'
|
286
|
+
},
|
287
|
+
'X2' => {
|
288
|
+
description: 'Ear-tag number (GS1 Temporary Code)',
|
289
|
+
identifier: 'ear_tag_number'
|
290
|
+
}
|
291
|
+
},
|
292
|
+
description: 'Item type identification code',
|
293
|
+
required: true
|
294
|
+
)
|
295
|
+
item_number_identification_3.add(:item_type_identification_code_3, data)
|
296
|
+
|
297
|
+
data = Eancom::Edifact::Data.new(
|
298
|
+
type: String,
|
299
|
+
length: 0..17,
|
300
|
+
description: "Code list identification code",
|
301
|
+
required: false
|
302
|
+
)
|
303
|
+
item_number_identification_3.add(:code_list_identification_code_3, data)
|
304
|
+
|
305
|
+
data = Eancom::Edifact::Data.new(
|
306
|
+
type: String,
|
307
|
+
length: 0..3,
|
308
|
+
dictionary: {
|
309
|
+
'9' => {
|
310
|
+
description: 'GS1',
|
311
|
+
identification: 'gs1'
|
312
|
+
},
|
313
|
+
'91' => {
|
314
|
+
description: "Assigned by supplier or supplier's agent",
|
315
|
+
identification: 'assigned_by_supplier_or_suppliers_agent'
|
316
|
+
},
|
317
|
+
'92' => {
|
318
|
+
description: "Assigned by buyer or buyer's agent",
|
319
|
+
identification: 'assigned_by_buyer_or_buyers_agent'
|
320
|
+
}
|
321
|
+
},
|
322
|
+
description: "Code list responsible agency code",
|
323
|
+
required: false
|
324
|
+
)
|
325
|
+
item_number_identification_3.add(:code_list_responsible_agency_code_3, data)
|
326
|
+
|
327
|
+
structure << item_number_identification_3
|
328
|
+
#==============================================================================
|
329
|
+
# Item Number Identification 4 #
|
330
|
+
#==============================================================================
|
331
|
+
item_number_identification_4 = Eancom::Edifact::Composite.new()
|
332
|
+
|
333
|
+
data = Eancom::Edifact::Data.new(
|
334
|
+
type: String,
|
335
|
+
length: 1..35,
|
336
|
+
description: "Despatch Advice number assigned by the document sender.\nFor global unique identification of documents Global Document Identifier (GDTI) is available.",
|
337
|
+
required: true
|
338
|
+
)
|
339
|
+
item_number_identification_4.add(:item_identifier_4, data)
|
340
|
+
|
341
|
+
data = Eancom::Edifact::Data.new(
|
342
|
+
type: String,
|
343
|
+
length: 1..3,
|
344
|
+
dictionary: {
|
345
|
+
'AC' => {
|
346
|
+
description: 'HIBC (Health Industry Bar Code)',
|
347
|
+
identifier: 'hibc'
|
348
|
+
},
|
349
|
+
'IB' => {
|
350
|
+
description: 'ISBN (International Standard Book Number)',
|
351
|
+
identifier: 'isbn'
|
352
|
+
},
|
353
|
+
'IN' => {
|
354
|
+
description: "Buyer's item number",
|
355
|
+
identifier: 'buyers_item_number'
|
356
|
+
},
|
357
|
+
'PV' => {
|
358
|
+
description: 'Promotional variant number',
|
359
|
+
identifier: 'promotional_variant_number'
|
360
|
+
},
|
361
|
+
'SA' => {
|
362
|
+
description: "Supplier's article number",
|
363
|
+
identifier: 'suppliers_article_number'
|
364
|
+
},
|
365
|
+
'SRV' => {
|
366
|
+
description: 'GS1 Global Trade Item Number',
|
367
|
+
identifier: 'gs1_global_trade_item_number'
|
368
|
+
},
|
369
|
+
'SRX' => {
|
370
|
+
description: 'Slaughter number',
|
371
|
+
identifier: 'slaughter_number'
|
372
|
+
},
|
373
|
+
'X2' => {
|
374
|
+
description: 'Ear-tag number (GS1 Temporary Code)',
|
375
|
+
identifier: 'ear_tag_number'
|
376
|
+
}
|
377
|
+
},
|
378
|
+
description: 'Item type identification code',
|
379
|
+
required: true
|
380
|
+
)
|
381
|
+
item_number_identification_4.add(:item_type_identification_code_4, data)
|
382
|
+
|
383
|
+
data = Eancom::Edifact::Data.new(
|
384
|
+
type: String,
|
385
|
+
length: 0..17,
|
386
|
+
description: "Code list identification code",
|
387
|
+
required: false
|
388
|
+
)
|
389
|
+
item_number_identification_4.add(:code_list_identification_code_4, data)
|
390
|
+
|
391
|
+
data = Eancom::Edifact::Data.new(
|
392
|
+
type: String,
|
393
|
+
length: 0..3,
|
394
|
+
dictionary: {
|
395
|
+
'9' => {
|
396
|
+
description: 'GS1',
|
397
|
+
identifier: 'gs1'
|
398
|
+
},
|
399
|
+
'91' => {
|
400
|
+
description: "Assigned by supplier or supplier's agent",
|
401
|
+
identifier: 'assigned_by_supplier_or_suppliers_agent'
|
402
|
+
},
|
403
|
+
'92' => {
|
404
|
+
description: "Assigned by buyer or buyer's agent",
|
405
|
+
identifier: 'assigned_by_buyer_or_buyers_agent'
|
406
|
+
}
|
407
|
+
},
|
408
|
+
description: "Code list responsible agency code",
|
409
|
+
required: false
|
410
|
+
)
|
411
|
+
item_number_identification_4.add(:code_list_responsible_agency_code_4, data)
|
412
|
+
|
413
|
+
structure << item_number_identification_4
|
414
|
+
#==============================================================================
|
415
|
+
# Item Number Identification 5 #
|
416
|
+
#==============================================================================
|
417
|
+
item_number_identification_5 = Eancom::Edifact::Composite.new()
|
418
|
+
|
419
|
+
data = Eancom::Edifact::Data.new(
|
420
|
+
type: String,
|
421
|
+
length: 1..35,
|
422
|
+
description: "Despatch Advice number assigned by the document sender.\nFor global unique identification of documents Global Document Identifier (GDTI) is available.",
|
423
|
+
required: true
|
424
|
+
)
|
425
|
+
item_number_identification_5.add(:item_identifier_5, data)
|
426
|
+
|
427
|
+
data = Eancom::Edifact::Data.new(
|
428
|
+
type: String,
|
429
|
+
length: 1..3,
|
430
|
+
dictionary: {
|
431
|
+
'AC' => {
|
432
|
+
description: 'HIBC (Health Industry Bar Code)',
|
433
|
+
identifier: 'hibc'
|
434
|
+
},
|
435
|
+
'IB' => {
|
436
|
+
description: 'ISBN (International Standard Book Number)',
|
437
|
+
identifier: 'isbn'
|
438
|
+
},
|
439
|
+
'IN' => {
|
440
|
+
description: "Buyer's item number",
|
441
|
+
identifier: 'buyers_item_number'
|
442
|
+
},
|
443
|
+
'PV' => {
|
444
|
+
description: 'Promotional variant number',
|
445
|
+
identifier: 'promotional_variant_number'
|
446
|
+
},
|
447
|
+
'SA' => {
|
448
|
+
description: "Supplier's article number",
|
449
|
+
identifier: 'suppliers_article_number'
|
450
|
+
},
|
451
|
+
'SRV' => {
|
452
|
+
description: 'GS1 Global Trade Item Number',
|
453
|
+
identifier: 'gs1_global_trade_item_number'
|
454
|
+
},
|
455
|
+
'SRX' => {
|
456
|
+
description: 'Slaughter number',
|
457
|
+
identifier: 'slaughter_number'
|
458
|
+
},
|
459
|
+
'X2' => {
|
460
|
+
description: 'Ear-tag number (GS1 Temporary Code)',
|
461
|
+
identifier: 'ear_tag_number'
|
462
|
+
}
|
463
|
+
},
|
464
|
+
description: 'Item type identification code',
|
465
|
+
required: true
|
466
|
+
)
|
467
|
+
item_number_identification_5.add(:item_type_identification_code_5, data)
|
468
|
+
|
469
|
+
data = Eancom::Edifact::Data.new(
|
470
|
+
type: String,
|
471
|
+
length: 0..17,
|
472
|
+
description: "Code list identification code",
|
473
|
+
required: false
|
474
|
+
)
|
475
|
+
item_number_identification_5.add(:code_list_identification_code_5, data)
|
476
|
+
|
477
|
+
data = Eancom::Edifact::Data.new(
|
478
|
+
type: String,
|
479
|
+
length: 0..3,
|
480
|
+
dictionary: {
|
481
|
+
'9' => {
|
482
|
+
description: 'GS1',
|
483
|
+
identification: 'gs1'
|
484
|
+
},
|
485
|
+
'91' => {
|
486
|
+
description: "Assigned by supplier or supplier's agent",
|
487
|
+
identification: 'assigned_by_supplier_or_suppliers_agent'
|
488
|
+
},
|
489
|
+
'92' => {
|
490
|
+
description: "Assigned by buyer or buyer's agent",
|
491
|
+
identification: 'assigned_by_buyer_or_buyers_agent'
|
492
|
+
}
|
493
|
+
},
|
494
|
+
description: "Code list responsible agency code",
|
495
|
+
required: false
|
496
|
+
)
|
497
|
+
item_number_identification_5.add(:code_list_responsible_agency_code_5, data)
|
498
|
+
|
499
|
+
structure << item_number_identification_5
|
500
|
+
#==============================================================================
|
501
|
+
Eancom.register_structure(tag: 'PIA', structure: structure)
|
@@ -0,0 +1,188 @@
|
|
1
|
+
tag = 'PRI'
|
2
|
+
Eancom.register_segment(tag: tag, klass: Eancom::Edifact::PRI)
|
3
|
+
|
4
|
+
structure = Eancom::Edifact::Structure.new(tag: tag)
|
5
|
+
#==============================================================================
|
6
|
+
# Tag #
|
7
|
+
#==============================================================================
|
8
|
+
tag = Eancom::Edifact::Composite.new()
|
9
|
+
data = Eancom::Edifact::Data.new(
|
10
|
+
type: String,
|
11
|
+
length: 3,
|
12
|
+
dictionary: nil,
|
13
|
+
description: "Message Header",
|
14
|
+
required: true
|
15
|
+
)
|
16
|
+
tag.add(:tag, data)
|
17
|
+
|
18
|
+
structure << tag
|
19
|
+
#==============================================================================
|
20
|
+
# Price Information
|
21
|
+
#==============================================================================
|
22
|
+
price_information = Eancom::Edifact::Composite.new()
|
23
|
+
|
24
|
+
data = Eancom::Edifact::Data.new(
|
25
|
+
type: String,
|
26
|
+
length: 1..3,
|
27
|
+
dictionary: {
|
28
|
+
'AAA' => {
|
29
|
+
description: 'Calculation net',
|
30
|
+
identifier: 'calculation_net',
|
31
|
+
},
|
32
|
+
'AAB' => {
|
33
|
+
description: 'Calculation gross',
|
34
|
+
identifier: 'calculation_gross',
|
35
|
+
},
|
36
|
+
'AAE' => {
|
37
|
+
description: 'Information Price, excluding allowances or charges, including taxes',
|
38
|
+
identifier: 'information_price_excluding_allowance_or_charches_includeing_taxes',
|
39
|
+
},
|
40
|
+
'AAF' => {
|
41
|
+
description: 'Information Price, excluding allowances or charges or taxes',
|
42
|
+
identifier: 'information_price_excluding_allowance_or_charches_or_taxes',
|
43
|
+
},
|
44
|
+
'INF' => {
|
45
|
+
description: 'Information',
|
46
|
+
identifier: 'information',
|
47
|
+
},
|
48
|
+
'NTP' => {
|
49
|
+
description: 'Net unit price',
|
50
|
+
identifier: 'net_unit_price',
|
51
|
+
},
|
52
|
+
'AAH' => {
|
53
|
+
description: 'Subject to escalation and price adjustment',
|
54
|
+
identifier: 'subject_to_escaltion_and_price_adjustment',
|
55
|
+
},
|
56
|
+
'AAQ' => {
|
57
|
+
description: 'Firm price',
|
58
|
+
identifier: 'firm_price',
|
59
|
+
},
|
60
|
+
'ABL' => {
|
61
|
+
description: 'Base price',
|
62
|
+
identifier: 'base_price',
|
63
|
+
},
|
64
|
+
'ABM' => {
|
65
|
+
description: 'Base price difference',
|
66
|
+
identifier: 'base_price_difference',
|
67
|
+
},
|
68
|
+
},
|
69
|
+
description: 'Price code qualifier',
|
70
|
+
required: true
|
71
|
+
)
|
72
|
+
price_information.add(:price_code_qualifier, data)
|
73
|
+
|
74
|
+
data = Eancom::Edifact::Data.new(
|
75
|
+
type: String,
|
76
|
+
length: 0..15,
|
77
|
+
dictionary: nil,
|
78
|
+
description: 'Price amount',
|
79
|
+
required: true
|
80
|
+
)
|
81
|
+
price_information.add(:price_amount, data)
|
82
|
+
|
83
|
+
|
84
|
+
data = Eancom::Edifact::Data.new(
|
85
|
+
type: String,
|
86
|
+
length: 0..3,
|
87
|
+
dictionary: {
|
88
|
+
'CA' => {
|
89
|
+
description: 'Catalogue',
|
90
|
+
identifier: 'cataloque',
|
91
|
+
},
|
92
|
+
'CT' => {
|
93
|
+
description: 'Contract',
|
94
|
+
identifier: 'contract',
|
95
|
+
},
|
96
|
+
},
|
97
|
+
description: 'Price type code',
|
98
|
+
required: false
|
99
|
+
)
|
100
|
+
price_information.add(:price_type_code, data)
|
101
|
+
|
102
|
+
data = Eancom::Edifact::Data.new(
|
103
|
+
type: String,
|
104
|
+
length: 0..3,
|
105
|
+
dictionary: {
|
106
|
+
'AAE' => {
|
107
|
+
description: 'Not subject to fluctuation',
|
108
|
+
identifier: 'not_subject_to_fluctuation',
|
109
|
+
},
|
110
|
+
'ALT' => {
|
111
|
+
description: 'Alternate price',
|
112
|
+
identifier: 'alternate_price',
|
113
|
+
},
|
114
|
+
'DPR' => {
|
115
|
+
description: 'Discount price',
|
116
|
+
identifier: 'discount_price',
|
117
|
+
},
|
118
|
+
'MRP' => {
|
119
|
+
description: 'Market retail price',
|
120
|
+
identifier: 'market_retail_price',
|
121
|
+
},
|
122
|
+
'LIU' => {
|
123
|
+
description: 'List price',
|
124
|
+
identifier: 'list_price',
|
125
|
+
},
|
126
|
+
'SRP' => {
|
127
|
+
description: 'Suggested retail price',
|
128
|
+
identifier: 'suggested_retail_price',
|
129
|
+
},
|
130
|
+
'RTP' => {
|
131
|
+
description: 'Retail price',
|
132
|
+
identifier: 'retail_price',
|
133
|
+
},
|
134
|
+
'NTP' => {
|
135
|
+
description: 'Net unit price',
|
136
|
+
identifier: 'net_unit_price',
|
137
|
+
}
|
138
|
+
},
|
139
|
+
description: 'Price specification code',
|
140
|
+
required: false
|
141
|
+
)
|
142
|
+
price_information.add(:price_specification_code, data)
|
143
|
+
|
144
|
+
data = Eancom::Edifact::Data.new(
|
145
|
+
type: String,
|
146
|
+
length: 0..9,
|
147
|
+
dictionary: nil,
|
148
|
+
description: 'Unit price basis value',
|
149
|
+
required: false
|
150
|
+
)
|
151
|
+
price_information.add(:unit_price_basis_value, data)
|
152
|
+
|
153
|
+
data = Eancom::Edifact::Data.new(
|
154
|
+
type: String,
|
155
|
+
length: 0..3,
|
156
|
+
dictionary: {
|
157
|
+
'KGM' => {
|
158
|
+
description: 'Kilogram',
|
159
|
+
identifier: 'kilogram',
|
160
|
+
},
|
161
|
+
'PCE' => {
|
162
|
+
description: 'Pice',
|
163
|
+
identifier: 'pice',
|
164
|
+
},
|
165
|
+
},
|
166
|
+
description: 'Measurement unit code',
|
167
|
+
required: false
|
168
|
+
)
|
169
|
+
price_information.add(:measurment_unit_code, data)
|
170
|
+
|
171
|
+
structure << price_information
|
172
|
+
#==============================================================================
|
173
|
+
# Sub-line item price change operation code
|
174
|
+
#==============================================================================
|
175
|
+
subline_item_price_change_operation_code = Eancom::Edifact::Composite.new()
|
176
|
+
|
177
|
+
data = Eancom::Edifact::Data.new(
|
178
|
+
type: String,
|
179
|
+
length: 0..3,
|
180
|
+
dictionary: nil,
|
181
|
+
description: 'Sub-line item price change operation code',
|
182
|
+
required: false
|
183
|
+
)
|
184
|
+
subline_item_price_change_operation_code.add(:subline_item_price_change_operation_code, data)
|
185
|
+
|
186
|
+
structure << subline_item_price_change_operation_code
|
187
|
+
#==============================================================================
|
188
|
+
Eancom.register_structure(tag: 'PRI', structure: structure)
|