eancom 0.1.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +190 -5
- data/.gitlab-ci.yml +25 -0
- data/.ruby-version +1 -0
- data/Gemfile.lock +22 -18
- data/README.md +46 -0
- data/bin/console +3 -2
- data/definitions/desadv/d01b.rb +251 -0
- data/definitions/desadv/d96a.rb +208 -87
- data/definitions/invoic/d01b.rb +559 -0
- data/definitions/invoic/d96a.rb +389 -0
- data/definitions/invrpt/d01b.rb +134 -0
- data/definitions/invrpt/d96a.rb +125 -0
- data/definitions/orders/d01b.rb +182 -0
- data/definitions/orders/d96b.rb +198 -0
- data/definitions/ordrsp/d01b.rb +251 -0
- data/definitions/ordrsp/d96b.rb +226 -0
- data/definitions/pricat/d01b.rb +225 -0
- data/definitions/pricat/d96b.rb +207 -0
- data/definitions/retann/d01b.rb +172 -0
- data/definitions/retann/d96b.rb +221 -0
- data/definitions/segments/ajt.rb +47 -0
- data/definitions/segments/alc.rb +328 -0
- data/definitions/segments/ali.rb +93 -0
- data/definitions/segments/bgm.rb +395 -0
- data/definitions/segments/cav.rb +122 -0
- data/definitions/segments/cci.rb +136 -0
- data/definitions/segments/cdi.rb +39 -0
- data/definitions/segments/cnt.rb +82 -0
- data/definitions/segments/cps.rb +76 -0
- data/definitions/segments/cta.rb +89 -0
- data/definitions/segments/cux.rb +174 -0
- data/definitions/segments/dgs.rb +34 -0
- data/definitions/segments/doc.rb +45 -0
- data/definitions/segments/dtm.rb +243 -0
- data/definitions/segments/efi.rb +67 -0
- data/definitions/segments/eqd.rb +37 -0
- data/definitions/segments/ftx.rb +165 -0
- data/definitions/segments/gin.rb +113 -0
- data/definitions/segments/imd.rb +360 -0
- data/definitions/segments/inv.rb +94 -0
- data/definitions/segments/lin.rb +133 -0
- data/definitions/segments/loc.rb +137 -0
- data/definitions/segments/mea.rb +189 -0
- data/definitions/segments/moa.rb +228 -0
- data/definitions/segments/nad.rb +314 -0
- data/definitions/segments/pac.rb +262 -0
- data/definitions/segments/pat.rb +171 -0
- data/definitions/segments/pcd.rb +72 -0
- data/definitions/segments/pci.rb +110 -0
- data/definitions/segments/pgi.rb +152 -0
- data/definitions/segments/pia.rb +501 -0
- data/definitions/segments/pri.rb +208 -0
- data/definitions/segments/qty.rb +293 -0
- data/definitions/segments/rff.rb +210 -0
- data/definitions/segments/rte.rb +52 -0
- data/definitions/segments/tax.rb +266 -0
- data/definitions/segments/tdt.rb +278 -0
- data/definitions/segments/tod.rb +64 -0
- data/definitions/segments/tru.rb +34 -0
- data/definitions/segments/una.rb +85 -0
- data/definitions/segments/unb.rb +284 -0
- data/definitions/segments/unh.rb +183 -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 +206 -0
- data/definitions/slsrpt/d96a.rb +199 -0
- data/eancom.gemspec +2 -1
- data/lib/eancom.rb +61 -16
- data/lib/eancom/definition.rb +1 -1
- data/lib/eancom/edifact.rb +60 -13
- 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 +7 -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/ajt.rb +32 -0
- data/lib/eancom/edifact/segments/alc.rb +61 -0
- data/lib/eancom/edifact/segments/ali.rb +50 -0
- data/lib/eancom/edifact/segments/bgm.rb +46 -0
- data/lib/eancom/edifact/segments/cav.rb +47 -0
- data/lib/eancom/edifact/segments/cci.rb +53 -0
- data/lib/eancom/edifact/segments/cdi.rb +30 -0
- data/lib/eancom/edifact/segments/cnt.rb +40 -0
- data/lib/eancom/edifact/segments/cps.rb +33 -0
- data/lib/eancom/edifact/segments/cta.rb +30 -0
- data/lib/eancom/edifact/segments/cux.rb +60 -0
- data/lib/eancom/edifact/segments/dgs.rb +31 -0
- data/lib/eancom/edifact/segments/doc.rb +30 -0
- data/lib/eancom/edifact/segments/dtm.rb +47 -0
- data/lib/eancom/edifact/segments/efi.rb +38 -0
- data/lib/eancom/edifact/segments/eqd.rb +30 -0
- data/lib/eancom/edifact/segments/ftx.rb +63 -0
- data/lib/eancom/edifact/segments/gin.rb +45 -0
- data/lib/eancom/edifact/segments/imd.rb +69 -0
- data/lib/eancom/edifact/segments/inv.rb +43 -0
- data/lib/eancom/edifact/segments/lin.rb +47 -0
- data/lib/eancom/edifact/segments/loc.rb +46 -0
- data/lib/eancom/edifact/segments/mea.rb +54 -0
- data/lib/eancom/edifact/segments/moa.rb +45 -0
- data/lib/eancom/edifact/segments/nad.rb +112 -0
- data/lib/eancom/edifact/segments/pac.rb +56 -0
- data/lib/eancom/edifact/segments/pat.rb +37 -0
- data/lib/eancom/edifact/segments/pcd.rb +33 -0
- data/lib/eancom/edifact/segments/pci.rb +40 -0
- data/lib/eancom/edifact/segments/pgi.rb +45 -0
- data/lib/eancom/edifact/segments/pia.rb +108 -0
- data/lib/eancom/edifact/segments/pri.rb +53 -0
- data/lib/eancom/edifact/segments/qty.rb +44 -0
- data/lib/eancom/edifact/segments/rff.rb +47 -0
- data/lib/eancom/edifact/segments/rte.rb +33 -0
- data/lib/eancom/edifact/segments/tax.rb +78 -0
- data/lib/eancom/edifact/segments/tdt.rb +57 -0
- data/lib/eancom/edifact/segments/tod.rb +33 -0
- data/lib/eancom/edifact/segments/tru.rb +31 -0
- data/lib/eancom/edifact/segments/una.rb +52 -0
- data/lib/eancom/edifact/segments/unb.rb +68 -0
- data/lib/eancom/edifact/segments/unh.rb +50 -0
- data/lib/eancom/edifact/segments/uns.rb +32 -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 +90 -0
- data/lib/eancom/factory.rb +9 -8
- data/lib/eancom/parser.rb +7 -0
- data/lib/eancom/parser/document.rb +60 -0
- data/lib/eancom/parser/segment.rb +71 -0
- data/lib/eancom/version.rb +1 -1
- data/pricat.json +1 -0
- metadata +141 -9
- data/lib/eancom/edifact/element.rb +0 -16
- data/lib/eancom/edifact/envelope.rb +0 -24
@@ -0,0 +1,93 @@
|
|
1
|
+
tag = 'ALI'
|
2
|
+
Eancom.register_segment(tag: tag, klass: Eancom::Edifact::ALI)
|
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
|
+
# Country of origin name code #
|
21
|
+
#==============================================================================
|
22
|
+
country_of_origin_name_code = Eancom::Edifact::Composite.new()
|
23
|
+
|
24
|
+
data = Eancom::Edifact::Data.new(
|
25
|
+
type: String,
|
26
|
+
length: 0..3,
|
27
|
+
dictionary: nil,
|
28
|
+
description: 'Use ISO 3366 two alpha',
|
29
|
+
required: false
|
30
|
+
)
|
31
|
+
country_of_origin_name_code.add(:country_of_origin_name_code, data)
|
32
|
+
|
33
|
+
structure << country_of_origin_name_code
|
34
|
+
#==============================================================================
|
35
|
+
# Duty regime type code #
|
36
|
+
#==============================================================================
|
37
|
+
duty_regime_type_code = Eancom::Edifact::Composite.new()
|
38
|
+
|
39
|
+
data = Eancom::Edifact::Data.new(
|
40
|
+
type: String,
|
41
|
+
length: 0..3,
|
42
|
+
dictionary: nil,
|
43
|
+
description: 'Duty regime type code',
|
44
|
+
required: false
|
45
|
+
)
|
46
|
+
duty_regime_type_code.add(:duty_regime_type_code, data)
|
47
|
+
|
48
|
+
structure << duty_regime_type_code
|
49
|
+
#==============================================================================
|
50
|
+
# Special condition code #
|
51
|
+
#==============================================================================
|
52
|
+
special_condition_code = Eancom::Edifact::Composite.new()
|
53
|
+
|
54
|
+
dict = {
|
55
|
+
'6' => {
|
56
|
+
description: 'Subject to bonus',
|
57
|
+
identifier: 'subject_to_bonus'
|
58
|
+
},
|
59
|
+
'8' => {
|
60
|
+
description: 'Subject to discount',
|
61
|
+
identifier: 'subject_to_discount',
|
62
|
+
},
|
63
|
+
}
|
64
|
+
|
65
|
+
|
66
|
+
data = Eancom::Edifact::Data.new(
|
67
|
+
type: String,
|
68
|
+
length: 0..3,
|
69
|
+
dictionary: dict,
|
70
|
+
description: 'Special Condition Code',
|
71
|
+
required: false
|
72
|
+
)
|
73
|
+
|
74
|
+
special_condition_code.add(:special_condition_code_1, data)
|
75
|
+
structure << special_condition_code
|
76
|
+
|
77
|
+
special_condition_code = Eancom::Edifact::Composite.new()
|
78
|
+
special_condition_code.add(:special_condition_code_2, data)
|
79
|
+
structure << special_condition_code
|
80
|
+
|
81
|
+
special_condition_code = Eancom::Edifact::Composite.new()
|
82
|
+
special_condition_code.add(:special_condition_code_3, data)
|
83
|
+
structure << special_condition_code
|
84
|
+
|
85
|
+
special_condition_code = Eancom::Edifact::Composite.new()
|
86
|
+
special_condition_code.add(:special_condition_code_4, data)
|
87
|
+
structure << special_condition_code
|
88
|
+
|
89
|
+
special_condition_code = Eancom::Edifact::Composite.new()
|
90
|
+
special_condition_code.add(:special_condition_code_5, data)
|
91
|
+
structure << special_condition_code
|
92
|
+
#==============================================================================
|
93
|
+
Eancom.register_structure(tag: 'ALI', structure: structure)
|
@@ -0,0 +1,395 @@
|
|
1
|
+
tag = 'BGM'
|
2
|
+
Eancom.register_segment(tag: tag, klass: Eancom::Edifact::BGM)
|
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
|
+
# Document/Message Name #
|
21
|
+
#==============================================================================
|
22
|
+
document_message_name = Eancom::Edifact::Composite.new()
|
23
|
+
|
24
|
+
data = Eancom::Edifact::Data.new(
|
25
|
+
type: String,
|
26
|
+
length: 1..3,
|
27
|
+
dictionary: {
|
28
|
+
'9' => {
|
29
|
+
description: 'Price/sales catalogue',
|
30
|
+
identifier: 'price_sales_catalogue'
|
31
|
+
},
|
32
|
+
'11' => {
|
33
|
+
description: 'Federal label approval',
|
34
|
+
identifier: 'federal_label_approval'
|
35
|
+
},
|
36
|
+
'35' => {
|
37
|
+
description: 'Inventory report',
|
38
|
+
identifier: 'inventory_report'
|
39
|
+
},
|
40
|
+
'51' => {
|
41
|
+
description: 'Price/sales catalogue response',
|
42
|
+
identifier: 'price_sales_catalogue_response'
|
43
|
+
},
|
44
|
+
'67' => {
|
45
|
+
description: 'Commercial dispute',
|
46
|
+
identifier: 'commercial_dispute'
|
47
|
+
},
|
48
|
+
'78' => {
|
49
|
+
description: 'Inventory movement advice',
|
50
|
+
identifier: 'inventory_report'
|
51
|
+
},
|
52
|
+
'82' => {
|
53
|
+
description: 'Metered service invoice',
|
54
|
+
identifier: 'metered_service_invoice'
|
55
|
+
},
|
56
|
+
'83' => {
|
57
|
+
description: 'Credit note related financial adjustments',
|
58
|
+
identifier: 'credit_note_related_financial_adjustments'
|
59
|
+
},
|
60
|
+
'84' => {
|
61
|
+
description: 'Debit note related financial adjustments',
|
62
|
+
identifier: 'debit_note_related_financial_adjustments'
|
63
|
+
},
|
64
|
+
'130' => {
|
65
|
+
description: 'Invoice Data sheet',
|
66
|
+
identifier: 'invoice_data_sheet'
|
67
|
+
},
|
68
|
+
'172' => {
|
69
|
+
description: 'Authorisation plan and suggest orders',
|
70
|
+
identifier: 'authorisation_plan_and_suggest_orders'
|
71
|
+
},
|
72
|
+
'173' => {
|
73
|
+
description: 'Authorization plan and ship orders',
|
74
|
+
identifier: 'authorisation_plan_and_ship_orders'
|
75
|
+
},
|
76
|
+
'220' => {
|
77
|
+
description: 'Order',
|
78
|
+
identifier: 'order'
|
79
|
+
},
|
80
|
+
'221' => {
|
81
|
+
description: 'Blanket order',
|
82
|
+
identifier: 'blanket_order'
|
83
|
+
},
|
84
|
+
'224' => {
|
85
|
+
description: 'Rush order',
|
86
|
+
identifier: 'rush_order'
|
87
|
+
},
|
88
|
+
'225' => {
|
89
|
+
description: 'Repair order',
|
90
|
+
identifier: 'repair_order'
|
91
|
+
},
|
92
|
+
'226' => {
|
93
|
+
description: 'Call off order',
|
94
|
+
identifier: 'call_off_order'
|
95
|
+
},
|
96
|
+
'227' => {
|
97
|
+
description: 'Consignment order',
|
98
|
+
identifier: 'consignment_order'
|
99
|
+
},
|
100
|
+
'231' => {
|
101
|
+
description: 'Purchase order response',
|
102
|
+
identifier: 'purchase_order_response'
|
103
|
+
},
|
104
|
+
'237' => {
|
105
|
+
description: 'Cross docking services order',
|
106
|
+
identifier: 'cross_docking_services_order'
|
107
|
+
},
|
108
|
+
'258' => {
|
109
|
+
description: 'Standing order',
|
110
|
+
identifier: 'standing_order'
|
111
|
+
},
|
112
|
+
'261' => {
|
113
|
+
description: 'Self billed credit_note',
|
114
|
+
identifier: 'self_billed_credit_note'
|
115
|
+
},
|
116
|
+
'262' => {
|
117
|
+
description: 'Consolidated credit note - goods and services',
|
118
|
+
identifier: 'consolidated_credit_note_goods_and_services'
|
119
|
+
},
|
120
|
+
'263' => {
|
121
|
+
description: 'Inventory adjustement status report',
|
122
|
+
identifier: 'inventory_adjustement_status_report'
|
123
|
+
},
|
124
|
+
'308' => {
|
125
|
+
description: 'Delcredere credit note',
|
126
|
+
identifier: 'delcredere_credit_note'
|
127
|
+
},
|
128
|
+
'325' => {
|
129
|
+
description: 'Proforma Invoice',
|
130
|
+
identifier: 'proforma_invoice'
|
131
|
+
},
|
132
|
+
'345' => {
|
133
|
+
description: 'Ready for despatch advice',
|
134
|
+
identifier: 'ready_for_despatch_advice'
|
135
|
+
},
|
136
|
+
'351' => {
|
137
|
+
description: 'Despatch advice',
|
138
|
+
identifier: 'despatch_advice'
|
139
|
+
},
|
140
|
+
'380' => {
|
141
|
+
description: 'Commercial Invoice',
|
142
|
+
identifier: 'commercial_invoice'
|
143
|
+
},
|
144
|
+
'381' => {
|
145
|
+
description: 'Credit note - goods and services',
|
146
|
+
identifier: 'credit_note_goods_and_services'
|
147
|
+
},
|
148
|
+
'382' => {
|
149
|
+
description: 'Commission note',
|
150
|
+
identifier: 'commission_note'
|
151
|
+
},
|
152
|
+
'383' => {
|
153
|
+
description: 'Debit note - goods and services',
|
154
|
+
identifier: 'debit_note_goods_and_services'
|
155
|
+
},
|
156
|
+
'384' => {
|
157
|
+
description: 'Corrected Invoice',
|
158
|
+
identifier: 'corrected_invoice'
|
159
|
+
},
|
160
|
+
'385' => {
|
161
|
+
description: 'Consolidated invoice',
|
162
|
+
identifier: 'consolidated_invoice'
|
163
|
+
},
|
164
|
+
'386' => {
|
165
|
+
description: 'Prepayment invoice',
|
166
|
+
identifier: 'prepayment_invoice'
|
167
|
+
},
|
168
|
+
'388' => {
|
169
|
+
description: 'Tax invoice',
|
170
|
+
identifier: 'tax_invoice'
|
171
|
+
},
|
172
|
+
'389' => {
|
173
|
+
description: 'Self-billed invoice',
|
174
|
+
identifier: 'self_billed_invoice'
|
175
|
+
},
|
176
|
+
'390' => {
|
177
|
+
description: 'Delcredere invoice',
|
178
|
+
identifier: 'delcredere_invoice'
|
179
|
+
},
|
180
|
+
'393' => {
|
181
|
+
description: 'Factored invoice',
|
182
|
+
identifier: 'factored_invoice'
|
183
|
+
},
|
184
|
+
'400' => {
|
185
|
+
description: 'Exceptional order',
|
186
|
+
identifier: 'exceptional_order'
|
187
|
+
},
|
188
|
+
'401' => {
|
189
|
+
description: 'Transshipment order',
|
190
|
+
identifier: 'transshipment_order'
|
191
|
+
},
|
192
|
+
'402' => {
|
193
|
+
description: 'Cross docking order',
|
194
|
+
identifier: 'cross_docking_order'
|
195
|
+
},
|
196
|
+
'527' => {
|
197
|
+
description: 'Self billed debit note',
|
198
|
+
identifier: 'self_billed_debit_note'
|
199
|
+
},
|
200
|
+
'24E' => {
|
201
|
+
description: 'Price/sales catalogue not containing pricing information (GS1 Temporary Code)',
|
202
|
+
identifier: 'price_sales_catalogue_not_containing_pricing_information'
|
203
|
+
},
|
204
|
+
'25E' => {
|
205
|
+
description: 'Price/sales catalogue containing pricing information (GS1 Temporary Code)',
|
206
|
+
identifier: 'price_sales_catalogue_containing_pricing_information'
|
207
|
+
},
|
208
|
+
'35E' => {
|
209
|
+
description: 'Return advice (GS1 Temporary Code)',
|
210
|
+
identifier: 'return_advice'
|
211
|
+
},
|
212
|
+
'YA5' => {
|
213
|
+
description: 'Itermediate handling cross docking despatch advice (GS1 Temporary Code).',
|
214
|
+
identifier: 'intermediate_handling_cross_docking_despatch_advice'
|
215
|
+
},
|
216
|
+
'YA6' => {
|
217
|
+
description: 'Pre-pack cross docking [transshipment] despatch advice (GS1 Temporary Code).',
|
218
|
+
identifier: 'pre_pakc_cross_docking_despatch_advice'
|
219
|
+
},
|
220
|
+
'YA7' => {
|
221
|
+
description: 'Consignment despatch advice (GS1 Temporary Code).',
|
222
|
+
identifier: 'consignment_despatch_advice'
|
223
|
+
},
|
224
|
+
'YB3' => {
|
225
|
+
description: 'Ready for transshipment despatch advice (GS1 Temporary Code).',
|
226
|
+
identifier: 'ready_for_transshipment_despatch_advice'
|
227
|
+
},
|
228
|
+
'22E' => {
|
229
|
+
description: 'Manufacturer raised order (GS1 Temporary Code)',
|
230
|
+
identifier: 'manufacturer_raised_order'
|
231
|
+
},
|
232
|
+
'23E' => {
|
233
|
+
description: 'Manufacturer raised consignment order',
|
234
|
+
identifier: 'manufacturer_raised_consignment_order'
|
235
|
+
},
|
236
|
+
'73E' => {
|
237
|
+
description: 'Sales Report',
|
238
|
+
identifier: 'sales_report'
|
239
|
+
},
|
240
|
+
'70E' => {
|
241
|
+
description: 'Announcement for returns (GS1 Temporary Code)',
|
242
|
+
identifier: 'announcement_for_returns'
|
243
|
+
},
|
244
|
+
'2E' => {
|
245
|
+
description: 'Data distribution profile (GS1 Temporary Code)',
|
246
|
+
identifier: 'data_distribution_profile'
|
247
|
+
}
|
248
|
+
},
|
249
|
+
description: "Document name code.",
|
250
|
+
required: true
|
251
|
+
)
|
252
|
+
document_message_name.add(:document_name_code, data)
|
253
|
+
|
254
|
+
data = Eancom::Edifact::Data.new(
|
255
|
+
type: String,
|
256
|
+
length: 0..17,
|
257
|
+
dictionary: nil,
|
258
|
+
description: "Code list identification code",
|
259
|
+
required: false
|
260
|
+
)
|
261
|
+
document_message_name.add(:code_list_identification_code, data)
|
262
|
+
|
263
|
+
data = Eancom::Edifact::Data.new(
|
264
|
+
type: String,
|
265
|
+
length: 0..3,
|
266
|
+
dictionary: {
|
267
|
+
'9' => {
|
268
|
+
description: 'GS1',
|
269
|
+
identifier: 'gs1'
|
270
|
+
}
|
271
|
+
},
|
272
|
+
description: "Code list responsible agency code.",
|
273
|
+
required: false
|
274
|
+
)
|
275
|
+
document_message_name.add(:code_list_responsible_agency_code, data)
|
276
|
+
|
277
|
+
data = Eancom::Edifact::Data.new(
|
278
|
+
type: String,
|
279
|
+
length: 0..35,
|
280
|
+
dictionary: nil,
|
281
|
+
description: "Document name",
|
282
|
+
required: false
|
283
|
+
)
|
284
|
+
document_message_name.add(:document_name, data)
|
285
|
+
|
286
|
+
structure << document_message_name
|
287
|
+
#==============================================================================
|
288
|
+
# Document/Message Identification #
|
289
|
+
#==============================================================================
|
290
|
+
document_message_identification = Eancom::Edifact::Composite.new()
|
291
|
+
|
292
|
+
data = Eancom::Edifact::Data.new(
|
293
|
+
type: String,
|
294
|
+
length: 1..35,
|
295
|
+
dictionary: nil,
|
296
|
+
description: "Despatch Advice number assigned by the document sender.\nFor global unique identification of documents Global Document Identifier (GDTI) is available.",
|
297
|
+
required: true
|
298
|
+
)
|
299
|
+
document_message_identification.add(:document_identifier, data)
|
300
|
+
|
301
|
+
structure << document_message_identification
|
302
|
+
#==============================================================================
|
303
|
+
# Message function code #
|
304
|
+
#==============================================================================
|
305
|
+
message_function_code = Eancom::Edifact::Composite.new()
|
306
|
+
|
307
|
+
data = Eancom::Edifact::Data.new(
|
308
|
+
type: String,
|
309
|
+
length: 1..3,
|
310
|
+
dictionary: {
|
311
|
+
'1' => {
|
312
|
+
description: 'Cancellation',
|
313
|
+
identifier: 'cancellation'
|
314
|
+
},
|
315
|
+
'2' => {
|
316
|
+
description: 'Addition',
|
317
|
+
identifier: 'addition'
|
318
|
+
},
|
319
|
+
'3' => {
|
320
|
+
description: 'Deletion',
|
321
|
+
identifier: 'deletion'
|
322
|
+
},
|
323
|
+
'4' => {
|
324
|
+
description: 'Change',
|
325
|
+
identifier: 'change'
|
326
|
+
},
|
327
|
+
'5' => {
|
328
|
+
description: 'Replace',
|
329
|
+
identifier: 'replace'
|
330
|
+
},
|
331
|
+
'6' => {
|
332
|
+
description: 'Confirmation',
|
333
|
+
identifier: 'confirmation'
|
334
|
+
},
|
335
|
+
'7' => {
|
336
|
+
description: 'Duplicate',
|
337
|
+
identifier: 'duplicate'
|
338
|
+
},
|
339
|
+
'9' => {
|
340
|
+
description: 'Original',
|
341
|
+
identifier: 'original'
|
342
|
+
},
|
343
|
+
'11' => {
|
344
|
+
description: 'Response',
|
345
|
+
identifier: 'response'
|
346
|
+
},
|
347
|
+
'12' => {
|
348
|
+
description: 'Not processed',
|
349
|
+
identifier: 'not_processed'
|
350
|
+
},
|
351
|
+
'16' => {
|
352
|
+
description: 'Proposal',
|
353
|
+
identifier: 'proposal'
|
354
|
+
},
|
355
|
+
'27' => {
|
356
|
+
description: 'Not accepted',
|
357
|
+
identifier: 'not_accepted'
|
358
|
+
},
|
359
|
+
'29' => {
|
360
|
+
description: 'Order Response',
|
361
|
+
identifier: 'order_response'
|
362
|
+
},
|
363
|
+
'31' => {
|
364
|
+
description: 'Copy',
|
365
|
+
identifier: 'copy'
|
366
|
+
},
|
367
|
+
'42' => {
|
368
|
+
description: 'Confirmation_via_specific_means',
|
369
|
+
identifier: 'confirmation_via_specific_means'
|
370
|
+
},
|
371
|
+
'43' => {
|
372
|
+
description: 'Additional transmission',
|
373
|
+
identifier: 'additional_transmission'
|
374
|
+
},
|
375
|
+
'45' => {
|
376
|
+
description: 'Accepted with reserves',
|
377
|
+
identifier: 'accepted_with_reserves'
|
378
|
+
},
|
379
|
+
'46' => {
|
380
|
+
description: 'Provisional',
|
381
|
+
identifier: 'provisional'
|
382
|
+
},
|
383
|
+
'47' => {
|
384
|
+
description: 'Definitive',
|
385
|
+
identifier: 'definitive'
|
386
|
+
}
|
387
|
+
},
|
388
|
+
description: 'Message function code',
|
389
|
+
required: true
|
390
|
+
)
|
391
|
+
message_function_code.add(:message_function_code, data)
|
392
|
+
|
393
|
+
structure << message_function_code
|
394
|
+
#==============================================================================
|
395
|
+
Eancom.register_structure(tag: 'BGM', structure: structure)
|