eancom 1.6.2 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (122) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +7 -4
  3. data/.gitlab-ci.yml +11 -13
  4. data/.ruby-version +1 -1
  5. data/Gemfile +2 -4
  6. data/Gemfile.lock +21 -103
  7. data/README.md +46 -0
  8. data/definitions/desadv/d01b.rb +134 -87
  9. data/definitions/desadv/d96a.rb +145 -82
  10. data/definitions/invoic/d01b.rb +559 -0
  11. data/definitions/invoic/d96a.rb +389 -0
  12. data/definitions/invrpt/d01b.rb +134 -0
  13. data/definitions/invrpt/d96a.rb +125 -0
  14. data/definitions/orders/d01b.rb +182 -0
  15. data/definitions/orders/d96b.rb +198 -0
  16. data/definitions/ordrsp/d01b.rb +251 -0
  17. data/definitions/ordrsp/d96b.rb +226 -0
  18. data/definitions/pricat/d01b.rb +225 -0
  19. data/definitions/pricat/d96b.rb +207 -0
  20. data/definitions/retann/d01b.rb +172 -0
  21. data/definitions/retann/d96b.rb +221 -0
  22. data/definitions/segments/ajt.rb +47 -0
  23. data/definitions/segments/alc.rb +128 -36
  24. data/definitions/segments/bgm.rb +122 -2
  25. data/definitions/segments/cdi.rb +39 -0
  26. data/definitions/segments/cnt.rb +4 -0
  27. data/definitions/segments/cta.rb +89 -0
  28. data/definitions/segments/cux.rb +9 -2
  29. data/definitions/segments/dgs.rb +34 -0
  30. data/definitions/segments/doc.rb +45 -0
  31. data/definitions/segments/dtm.rb +75 -20
  32. data/definitions/segments/efi.rb +67 -0
  33. data/definitions/segments/eqd.rb +37 -0
  34. data/definitions/segments/ftx.rb +22 -8
  35. data/definitions/segments/gin.rb +113 -0
  36. data/definitions/segments/imd.rb +9 -13
  37. data/definitions/segments/inv.rb +94 -0
  38. data/definitions/segments/lin.rb +24 -4
  39. data/definitions/segments/loc.rb +52 -4
  40. data/definitions/segments/moa.rb +86 -2
  41. data/definitions/segments/nad.rb +69 -9
  42. data/definitions/segments/pac.rb +12 -0
  43. data/definitions/segments/pat.rb +171 -0
  44. data/definitions/segments/pcd.rb +9 -92
  45. data/definitions/segments/pci.rb +110 -0
  46. data/definitions/segments/pgi.rb +7 -3
  47. data/definitions/segments/pia.rb +21 -29
  48. data/definitions/segments/pri.rb +25 -13
  49. data/definitions/segments/qty.rb +208 -2
  50. data/definitions/segments/rff.rb +49 -13
  51. data/definitions/segments/rte.rb +52 -0
  52. data/definitions/segments/tax.rb +17 -10
  53. data/definitions/segments/tdt.rb +24 -0
  54. data/definitions/segments/tod.rb +64 -0
  55. data/definitions/segments/tru.rb +34 -0
  56. data/definitions/segments/una.rb +8 -8
  57. data/definitions/segments/unb.rb +4 -4
  58. data/definitions/segments/unh.rb +70 -5
  59. data/definitions/segments/uns.rb +2 -2
  60. data/definitions/segments/unt.rb +2 -2
  61. data/definitions/slsrpt/d01b.rb +132 -128
  62. data/definitions/slsrpt/d96a.rb +132 -129
  63. data/eancom.gemspec +5 -8
  64. data/lib/eancom/edifact/body.rb +37 -18
  65. data/lib/eancom/edifact/document.rb +20 -16
  66. data/lib/eancom/edifact/footer.rb +1 -0
  67. data/lib/eancom/edifact/item.rb +1 -1
  68. data/lib/eancom/edifact/message.rb +7 -39
  69. data/lib/eancom/edifact/segment.rb +9 -11
  70. data/lib/eancom/edifact/segments/ajt.rb +32 -0
  71. data/lib/eancom/edifact/segments/ali.rb +2 -4
  72. data/lib/eancom/edifact/segments/bgm.rb +4 -3
  73. data/lib/eancom/edifact/segments/cdi.rb +30 -0
  74. data/lib/eancom/edifact/segments/cnt.rb +8 -1
  75. data/lib/eancom/edifact/segments/cps.rb +4 -1
  76. data/lib/eancom/edifact/segments/cta.rb +30 -0
  77. data/lib/eancom/edifact/segments/cux.rb +1 -1
  78. data/lib/eancom/edifact/segments/dgs.rb +31 -0
  79. data/lib/eancom/edifact/segments/doc.rb +30 -0
  80. data/lib/eancom/edifact/segments/dtm.rb +10 -6
  81. data/lib/eancom/edifact/segments/efi.rb +38 -0
  82. data/lib/eancom/edifact/segments/eqd.rb +30 -0
  83. data/lib/eancom/edifact/segments/ftx.rb +2 -2
  84. data/lib/eancom/edifact/segments/gin.rb +45 -0
  85. data/lib/eancom/edifact/segments/imd.rb +1 -1
  86. data/lib/eancom/edifact/segments/inv.rb +43 -0
  87. data/lib/eancom/edifact/segments/lin.rb +7 -4
  88. data/lib/eancom/edifact/segments/loc.rb +8 -9
  89. data/lib/eancom/edifact/segments/mea.rb +1 -0
  90. data/lib/eancom/edifact/segments/moa.rb +3 -3
  91. data/lib/eancom/edifact/segments/nad.rb +11 -6
  92. data/lib/eancom/edifact/segments/pac.rb +3 -1
  93. data/lib/eancom/edifact/segments/pat.rb +37 -0
  94. data/lib/eancom/edifact/segments/pcd.rb +6 -17
  95. data/lib/eancom/edifact/segments/pci.rb +40 -0
  96. data/lib/eancom/edifact/segments/pia.rb +1 -0
  97. data/lib/eancom/edifact/segments/pri.rb +0 -1
  98. data/lib/eancom/edifact/segments/qty.rb +9 -5
  99. data/lib/eancom/edifact/segments/rff.rb +8 -2
  100. data/lib/eancom/edifact/segments/rte.rb +33 -0
  101. data/lib/eancom/edifact/segments/tax.rb +7 -1
  102. data/lib/eancom/edifact/segments/tdt.rb +4 -1
  103. data/lib/eancom/edifact/segments/tod.rb +33 -0
  104. data/lib/eancom/edifact/segments/tru.rb +31 -0
  105. data/lib/eancom/edifact/segments/una.rb +2 -1
  106. data/lib/eancom/edifact/segments/unb.rb +4 -5
  107. data/lib/eancom/edifact/segments/unh.rb +6 -4
  108. data/lib/eancom/edifact/segments/uns.rb +4 -1
  109. data/lib/eancom/edifact/structure.rb +0 -1
  110. data/lib/eancom/edifact.rb +15 -4
  111. data/lib/eancom/factory.rb +1 -1
  112. data/lib/eancom/parser/document.rb +3 -16
  113. data/lib/eancom/parser/segment.rb +9 -10
  114. data/lib/eancom/version.rb +1 -3
  115. data/lib/eancom.rb +3 -1
  116. data/pricat.json +1 -0
  117. metadata +45 -51
  118. data/.rubocop.yml +0 -2
  119. data/.tool-versions +0 -1
  120. data/definitions/segments/qvr.rb +0 -140
  121. data/lib/eancom/edifact/location.rb +0 -56
  122. data/lib/eancom/edifact/segments/qvr.rb +0 -50
@@ -5,12 +5,12 @@ structure = Eancom::Edifact::Structure.new(tag: tag)
5
5
  #==============================================================================
6
6
  # Tag #
7
7
  #==============================================================================
8
- tag = Eancom::Edifact::Composite.new()
8
+ tag = Eancom::Edifact::Composite.new
9
9
  data = Eancom::Edifact::Data.new(
10
10
  type: String,
11
11
  length: 3,
12
12
  dictionary: nil,
13
- description: "Message Header",
13
+ description: 'Message Header',
14
14
  required: true
15
15
  )
16
16
  tag.add(:tag, data)
@@ -19,7 +19,7 @@ structure << tag
19
19
  #==============================================================================
20
20
  # Allowance or Charge code qualifier
21
21
  #==============================================================================
22
- allowance_or_charge_code_qualifier = Eancom::Edifact::Composite.new()
22
+ allowance_or_charge_code_qualifier = Eancom::Edifact::Composite.new
23
23
  data = Eancom::Edifact::Data.new(
24
24
  type: String,
25
25
  length: 1..3,
@@ -32,8 +32,12 @@ data = Eancom::Edifact::Data.new(
32
32
  description: 'Charge',
33
33
  identifier: 'charge'
34
34
  },
35
+ 'N' => {
36
+ description: 'No allowance or charge',
37
+ identifier: 'no_allowance_or_charge'
38
+ }
35
39
  },
36
- description: "Allowance or Charge code qualifier",
40
+ description: 'Allowance or Charge code qualifier',
37
41
  required: true
38
42
  )
39
43
  allowance_or_charge_code_qualifier.add(:allowance_or_charge_code_qualifier, data)
@@ -42,13 +46,13 @@ structure << allowance_or_charge_code_qualifier
42
46
  #==============================================================================
43
47
  # Allowance/Charge information
44
48
  #==============================================================================
45
- allowance_charge_information = Eancom::Edifact::Composite.new()
49
+ allowance_charge_information = Eancom::Edifact::Composite.new
46
50
 
47
51
  data = Eancom::Edifact::Data.new(
48
52
  type: String,
49
53
  length: 0..35,
50
54
  dictionary: nil,
51
- description: "Allowance or charge identifier",
55
+ description: 'Allowance or charge identifier',
52
56
  required: false
53
57
  )
54
58
  allowance_charge_information.add(:allowance_or_charge_identifier, data)
@@ -57,20 +61,24 @@ data = Eancom::Edifact::Data.new(
57
61
  type: String,
58
62
  length: 0..3,
59
63
  dictionary: {
60
- '64' =>{
64
+ '64' => {
61
65
  description: 'Special agreement',
62
- identifier: 'special_agreement',
66
+ identifier: 'special_agreement'
63
67
  },
64
- '69' =>{
68
+ '69' => {
65
69
  description: 'Charge for a customer specific finish',
66
- identifier: 'charge_for_a_customer_specific_finisch',
70
+ identifier: 'charge_for_a_customer_specific_finisch'
67
71
  },
68
- '64E' =>{
72
+ '64E' => {
69
73
  description: 'Yearly turnover allowance/charge',
70
- identifier: 'yearly_turnover_allowance_charge',
74
+ identifier: 'yearly_turnover_allowance_charge'
71
75
  },
76
+ '101' => {
77
+ description: 'Carbon footprint charge',
78
+ identifier: 'carbon_footprint_charge'
79
+ }
72
80
  },
73
- description: "Allowance or charge identification code",
81
+ description: 'Allowance or charge identification code',
74
82
  required: false
75
83
  )
76
84
  allowance_charge_information.add(:allowance_or_charge_identification_code, data)
@@ -81,22 +89,22 @@ data = Eancom::Edifact::Data.new(
81
89
  dictionary: {
82
90
  '1' => {
83
91
  description: 'Bill back',
84
- identifier: 'bill_back',
92
+ identifier: 'bill_back'
85
93
  },
86
94
  '2' => {
87
95
  description: 'Off invoice',
88
- identifier: 'off_invoice',
96
+ identifier: 'off_invoice'
89
97
  },
90
98
  '5' => {
91
99
  description: 'Charge to be paid by vendor',
92
- identifier: 'charge_to_be_paid_by_vendor',
100
+ identifier: 'charge_to_be_paid_by_vendor'
93
101
  },
94
102
  '6' => {
95
103
  description: 'Charge to be paid by customer',
96
- identifier: 'charge_to_be_paid_by_customer',
97
- },
104
+ identifier: 'charge_to_be_paid_by_customer'
105
+ }
98
106
  },
99
- description: "Settlement mean code",
107
+ description: 'Settlement mean code',
100
108
  required: false
101
109
  )
102
110
  allowance_charge_information.add(:settlement_mean_code, data)
@@ -107,42 +115,42 @@ data = Eancom::Edifact::Data.new(
107
115
  dictionary: {
108
116
  '1' => {
109
117
  description: 'First step of calculation',
110
- identifier: 'first_step_of_calculation',
118
+ identifier: 'first_step_of_calculation'
111
119
  },
112
120
  '2' => {
113
121
  description: 'Second step of calculation',
114
- identifier: 'second_step_of_calculation',
122
+ identifier: 'second_step_of_calculation'
115
123
  },
116
124
  '3' => {
117
125
  description: 'Third step of calculation',
118
- identifier: 'third_step_of_calculation',
126
+ identifier: 'third_step_of_calculation'
119
127
  },
120
128
  '4' => {
121
129
  description: 'Forth step of calculation',
122
- identifier: 'forth_step_of_calculation',
130
+ identifier: 'forth_step_of_calculation'
123
131
  },
124
132
  '5' => {
125
133
  description: 'Fith step of calculation',
126
- identifier: 'fith_step_of_calculation',
134
+ identifier: 'fith_step_of_calculation'
127
135
  },
128
136
  '6' => {
129
137
  description: 'Sixth step of calculation',
130
- identifier: 'sixth_step_of_calculation',
138
+ identifier: 'sixth_step_of_calculation'
131
139
  },
132
140
  '7' => {
133
141
  description: 'Seventh step of calculation',
134
- identifier: 'seventh_step_of_calculation',
142
+ identifier: 'seventh_step_of_calculation'
135
143
  },
136
144
  '8' => {
137
145
  description: 'Eighth step of calculation',
138
- identifier: 'eighth_step_of_calculation',
146
+ identifier: 'eighth_step_of_calculation'
139
147
  },
140
148
  '9' => {
141
149
  description: 'Ninth step of calculation',
142
- identifier: 'ninth_step_of_calculation',
143
- },
150
+ identifier: 'ninth_step_of_calculation'
151
+ }
144
152
  },
145
- description: "Calculation sequence code",
153
+ description: 'Calculation sequence code',
146
154
  required: false
147
155
  )
148
156
  allowance_charge_information.add(:calculation_sequence_code, data)
@@ -151,7 +159,7 @@ structure << allowance_charge_information
151
159
  #==============================================================================
152
160
  # Special Services identification
153
161
  #==============================================================================
154
- special_services_identification = Eancom::Edifact::Composite.new()
162
+ special_services_identification = Eancom::Edifact::Composite.new
155
163
 
156
164
  data = Eancom::Edifact::Data.new(
157
165
  type: String,
@@ -161,18 +169,74 @@ data = Eancom::Edifact::Data.new(
161
169
  description: 'Adjustments',
162
170
  identifier: 'adjustments'
163
171
  },
172
+ 'DDA' => {
173
+ description: 'Dealer discount/allowance (GS1 Temporary Code)',
174
+ identifier: 'dealer_discount_allowance_gs1'
175
+ },
176
+ 'DBD' => {
177
+ description: 'Debtor bound (GS1 Temporary Code)',
178
+ identifier: 'debtor_bound'
179
+ },
164
180
  'CAC' => {
165
181
  description: 'Cash Discount',
166
182
  identifier: 'cash_discount'
167
183
  },
184
+ 'CAV' => {
185
+ description: 'Battery collection and recycling',
186
+ identifier: 'battery_collection_and_recycling'
187
+ },
188
+ 'CAU' => {
189
+ description: 'Sorting',
190
+ identifier: 'sorting'
191
+ },
192
+ 'CAW' => {
193
+ description: 'Product Take Back Fee',
194
+ identifier: 'product_take_back_fee'
195
+ },
168
196
  'AEK' => {
169
197
  description: 'Cash on delivery service',
170
198
  identifier: 'cash_on_delivery_service'
171
199
  },
200
+ 'AAB' => {
201
+ description: 'Returned goods charges',
202
+ identifier: 'returned_goods_charges'
203
+ },
204
+ 'ABA' => {
205
+ description: 'Compulsory storage fee',
206
+ identifier: 'compulsory_storage_fee'
207
+ },
208
+ 'ABL' => {
209
+ description: 'Packaging surcharge',
210
+ identifier: 'packaging_surcharge'
211
+ },
212
+ 'ABZ' => {
213
+ description: 'Miscellaneous rebate or discount',
214
+ identifier: 'miscellaneous_rebate_or_discount'
215
+ },
216
+ 'ACZ' => {
217
+ description: 'Damaged merchandise',
218
+ identifier: 'damaged_merchandise'
219
+ },
220
+ 'ADS' => {
221
+ description: 'Full pallet ordering',
222
+ identifier: 'full_pallet_ordering'
223
+ },
224
+ 'ADT' => {
225
+ description: 'Pick-up',
226
+ identifier: 'pick_up'
227
+ },
172
228
  'EAB' => {
173
229
  description: 'Early payment allowance',
174
230
  identifier: 'early_payment_allowance'
175
231
  },
232
+ 'RCH' => {
233
+ description: 'Return handling (GS1 Temporary Code)',
234
+ identifier: 'return_handling'
235
+ },
236
+ 'TD' => {
237
+ description: 'Trade discount',
238
+ identifier: 'trade_discount'
239
+ },
176
240
  'FC' => {
177
241
  description: 'Freight charge',
178
242
  identifier: 'freght_charge'
@@ -181,6 +245,10 @@ data = Eancom::Edifact::Data.new(
181
245
  description: 'Finance charge',
182
246
  identifier: 'finance_charge'
183
247
  },
248
+ 'FR' => {
249
+ description: 'Flat Rate (GS1 Temporary Code)',
250
+ identifier: 'flat_rate'
251
+ },
184
252
  'HD' => {
185
253
  description: 'Handling',
186
254
  identifier: 'handling'
@@ -189,12 +257,36 @@ data = Eancom::Edifact::Data.new(
189
257
  description: 'Quantity discount',
190
258
  identifier: 'quantity_discount'
191
259
  },
260
+ 'X01' => {
261
+ description: 'Allowance Global (GS1 Temporary Code)',
262
+ identifier: 'allowance_global'
263
+ },
264
+ 'X02' => {
265
+ description: 'Charge Global (GS1 Temporary Code)',
266
+ identifier: 'charge_global'
267
+ },
268
+ 'X03' => {
269
+ description: 'Consolidated (GS1 Temporary Code)',
270
+ identifier: 'consolidated'
271
+ },
272
+ 'X04' => {
273
+ description: 'Lump sum (GS1 Temporary Code)',
274
+ identifier: 'lump_sum'
275
+ },
276
+ 'X05' => {
277
+ description: 'Markup for small volume purchases',
278
+ identifier: 'markup_for_small_volume_purchases'
279
+ },
280
+ 'X30' => {
281
+ description: 'Point of sales allowance (GS1 Temporary Code)',
282
+ identifier: 'point_of_sales_allowance'
283
+ },
192
284
  'X40' => {
193
285
  description: 'Allowance/charge regulated by law',
194
286
  identifier: 'allowance_charge_regulated_by_law'
195
- },
287
+ }
196
288
  },
197
- description: "Special service description_code",
289
+ description: 'Special service description_code',
198
290
  required: false
199
291
  )
200
292
  special_services_identification.add(:special_service_description_code, data)
@@ -202,7 +294,7 @@ special_services_identification.add(:special_service_description_code, data)
202
294
  data = Eancom::Edifact::Data.new(
203
295
  type: String,
204
296
  length: 0..17,
205
- description: "Code list identification code",
297
+ description: 'Code list identification code',
206
298
  required: false
207
299
  )
208
300
  special_services_identification.add(:code_list_identification_code, data)
@@ -216,7 +308,7 @@ data = Eancom::Edifact::Data.new(
216
308
  identifier: 'gs1'
217
309
  }
218
310
  },
219
- description: "Code list responsible agency code",
311
+ description: 'Code list responsible agency code',
220
312
  required: false
221
313
  )
222
314
  special_services_identification.add(:code_list_responsible_agency_code, data)
@@ -225,7 +317,7 @@ data = Eancom::Edifact::Data.new(
225
317
  type: String,
226
318
  length: 0..3,
227
319
  dictionary: nil,
228
- description: "Special service description",
320
+ description: 'Special service description',
229
321
  required: false
230
322
  )
231
323
  special_services_identification.add(:special_service_description_1, data)
@@ -33,10 +33,22 @@ data = Eancom::Edifact::Data.new(
33
33
  description: 'Federal label approval',
34
34
  identifier: 'federal_label_approval'
35
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
+ },
36
44
  '67' => {
37
45
  description: 'Commercial dispute',
38
46
  identifier: 'commercial_dispute'
39
47
  },
48
+ '78' => {
49
+ description: 'Inventory movement advice',
50
+ identifier: 'inventory_report'
51
+ },
40
52
  '82' => {
41
53
  description: 'Metered service invoice',
42
54
  identifier: 'metered_service_invoice'
@@ -53,10 +65,50 @@ data = Eancom::Edifact::Data.new(
53
65
  description: 'Invoice Data sheet',
54
66
  identifier: 'invoice_data_sheet'
55
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
+ },
56
100
  '231' => {
57
101
  description: 'Purchase order response',
58
102
  identifier: 'purchase_order_response'
59
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
+ },
60
112
  '261' => {
61
113
  description: 'Self billed credit_note',
62
114
  identifier: 'self_billed_credit_note'
@@ -65,6 +117,10 @@ data = Eancom::Edifact::Data.new(
65
117
  description: 'Consolidated credit note - goods and services',
66
118
  identifier: 'consolidated_credit_note_goods_and_services'
67
119
  },
120
+ '263' => {
121
+ description: 'Inventory adjustement status report',
122
+ identifier: 'inventory_adjustement_status_report'
123
+ },
68
124
  '308' => {
69
125
  description: 'Delcredere credit note',
70
126
  identifier: 'delcredere_credit_note'
@@ -125,10 +181,30 @@ data = Eancom::Edifact::Data.new(
125
181
  description: 'Factored invoice',
126
182
  identifier: 'factored_invoice'
127
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
+ },
128
196
  '527' => {
129
197
  description: 'Self billed debit note',
130
198
  identifier: 'self_billed_debit_note'
131
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
+ },
132
208
  '35E' => {
133
209
  description: 'Return advice (GS1 Temporary Code)',
134
210
  identifier: 'return_advice'
@@ -149,9 +225,25 @@ data = Eancom::Edifact::Data.new(
149
225
  description: 'Ready for transshipment despatch advice (GS1 Temporary Code).',
150
226
  identifier: 'ready_for_transshipment_despatch_advice'
151
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
+ },
152
236
  '73E' => {
153
237
  description: 'Sales Report',
154
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'
155
247
  }
156
248
  },
157
249
  description: "Document name code.",
@@ -224,6 +316,10 @@ data = Eancom::Edifact::Data.new(
224
316
  description: 'Addition',
225
317
  identifier: 'addition'
226
318
  },
319
+ '3' => {
320
+ description: 'Deletion',
321
+ identifier: 'deletion'
322
+ },
227
323
  '4' => {
228
324
  description: 'Change',
229
325
  identifier: 'change'
@@ -232,6 +328,10 @@ data = Eancom::Edifact::Data.new(
232
328
  description: 'Replace',
233
329
  identifier: 'replace'
234
330
  },
331
+ '6' => {
332
+ description: 'Confirmation',
333
+ identifier: 'confirmation'
334
+ },
235
335
  '7' => {
236
336
  description: 'Duplicate',
237
337
  identifier: 'duplicate'
@@ -244,6 +344,18 @@ data = Eancom::Edifact::Data.new(
244
344
  description: 'Response',
245
345
  identifier: 'response'
246
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
+ },
247
359
  '29' => {
248
360
  description: 'Order Response',
249
361
  identifier: 'order_response'
@@ -256,12 +368,20 @@ data = Eancom::Edifact::Data.new(
256
368
  description: 'Confirmation_via_specific_means',
257
369
  identifier: 'confirmation_via_specific_means'
258
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
+ },
259
379
  '46' => {
260
- description: 'Message content is provisional',
380
+ description: 'Provisional',
261
381
  identifier: 'provisional'
262
382
  },
263
383
  '47' => {
264
- description: 'Message content is definitive',
384
+ description: 'Definitive',
265
385
  identifier: 'definitive'
266
386
  }
267
387
  },
@@ -0,0 +1,39 @@
1
+ tag = 'CDI'
2
+ Eancom.register_segment(tag: tag, klass: Eancom::Edifact::CDI)
3
+
4
+ structure = Eancom::Edifact::Structure.new(tag: tag)
5
+
6
+ #==============================================================================
7
+ # Tag #
8
+ #==============================================================================
9
+ tag = Eancom::Edifact::Composite.new
10
+ data = Eancom::Edifact::Data.new(
11
+ type: String,
12
+ length: 1..3,
13
+ dictionary: nil,
14
+ description: 'Message Header',
15
+ required: true
16
+ )
17
+ tag.add(:tag, data)
18
+ structure << tag
19
+ #==============================================================================
20
+ # Contact function code #
21
+ #==============================================================================
22
+ physical_or_logical_state_type_code_qualifier = Eancom::Edifact::Composite.new()
23
+
24
+ data = Eancom::Edifact::Data.new(
25
+ type: String,
26
+ length: 1..3,
27
+ dictionary: {
28
+ '3E' => {
29
+ description: 'Upon return (GS1 temporary code)',
30
+ identifier: 'upon_return'
31
+ }
32
+ },
33
+ description: 'Physical or logical state type code qualifier',
34
+ required: true
35
+ )
36
+ physical_or_logical_state_type_code_qualifier.add(:physical_or_logical_state_type_code_qualifier, data)
37
+
38
+ structure << physical_or_logical_state_type_code_qualifier
39
+ Eancom.register_structure(tag: 'CDI', structure: structure)
@@ -33,6 +33,10 @@ data = Eancom::Edifact::Data.new(
33
33
  description: 'Number of line items in message',
34
34
  identifier: 'total_line_items'
35
35
  },
36
+ '3' => {
37
+ description: 'Number of line and sub items in message',
38
+ identifier: 'number_of_line_and_sub_items_in_message'
39
+ },
36
40
  '7' => {
37
41
  description: 'Total gross weight',
38
42
  identifier: 'total_gross_weight'
@@ -0,0 +1,89 @@
1
+ tag = 'CTA'
2
+ Eancom.register_segment(tag: tag, klass: Eancom::Edifact::CTA)
3
+
4
+ structure = Eancom::Edifact::Structure.new(tag: tag)
5
+
6
+ #==============================================================================
7
+ # Tag #
8
+ #==============================================================================
9
+ tag = Eancom::Edifact::Composite.new
10
+ data = Eancom::Edifact::Data.new(
11
+ type: String,
12
+ length: 1..3,
13
+ dictionary: nil,
14
+ description: 'Message Header',
15
+ required: true
16
+ )
17
+ tag.add(:tag, data)
18
+ structure << tag
19
+ #==============================================================================
20
+ # Contact function code #
21
+ #==============================================================================
22
+ contact_function_code = Eancom::Edifact::Composite.new
23
+
24
+ data = Eancom::Edifact::Data.new(
25
+ type: String,
26
+ length: 1..3,
27
+ dictionary: {
28
+ 'AD' => {
29
+ description: 'Accounting contact',
30
+ identifier: 'accounting_contact'
31
+ },
32
+ 'AP' => {
33
+ description: 'Accounts payable contact',
34
+ identifier: 'accounts_payable_contact'
35
+ },
36
+ 'AR' => {
37
+ description: 'Accounts receivable contact',
38
+ identifier: 'accounts_receivable_contact'
39
+ },
40
+ 'GR' => {
41
+ description: 'Goods receiving contact',
42
+ identifier: 'goods_receiving_contact'
43
+ },
44
+ 'IC' => {
45
+ description: 'Information contact',
46
+ identifier: 'information_contact'
47
+ },
48
+ 'BJ' => {
49
+ description: 'Department or person responsible for processing purchase order',
50
+ identifier: 'dep_or_per_resp_for_proc_purchase_order'
51
+ },
52
+ 'BO' => {
53
+ description: 'After business hour contact',
54
+ identifier: 'after_business_hour_contact'
55
+ },
56
+ 'OC' => {
57
+ description: 'Order contact',
58
+ identifier: 'order_contact'
59
+ },
60
+ 'PD' => {
61
+ description: 'Purchasing contact',
62
+ identifier: 'purchasing_contact'
63
+ },
64
+ 'PM' => {
65
+ description: 'Product management contact',
66
+ identifier: 'product_management_contact'
67
+ },
68
+ 'SR' => {
69
+ description: 'Sales representative or department',
70
+ identifier: 'sales_representative_or_department'
71
+ },
72
+ 'QC' => {
73
+ description: 'Quality coordinator contact',
74
+ identifier: 'quality_coordinator_contact'
75
+ }
76
+ },
77
+ description: 'Contact function code',
78
+ required: true
79
+ )
80
+ contact_function_code.add(:contact_function_code, data)
81
+
82
+ structure << contact_function_code
83
+ #==============================================================================
84
+ # DEPARTMENT OR EMPLOYEE DETAILS
85
+ #==============================================================================
86
+
87
+ # TODO
88
+
89
+ Eancom.register_structure(tag: 'CTA', structure: structure)