eancom 1.4.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +7 -3
  3. data/.gitlab-ci.yml +11 -13
  4. data/.ruby-version +1 -1
  5. data/Gemfile +2 -4
  6. data/Gemfile.lock +23 -103
  7. data/README.md +46 -0
  8. data/definitions/desadv/d01b.rb +139 -93
  9. data/definitions/desadv/d96a.rb +187 -101
  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 +128 -0
  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 +85 -1
  32. data/definitions/segments/efi.rb +67 -0
  33. data/definitions/segments/eqd.rb +37 -0
  34. data/definitions/segments/ftx.rb +24 -2
  35. data/definitions/segments/gin.rb +113 -0
  36. data/definitions/segments/imd.rb +5 -1
  37. data/definitions/segments/inv.rb +94 -0
  38. data/definitions/segments/lin.rb +23 -3
  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 +72 -0
  45. data/definitions/segments/pci.rb +110 -0
  46. data/definitions/segments/pgi.rb +6 -2
  47. data/definitions/segments/pia.rb +21 -21
  48. data/definitions/segments/pri.rb +21 -1
  49. data/definitions/segments/qty.rb +219 -5
  50. data/definitions/segments/rff.rb +51 -7
  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 +7 -7
  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 +104 -100
  62. data/definitions/slsrpt/d96a.rb +104 -99
  63. data/eancom.gemspec +5 -8
  64. data/lib/eancom/edifact/document.rb +2 -2
  65. data/lib/eancom/edifact/footer.rb +1 -0
  66. data/lib/eancom/edifact/segment.rb +2 -2
  67. data/lib/eancom/edifact/segments/ajt.rb +32 -0
  68. data/lib/eancom/edifact/segments/ali.rb +2 -4
  69. data/lib/eancom/edifact/segments/bgm.rb +4 -3
  70. data/lib/eancom/edifact/segments/cdi.rb +30 -0
  71. data/lib/eancom/edifact/segments/cnt.rb +8 -1
  72. data/lib/eancom/edifact/segments/cps.rb +4 -1
  73. data/lib/eancom/edifact/segments/cta.rb +30 -0
  74. data/lib/eancom/edifact/segments/cux.rb +1 -1
  75. data/lib/eancom/edifact/segments/dgs.rb +31 -0
  76. data/lib/eancom/edifact/segments/doc.rb +30 -0
  77. data/lib/eancom/edifact/segments/dtm.rb +10 -6
  78. data/lib/eancom/edifact/segments/efi.rb +38 -0
  79. data/lib/eancom/edifact/segments/eqd.rb +30 -0
  80. data/lib/eancom/edifact/segments/ftx.rb +2 -2
  81. data/lib/eancom/edifact/segments/gin.rb +45 -0
  82. data/lib/eancom/edifact/segments/imd.rb +1 -1
  83. data/lib/eancom/edifact/segments/inv.rb +43 -0
  84. data/lib/eancom/edifact/segments/lin.rb +7 -3
  85. data/lib/eancom/edifact/segments/loc.rb +8 -5
  86. data/lib/eancom/edifact/segments/mea.rb +1 -0
  87. data/lib/eancom/edifact/segments/moa.rb +3 -3
  88. data/lib/eancom/edifact/segments/nad.rb +11 -6
  89. data/lib/eancom/edifact/segments/pac.rb +3 -1
  90. data/lib/eancom/edifact/segments/pat.rb +37 -0
  91. data/lib/eancom/edifact/segments/pcd.rb +33 -0
  92. data/lib/eancom/edifact/segments/pci.rb +40 -0
  93. data/lib/eancom/edifact/segments/pia.rb +1 -0
  94. data/lib/eancom/edifact/segments/pri.rb +0 -1
  95. data/lib/eancom/edifact/segments/qty.rb +9 -5
  96. data/lib/eancom/edifact/segments/rff.rb +8 -2
  97. data/lib/eancom/edifact/segments/rte.rb +33 -0
  98. data/lib/eancom/edifact/segments/tax.rb +7 -1
  99. data/lib/eancom/edifact/segments/tdt.rb +4 -1
  100. data/lib/eancom/edifact/segments/tod.rb +33 -0
  101. data/lib/eancom/edifact/segments/tru.rb +31 -0
  102. data/lib/eancom/edifact/segments/una.rb +2 -1
  103. data/lib/eancom/edifact/segments/unb.rb +4 -5
  104. data/lib/eancom/edifact/segments/unh.rb +6 -4
  105. data/lib/eancom/edifact/segments/uns.rb +3 -0
  106. data/lib/eancom/edifact/structure.rb +0 -1
  107. data/lib/eancom/edifact.rb +15 -1
  108. data/lib/eancom/factory.rb +1 -1
  109. data/lib/eancom/parser/document.rb +2 -10
  110. data/lib/eancom/version.rb +1 -1
  111. data/lib/eancom.rb +3 -1
  112. data/pricat.json +1 -0
  113. metadata +51 -52
  114. data/.rspec_status +0 -225
  115. data/.rubocop.yml +0 -2
@@ -8,7 +8,7 @@ structure = Eancom::Edifact::Structure.new(tag: tag)
8
8
  tag = Eancom::Edifact::Composite.new()
9
9
  data = Eancom::Edifact::Data.new(
10
10
  type: String,
11
- length: 3,
11
+ length: 1..3,
12
12
  dictionary: nil,
13
13
  description: "Message Header",
14
14
  required: true
@@ -53,6 +53,10 @@ data = Eancom::Edifact::Data.new(
53
53
  description: 'Message Batch number',
54
54
  identifier: 'message_batch_number'
55
55
  },
56
+ 'ALO' => {
57
+ description: 'Receiving advice number',
58
+ identifier: 'receiving_advice_number'
59
+ },
56
60
  'AIZ' => {
57
61
  description: 'Consolidated Invoice number',
58
62
  identifier: 'consolidated_invoice_number'
@@ -69,6 +73,26 @@ data = Eancom::Edifact::Data.new(
69
73
  description: 'Administrative reference Code',
70
74
  identifier: 'administrative_reference_code'
71
75
  },
76
+ 'AVD' => {
77
+ description: 'Inventory report request number',
78
+ identifier: 'inventory_report_request_number'
79
+ },
80
+ 'AVG' => {
81
+ description: 'Slaughterhouse approval number',
82
+ identifier: 'slaughterhouse_approval_number'
83
+ },
84
+ 'AVH' => {
85
+ description: 'Meat cutting plant approval number',
86
+ identifier: 'meat_cutting_plant_approval_number'
87
+ },
88
+ 'AVQ' => {
89
+ description: 'Place of packaging approval number',
90
+ identifier: 'place_of_packaging_approval_number'
91
+ },
92
+ 'AQQ' => {
93
+ description: 'Active Principale Exercee (APE) identifier',
94
+ identifier: 'active_principale_exercee_identifier'
95
+ },
72
96
  'CD' => {
73
97
  description: 'Credit note number',
74
98
  identifier: 'credit_note_number'
@@ -81,14 +105,14 @@ data = Eancom::Edifact::Data.new(
81
105
  description: 'Contact number',
82
106
  identifier: 'contact_number'
83
107
  },
84
- 'DL' => {
85
- description: 'Debit note number',
86
- identifier: 'debit_note_number'
87
- },
88
108
  'DQ' => {
89
109
  description: 'Delivery note number',
90
110
  identifier: 'deliver_note_number'
91
111
  },
112
+ 'GN' => {
113
+ description: 'Government reference number',
114
+ identifier: 'government_reference_number'
115
+ },
92
116
  'FC' => {
93
117
  description: 'Fiscal number',
94
118
  identifier: 'fiscal_number'
@@ -103,7 +127,7 @@ data = Eancom::Edifact::Data.new(
103
127
  },
104
128
  'ON' => {
105
129
  description: 'Order number (buyer)',
106
- identifier: 'order_number'
130
+ identifier: 'order_number_buyer'
107
131
  },
108
132
  'PL' => {
109
133
  description: 'Price list number',
@@ -121,6 +145,10 @@ data = Eancom::Edifact::Data.new(
121
145
  description: 'Purchase order change number',
122
146
  identifier: 'purchase_order_change_number'
123
147
  },
148
+ 'PQ' => {
149
+ description: 'Payment reference',
150
+ identifier: 'payment_reference'
151
+ },
124
152
  'RF' => {
125
153
  description: 'Export reference number',
126
154
  identifier: 'export_reference_number'
@@ -129,14 +157,30 @@ data = Eancom::Edifact::Data.new(
129
157
  description: 'Transaction reference number',
130
158
  identifier: 'transaction_reference_number'
131
159
  },
160
+ 'UC' => {
161
+ description: 'Ultimate consignee',
162
+ identifier: 'ultimate_consignee'
163
+ },
132
164
  'VN' => {
133
165
  description: 'Order number (supplier)',
134
- identifier: 'order_number'
166
+ identifier: 'order_number_supplier'
135
167
  },
136
168
  'VA' => {
137
169
  description: 'VAT registration number',
138
170
  identifier: 'vat_registration_number'
139
171
  },
172
+ 'XA' => {
173
+ description: 'Company/place registration number',
174
+ identifier: 'company_place_registration_number'
175
+ },
176
+ 'YC1' => {
177
+ description: 'Additional party identification (GS1 Temporary Code)',
178
+ identifier: 'additional_party_identification'
179
+ },
180
+ 'YC3' => {
181
+ description: 'Farm approval number (GS1 Temporary Code)',
182
+ identifier: 'farm_approval_number'
183
+ }
140
184
  },
141
185
  description: "Reference code quailifier",
142
186
  required: true
@@ -0,0 +1,52 @@
1
+ tag = 'RTE'
2
+ Eancom.register_segment(tag: tag, klass: Eancom::Edifact::RTE)
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: 1..3,
12
+ dictionary: nil,
13
+ description: 'Message Header',
14
+ required: true
15
+ )
16
+ tag.add(:tag, data)
17
+
18
+ structure << tag
19
+ #==============================================================================
20
+ # RATE DETAILS #
21
+ #==============================================================================
22
+ rate_details = Eancom::Edifact::Composite.new
23
+ data = Eancom::Edifact::Data.new(
24
+ type: String,
25
+ length: 1..3,
26
+ dictionary: {
27
+ '1' => {
28
+ description: 'Allowance rate',
29
+ identifier: 'allowance_rate'
30
+ },
31
+ '2' => {
32
+ description: 'Charge rate',
33
+ identifier: 'charge_rate'
34
+ }
35
+ },
36
+ description: 'Rate type code qualifier',
37
+ required: true
38
+ )
39
+ rate_details.add(:rate_type_code_qualifier, data)
40
+
41
+ data = Eancom::Edifact::Data.new(
42
+ type: String,
43
+ length: 1..15,
44
+ dictionary: nil,
45
+ description: 'Unit price basis rate',
46
+ required: true
47
+ )
48
+ rate_details.add(:unit_price_basis_rate, data)
49
+
50
+ structure << rate_details
51
+ #===============================================================================#
52
+ Eancom.register_structure(tag: 'RTE', structure: structure)
@@ -25,6 +25,10 @@ data = Eancom::Edifact::Data.new(
25
25
  type: String,
26
26
  length: 1..3,
27
27
  dictionary: {
28
+ '5' => {
29
+ description: 'Custom duty',
30
+ identifier: 'custom_duty'
31
+ },
28
32
  '7' => {
29
33
  description: 'Tax',
30
34
  identifier: 'tax'
@@ -33,8 +37,7 @@ data = Eancom::Edifact::Data.new(
33
37
  description: 'Duty or tax or fee function code qualifier',
34
38
  required: true
35
39
  )
36
- duty_or_tax_or_fee_function_code_qualifier.add(
37
- :duty_or_tax_or_fee_function_code_qualifier, data)
40
+ duty_or_tax_or_fee_function_code_qualifier.add(:duty_or_tax_or_fee_function_code_qualifier, data)
38
41
 
39
42
  structure << duty_or_tax_or_fee_function_code_qualifier
40
43
  #==============================================================================
@@ -62,6 +65,10 @@ data = Eancom::Edifact::Data.new(
62
65
  description: 'Value added tax',
63
66
  identifier: 'vat'
64
67
  },
68
+ 'IMP' => {
69
+ description: 'Import tax',
70
+ identifier: 'import_tax'
71
+ },
65
72
  },
66
73
  description: 'Duty or tax or fee type name code',
67
74
  required: true
@@ -72,7 +79,7 @@ data = Eancom::Edifact::Data.new(
72
79
  type: String,
73
80
  length: 0..17,
74
81
  dictionary: nil,
75
- description: 'Code list identifiaction code',
82
+ description: 'Code list identification code',
76
83
  required: false
77
84
  )
78
85
  duty_tax_fee_type.add(:code_list_identification_code_1, data)
@@ -86,7 +93,7 @@ data = Eancom::Edifact::Data.new(
86
93
  identifier: 'ean',
87
94
  }
88
95
  },
89
- description: 'Code list responsible agancy code',
96
+ description: 'Code list responsible agency code',
90
97
  required: false
91
98
  )
92
99
  duty_tax_fee_type.add(:code_list_responsibility_agency_code_1, data)
@@ -111,7 +118,7 @@ data = Eancom::Edifact::Data.new(
111
118
  length: 0..6,
112
119
  dictionary: nil,
113
120
  description: 'Duty or tax or fee account code',
114
- required: false
121
+ required: true
115
122
  )
116
123
  duty_tax_fee_account_detail.add(:duty_or_tax_or_fee_account_code, data)
117
124
 
@@ -128,7 +135,7 @@ data = Eancom::Edifact::Data.new(
128
135
  type: String,
129
136
  length: 0..3,
130
137
  dictionary: nil,
131
- description: 'Code list responsible agancy code',
138
+ description: 'Code list responsible agency code',
132
139
  required: false
133
140
  )
134
141
  duty_tax_fee_account_detail.add(:code_list_responsibility_agency_code_2, data)
@@ -175,7 +182,7 @@ data = Eancom::Edifact::Data.new(
175
182
  type: String,
176
183
  length: 0..3,
177
184
  dictionary: nil,
178
- description: 'Code list responsible agancy code',
185
+ description: 'Code list responsible agency code',
179
186
  required: false
180
187
  )
181
188
  duty_tax_fee_detail.add(:code_list_responsibility_agency_code_3, data)
@@ -184,8 +191,8 @@ data = Eancom::Edifact::Data.new(
184
191
  type: String,
185
192
  length: 0..17,
186
193
  dictionary: nil,
187
- description: 'Duty or Tax or Fee rate',
188
- required: false
194
+ description: 'Duty or Tax or fee rate',
195
+ required: true
189
196
  )
190
197
 
191
198
  duty_tax_fee_detail.add(:duty_or_tax_or_fee_rate, data)
@@ -221,7 +228,7 @@ data = Eancom::Edifact::Data.new(
221
228
  type: String,
222
229
  length: 0..3,
223
230
  dictionary: nil,
224
- description: 'Code list responsible agancy code',
231
+ description: 'Code list responsible agency code',
225
232
  required: false
226
233
  )
227
234
  duty_tax_fee_detail.add(:code_list_responsibility_agency_code_4, data)
@@ -25,9 +25,25 @@ data = Eancom::Edifact::Data.new(
25
25
  type: String,
26
26
  length: 1..3,
27
27
  dictionary: {
28
+ '10' => {
29
+ description: 'Pre-carriage transport',
30
+ identifier: 'pre_carriage_transport'
31
+ },
32
+ '12' => {
33
+ description: 'At departure',
34
+ identifier: 'at_departure'
35
+ },
36
+ '13' => {
37
+ description: 'At destination',
38
+ identifier: 'at_destination'
39
+ },
28
40
  '20' => {
29
41
  description: 'Main-carriage transport',
30
42
  identifier: 'main_carriage_transport'
43
+ },
44
+ '30' => {
45
+ description: 'On-carriage transport',
46
+ identifier: 'on_carriage_transport'
31
47
  }
32
48
  },
33
49
  description: "Transport stage code qualifier",
@@ -100,6 +116,10 @@ data = Eancom::Edifact::Data.new(
100
116
  type: String,
101
117
  length: 1..8,
102
118
  dictionary: {
119
+ '12' => {
120
+ description: 'Ship tanker',
121
+ identifier: 'ship_tanker'
122
+ },
103
123
  '23' => {
104
124
  description: 'Rail bulk order',
105
125
  identifier: 'rail_bulk_order'
@@ -112,6 +132,10 @@ data = Eancom::Edifact::Data.new(
112
132
  description: 'Truck',
113
133
  identifier: 'truck'
114
134
  },
135
+ '32' => {
136
+ description: 'Road tanker',
137
+ identifier: 'road_tanker'
138
+ }
115
139
  },
116
140
  description: 'Transport means description code',
117
141
  required: false
@@ -0,0 +1,64 @@
1
+ tag = 'PAT'
2
+ Eancom.register_segment(tag: tag, klass: Eancom::Edifact::PAT)
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: 1..3,
12
+ dictionary: nil,
13
+ description: 'Message Header',
14
+ required: true
15
+ )
16
+ tag.add(:tag, data)
17
+
18
+ structure << tag
19
+
20
+ delivery_or_transport_terms_function_code = Eancom::Edifact::Composite.new
21
+ data = Eancom::Edifact::Data.new(
22
+ type: String,
23
+ length: 1..3,
24
+ dictionary: {
25
+ '3' => {
26
+ description: 'Price and despatch condition',
27
+ identification: 'price_and_despatch_condition'
28
+ },
29
+ '5' => {
30
+ description: 'Transport condition',
31
+ identification: 'transport_condition'
32
+ },
33
+ '6' => {
34
+ description: 'Delivery condition',
35
+ identification: 'delivery_condition'
36
+ },
37
+ '10E' => {
38
+ description: 'Delivered by supplier (GS1 Temorary Code)',
39
+ identification: 'delivered_by_supplier_gs1'
40
+ }
41
+ },
42
+ description: 'Delivery or transport terms function code',
43
+ required: false
44
+ )
45
+ delivery_or_transport_terms_function_code.add(:delivery_or_transport_terms_function_code, data)
46
+
47
+ structure << delivery_or_transport_terms_function_code
48
+
49
+ #==============================================================================
50
+ # TERMS OF DELIVERY OR TRANSPORT #
51
+ #==============================================================================
52
+ delivery_or_transport_terms_description_code = Eancom::Edifact::Composite.new
53
+ data = Eancom::Edifact::Data.new(
54
+ type: String,
55
+ length: 1..3,
56
+ dictionary: nil,
57
+ description: 'Delivery or transport terms description code',
58
+ required: false
59
+ )
60
+ delivery_or_transport_terms_description_code.add(:delivery_or_transport_terms_description_code, data)
61
+
62
+ structure << delivery_or_transport_terms_description_code
63
+ #==============================================================================
64
+ Eancom.register_structure(tag: 'TOD', structure: structure)
@@ -0,0 +1,34 @@
1
+ tag = 'TRU'
2
+ Eancom.register_segment(tag: tag, klass: Eancom::Edifact::TRU)
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
+ # Object identifier
21
+ #==============================================================================
22
+ object_identifier = Eancom::Edifact::Composite.new
23
+ data = Eancom::Edifact::Data.new(
24
+ type: String,
25
+ length: 1..35,
26
+ dictionary: nil,
27
+ description: 'Object identifier',
28
+ required: true
29
+ )
30
+ object_identifier.add(:object_identifier, data)
31
+
32
+ structure << object_identifier
33
+ #==============================================================================
34
+ Eancom.register_structure(tag: 'TRU', structure: structure)
@@ -6,7 +6,7 @@ structure = Eancom::Edifact::Structure.new(tag: tag)
6
6
  composite = Eancom::Edifact::Composite.new()
7
7
  data = Eancom::Edifact::Data.new(
8
8
  type: String,
9
- length: 3,
9
+ length: 1..3,
10
10
  dictionary: nil,
11
11
  description: "Service String Advice",
12
12
  required: true
@@ -17,7 +17,7 @@ structure << composite
17
17
  composite = Eancom::Edifact::Composite.new()
18
18
  data = Eancom::Edifact::Data.new(
19
19
  type: String,
20
- length: 1,
20
+ length: 0..1,
21
21
  dictionary: nil,
22
22
  description: "Component data element separator",
23
23
  required: true
@@ -28,7 +28,7 @@ structure << composite
28
28
  composite = Eancom::Edifact::Composite.new()
29
29
  data = Eancom::Edifact::Data.new(
30
30
  type: String,
31
- length: 1,
31
+ length: 0..1,
32
32
  dictionary: nil,
33
33
  description: "Data element separator",
34
34
  required: true
@@ -39,7 +39,7 @@ structure << composite
39
39
  composite = Eancom::Edifact::Composite.new()
40
40
  data = Eancom::Edifact::Data.new(
41
41
  type: String,
42
- length: 1,
42
+ length: 0..1,
43
43
  dictionary: nil,
44
44
  description: "Decimal notation",
45
45
  required: true
@@ -50,7 +50,7 @@ structure << composite
50
50
  composite = Eancom::Edifact::Composite.new()
51
51
  data = Eancom::Edifact::Data.new(
52
52
  type: String,
53
- length: 1,
53
+ length: 0..1,
54
54
  dictionary: nil,
55
55
  description: "Release character",
56
56
  required: true
@@ -61,7 +61,7 @@ structure << composite
61
61
  composite = Eancom::Edifact::Composite.new()
62
62
  data = Eancom::Edifact::Data.new(
63
63
  type: String,
64
- length: 1,
64
+ length: 0..1,
65
65
  dictionary: nil,
66
66
  description: "Reserved for future use",
67
67
  required: true
@@ -72,7 +72,7 @@ structure << composite
72
72
  composite = Eancom::Edifact::Composite.new()
73
73
  data = Eancom::Edifact::Data.new(
74
74
  type: String,
75
- length: 1,
75
+ length: 0..1,
76
76
  dictionary: nil,
77
77
  description: "Segment terminator",
78
78
  required: true
@@ -8,7 +8,7 @@ structure = Eancom::Edifact::Structure.new(tag: tag)
8
8
  tag = Eancom::Edifact::Composite.new()
9
9
  data = Eancom::Edifact::Data.new(
10
10
  type: String,
11
- length: 3,
11
+ length: 1..3,
12
12
  dictionary: nil,
13
13
  description: "Interchange Header",
14
14
  required: true
@@ -44,7 +44,7 @@ syntax_dictionary = {
44
44
  }
45
45
  data = Eancom::Edifact::Data.new(
46
46
  type: String,
47
- length: 4,
47
+ length: 1..4,
48
48
  dictionary: syntax_dictionary,
49
49
  description: "Syntax identifier.",
50
50
  required: true
@@ -154,7 +154,7 @@ date_and_time_of_preparation.add(:date, data)
154
154
 
155
155
  data = Eancom::Edifact::Data.new(
156
156
  type: String,
157
- length: 4,
157
+ length: 1..4,
158
158
  dictionary: nil,
159
159
  description: "Time (HHMM)",
160
160
  required: true
@@ -193,7 +193,7 @@ recipient_reference.add(:recipient_reference, data)
193
193
 
194
194
  data = Eancom::Edifact::Data.new(
195
195
  type: String,
196
- length: 2,
196
+ length: 1..2,
197
197
  dictionary: nil,
198
198
  description: "Recipient reference/password qualifier.",
199
199
  required: false
@@ -38,8 +38,33 @@ message_identifier = Eancom::Edifact::Composite.new()
38
38
  data = Eancom::Edifact::Data.new(
39
39
  type: String,
40
40
  length: 1..6,
41
- dictionary: nil,
42
- description: 'Identification of a message',
41
+ dictionary: {
42
+ 'ORDERS' => {
43
+ description: 'Purchase order message'
44
+ },
45
+ 'SLSRPT' => {
46
+ description: 'Sales data report message'
47
+ },
48
+ 'DESADV' => {
49
+ description: 'Despatch advice message'
50
+ },
51
+ 'INVRPT' => {
52
+ description: 'Inventory report message'
53
+ },
54
+ 'PRICAT' => {
55
+ description: 'Price catalogue message'
56
+ },
57
+ 'ORDRSP' => {
58
+ description: 'Orders report message'
59
+ },
60
+ 'INVOIC' => {
61
+ description: 'Invoice message'
62
+ },
63
+ 'RETANN' => {
64
+ description: 'Announcement for returns message'
65
+ }
66
+ },
67
+ description: 'Message Type',
43
68
  required: true
44
69
  )
45
70
  message_identifier.add(:message_type, data)
@@ -69,6 +94,9 @@ data = Eancom::Edifact::Data.new(
69
94
  },
70
95
  '96A' => {
71
96
  description: 'Release 96A'
97
+ },
98
+ 'UN' => {
99
+ description: 'UN/CEFACT'
72
100
  }
73
101
  },
74
102
  description: 'Message release number',
@@ -82,6 +110,9 @@ data = Eancom::Edifact::Data.new(
82
110
  dictionary: {
83
111
  'UN' => {
84
112
  description: 'UN/CEFACT'
113
+ },
114
+ 'EN' => {
115
+ description: 'Default value'
85
116
  }
86
117
  },
87
118
  description: 'Controlling agency',
@@ -92,15 +123,49 @@ message_identifier.add(:controlling_agency, data)
92
123
  data = Eancom::Edifact::Data.new(
93
124
  type: String,
94
125
  length: 1..6,
95
- dictionary: nil,
126
+ dictionary: {
127
+ 'EAN001' => {
128
+ description: 'GS1 version control number (GS1 Permanent Code)'
129
+ },
130
+ 'EAN011' => {
131
+ description: 'GS1 version control number (GS1 Permanent Code)'
132
+ },
133
+ 'EAN003' => {
134
+ description: 'GS1 version control number (GS1 Permanent Code)'
135
+ },
136
+ 'EAN004' => {
137
+ description: 'GS1 version control number (GS1 Permanent Code)'
138
+ },
139
+ 'EAN005' => {
140
+ description: 'GS1 version control number (GS1 Permanent Code)'
141
+ },
142
+ 'EAN006' => {
143
+ description: 'GS1 version control number (GS1 Permanent Code)'
144
+ },
145
+ 'EAN007' => {
146
+ description: 'GS1 version control number (GS1 Permanent Code)'
147
+ },
148
+ 'EAN008' => {
149
+ description: 'GS1 version control number (GS1 Permanent Code)'
150
+ },
151
+ 'EAN009' => {
152
+ description: 'GS1 version control number (GS1 Permanent Code)'
153
+ },
154
+ 'EAN010' => {
155
+ description: 'GS1 version control number (GS1 Code)'
156
+ },
157
+ 'GDSN23' => {
158
+ description: 'GDSN version 2.3 (GS1 Permanent Code)'
159
+ }
160
+ },
96
161
  description: 'Association assigned code',
97
- required: true
162
+ required: false
98
163
  )
99
164
  message_identifier.add(:association_assigned_code, data)
100
165
 
101
166
  structure << message_identifier
102
167
  #==============================================================================
103
- # Code list directory version number # #
168
+ # Code list directory version number #
104
169
  #==============================================================================
105
170
  code_list_directory_version_number = Eancom::Edifact::Composite.new()
106
171
 
@@ -8,7 +8,7 @@ structure = Eancom::Edifact::Structure.new(tag: tag)
8
8
  tag = Eancom::Edifact::Composite.new()
9
9
  data = Eancom::Edifact::Data.new(
10
10
  type: String,
11
- length: 3,
11
+ length: 1..3,
12
12
  dictionary: nil,
13
13
  description: "Message Header",
14
14
  required: true
@@ -23,7 +23,7 @@ section_identification = Eancom::Edifact::Composite.new()
23
23
 
24
24
  data = Eancom::Edifact::Data.new(
25
25
  type: String,
26
- length: 1,
26
+ length: 0..1,
27
27
  dictionary: {
28
28
  'S' => {
29
29
  description: 'Detail/summary section separation',
@@ -8,7 +8,7 @@ structure = Eancom::Edifact::Structure.new(tag: tag)
8
8
  tag = Eancom::Edifact::Composite.new()
9
9
  data = Eancom::Edifact::Data.new(
10
10
  type: String,
11
- length: 3,
11
+ length: 1..3,
12
12
  dictionary: nil,
13
13
  description: "Message Header",
14
14
  required: true
@@ -38,7 +38,7 @@ data = Eancom::Edifact::Data.new(
38
38
  type: String,
39
39
  length: 1..14,
40
40
  dictionary: nil,
41
- description: "Number of segments in the message",
41
+ description: "Message reference number",
42
42
  required: true
43
43
  )
44
44
  message_reference_number.add(:message_reference_number, data)