eancom 1.6.3 → 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 +204 -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 -7
  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
@@ -27,7 +27,7 @@ data = Eancom::Edifact::Data.new(
27
27
  dictionary: {
28
28
  'AAA' => {
29
29
  description: 'Calculation net',
30
- identifier: 'calculation_net',
30
+ identifier: 'calculation_net'
31
31
  },
32
32
  'AAB' => {
33
33
  description: 'Calculation gross',
@@ -85,6 +85,10 @@ data = Eancom::Edifact::Data.new(
85
85
  type: String,
86
86
  length: 0..3,
87
87
  dictionary: {
88
+ 'AE' => {
89
+ description: 'Range dependent price',
90
+ identifier: 'range_dependent_price'
91
+ },
88
92
  'CA' => {
89
93
  description: 'Catalogue',
90
94
  identifier: 'cataloque',
@@ -119,30 +123,38 @@ data = Eancom::Edifact::Data.new(
119
123
  description: 'Expected unit price',
120
124
  identifier: 'expected_unit_price'
121
125
  },
122
- 'LIU' => {
123
- description: 'List price',
124
- identifier: 'list_price',
125
- },
126
126
  'LBL' => {
127
127
  description: 'Labelling price',
128
128
  identifier: 'labelling_price'
129
129
  },
130
+ 'PPR' => {
131
+ description: 'Provisional price',
132
+ identifier: 'provisional_price'
133
+ },
134
+ 'PRP' => {
135
+ description: 'Promotional price',
136
+ identifier: 'promotional_price'
137
+ },
130
138
  'MRP' => {
131
139
  description: 'Market retail price',
132
140
  identifier: 'market_retail_price',
133
141
  },
134
- 'NTP' => {
135
- description: 'Net unit price',
136
- identifier: 'net_unit_price',
137
- },
138
- 'RTP' => {
139
- description: 'Retail price',
140
- identifier: 'retail_price',
142
+ 'LIU' => {
143
+ description: 'List price',
144
+ identifier: 'list_price',
141
145
  },
142
146
  'SRP' => {
143
147
  description: 'Suggested retail price',
144
148
  identifier: 'suggested_retail_price',
145
149
  },
150
+ 'RTP' => {
151
+ description: 'Retail price',
152
+ identifier: 'retail_price',
153
+ },
154
+ 'NTP' => {
155
+ description: 'Net unit price',
156
+ identifier: 'net_unit_price',
157
+ }
146
158
  },
147
159
  description: 'Price specification code',
148
160
  required: false
@@ -161,7 +173,7 @@ price_information.add(:unit_price_basis_value, data)
161
173
  data = Eancom::Edifact::Data.new(
162
174
  type: String,
163
175
  length: 0..3,
164
- dictionary: {
176
+ dictionary: {
165
177
  'KGM' => {
166
178
  description: 'Kilogram',
167
179
  identifier: 'kilogram',
@@ -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
  description: 'QUANTITY DETAILS',
13
13
  required: true
14
14
  )
@@ -24,9 +24,13 @@ data = Eancom::Edifact::Data.new(
24
24
  type: String,
25
25
  length: 1..3,
26
26
  dictionary: {
27
+ '1' => {
28
+ description: 'Discrete quantity',
29
+ identifier: 'discrete_quantity'
30
+ },
27
31
  '11' => {
28
32
  description: 'Split quantity',
29
- identifier: 'split_quantity',
33
+ identifier: 'split_quantity'
30
34
  },
31
35
  '12' => {
32
36
  description: 'Despatch quantity',
@@ -36,6 +40,14 @@ data = Eancom::Edifact::Data.new(
36
40
  description: 'Ordered quantity',
37
41
  identifier: 'ordered_quantity'
38
42
  },
43
+ '26' => {
44
+ description: 'Promotion Quantity',
45
+ identifier: 'promotion_quantity'
46
+ },
47
+ '46' => {
48
+ description: 'Delivered quantity',
49
+ identifier: 'delivered_quantity'
50
+ },
39
51
  '47' => {
40
52
  description: 'Invoiced quantity',
41
53
  identifier: 'invoiced_quantity'
@@ -48,14 +60,66 @@ data = Eancom::Edifact::Data.new(
48
60
  description: 'Minimum order quantity',
49
61
  identifier: 'minimum_order_quantity'
50
62
  },
63
+ '54' => {
64
+ description: 'Maximum order quantity',
65
+ identifier: 'maximum_order_quantity'
66
+ },
51
67
  '59' => {
52
68
  description: 'Numbers of consumer units in the traded unit',
53
69
  identifier: 'numbers_or_consumer_units_in_the_traded_unit'
54
70
  },
71
+ '61' => {
72
+ description: 'Return quantity',
73
+ identifier: 'return_quantity'
74
+ },
75
+ '66' => {
76
+ description: 'Committed quantity',
77
+ identifier: 'commited_quantity'
78
+ },
79
+ '81' => {
80
+ description: 'Extra unplanned delivery',
81
+ identifier: 'extra_unplanned_delivery'
82
+ },
83
+ '83' => {
84
+ description: 'Backorder quantity',
85
+ identifier: 'backorder_quantity'
86
+ },
87
+ '89' => {
88
+ description: 'Quality control held',
89
+ identifier: 'quality_control_held'
90
+ },
91
+ '96' => {
92
+ description: 'Quality control failed',
93
+ identifier: 'quality_control_failed'
94
+ },
95
+ '97' => {
96
+ description: 'Minimum inventory',
97
+ identifier: 'minimum_inventory'
98
+ },
99
+ '98' => {
100
+ description: 'Maximum inventory',
101
+ identifier: 'maximum_inventory'
102
+ },
103
+ '124' => {
104
+ description: 'Damaged goods',
105
+ identifier: 'damaged_goods'
106
+ },
55
107
  '129' => {
56
108
  description: 'Units per unit price',
57
109
  identifier: 'units_per_unit_price'
58
110
  },
111
+ '145' => {
112
+ description: 'Actual stock',
113
+ identifier: 'actual_stock'
114
+ },
115
+ '146' => {
116
+ description: 'Model or target stock',
117
+ identifier: 'model_or_target_stock'
118
+ },
119
+ '157' => {
120
+ description: 'Opening stock balance quantity',
121
+ identifier: 'opening_stock_balance_quantity'
122
+ },
59
123
  '153' => {
60
124
  description: 'Statistical sales quantity',
61
125
  identifier: 'statistical_sales_quantitiy'
@@ -63,6 +127,122 @@ data = Eancom::Edifact::Data.new(
63
127
  '160' => {
64
128
  description: 'Minimum production batch',
65
129
  identifier: 'minimum_production_batch'
130
+ },
131
+ '164' => {
132
+ description: 'Delivery batch',
133
+ identifier: 'delivery_batch'
134
+ },
135
+ '193' => {
136
+ description: 'Free quantity included',
137
+ identifier: 'free_quantity_included'
138
+ },
139
+ '197' => {
140
+ description: 'Reordering level',
141
+ identifier: 'reordering_level'
142
+ },
143
+ '198' => {
144
+ description: 'Quantity in transit',
145
+ identifier: 'quantity_in_transit'
146
+ },
147
+ '199' => {
148
+ description: 'Inventory withdrawal quantity',
149
+ identifier: 'inventory_withdrawal_quantity'
150
+ },
151
+ '200' => {
152
+ description: 'Free quantity not included',
153
+ identifier: 'free_quantity_not_included'
154
+ },
155
+ '212' => {
156
+ description: 'Quantity sold, net',
157
+ identifier: 'quantity_sold_net'
158
+ },
159
+ '17E' => {
160
+ description: 'Number of units in lower packaging or configuration level (GS1 Temporary Code)',
161
+ identifier: 'number_of_units_in_lower_packaging_or_configuration_level'
162
+ },
163
+ '22E' => {
164
+ description: 'Free quantity basis (GS1 Temporary Code)',
165
+ identifier: 'free_quantity_basis'
166
+ },
167
+ '32E' => {
168
+ description: 'Consolidated discount stock (GS1 Temporary Code)',
169
+ identifier: 'consolidated_discound_stock_gs1_temporary_code'
170
+ },
171
+ '45E' => {
172
+ description: 'Number of units in higher packaging or configuration level',
173
+ identifier: 'number_of_units_in_higher_packaging_or_configuration_level'
174
+ },
175
+ '249' => {
176
+ description: 'Quantity displayed not available for sale',
177
+ identifier: 'quantity_displayed_not_available_for_sale'
178
+ },
179
+ '503' => {
180
+ description: 'Quantity to be checked',
181
+ identifier: 'quantity_to_be_checked'
182
+ },
183
+ '504' => {
184
+ description: 'Number of wash loads',
185
+ identifier: 'number_of_wash_loads'
186
+ },
187
+ '93E' => {
188
+ description: 'Extraordinary sale (GS1 Temporary Code)',
189
+ identifier: 'extraordinary_sale_gs1_temporary_code'
190
+ },
191
+ '251' => {
192
+ description: 'Incremental order quantity',
193
+ identifier: 'incremental_order_quantity'
194
+ },
195
+ '257' => {
196
+ description: 'Quantity in physical inventory',
197
+ identifier: 'quantity_in_physical_inventory'
198
+ },
199
+ '399' => {
200
+ description: 'File size before compression',
201
+ identifier: 'file_size_before_compression'
202
+ },
203
+ '400' => {
204
+ description: 'File size after compression',
205
+ identifier: 'file_size_after_compression'
206
+ },
207
+ 'X20' => {
208
+ description: 'Reserved quantity, provisional (GS1 Temporary Code)',
209
+ identifier: 'reserved_quantity_provisional_gs1_temporary_code'
210
+ },
211
+ 'X22' => {
212
+ description: 'Consignment stock, available on ordering (GS1 Temporary Code)',
213
+ identifier: 'consignment_stock_available_on_ordering_gs1_temporary_code'
214
+ },
215
+ 'X23' => {
216
+ description: 'Consignment block, available at due date (GS1 Temporary Code)',
217
+ identifier: 'consignment_block_available_at_due_date_gs1_temporary_code'
218
+ },
219
+ 'X24' => {
220
+ description: 'Consignment stock, available at due date (GS1 Temporary Code)',
221
+ identifier: 'consignment_stock_available_at_due_date_gs1_temporary_code'
222
+ },
223
+ '447' => {
224
+ description: 'Quantity moved between outlets',
225
+ identifier: 'quantity_moved_between_outlets'
226
+ },
227
+ '452' => {
228
+ description: 'En route to warehouse quantity',
229
+ identifier: 'en_route:_to_warehouse_quantity'
230
+ },
231
+ '453' => {
232
+ description: 'En route from warehouse quantity',
233
+ identifier: 'en_route_from_warehouse_quantity'
234
+ },
235
+ '454' => {
236
+ description: 'Quantity ordered but not yet allocated from stock',
237
+ identifier: 'quantity_ordered_but_not_yet_allocated_from_stock'
238
+ },
239
+ '455' => {
240
+ description: 'Not yet ordered quantity',
241
+ identifier: 'not_yet_ordered_quantity'
242
+ },
243
+ '457' => {
244
+ description: 'Maximum number of units per shelf',
245
+ identifier: 'maximum_number_of_units_per_shelf'
66
246
  }
67
247
  },
68
248
  description: 'Quantity type code qualifier',
@@ -81,6 +261,28 @@ quantity_details.add(:quantity, data)
81
261
  data = Eancom::Edifact::Data.new(
82
262
  type: String,
83
263
  length: 0..3,
264
+ dictionary: {
265
+ 'EA' => {
266
+ description: 'Each',
267
+ identifier: 'each'
268
+ },
269
+ 'PCE' => {
270
+ description: 'Piece',
271
+ identifier: 'piece'
272
+ },
273
+ 'KGM' => {
274
+ description: 'kilogram',
275
+ identifier: 'kilogram'
276
+ },
277
+ 'PND' => {
278
+ description: 'Pound (GS1 Temporary Code)',
279
+ identifier: 'pound'
280
+ },
281
+ '59' => {
282
+ description: 'part per million',
283
+ identifier: 'part_per_million'
284
+ }
285
+ },
84
286
  description: 'Measurement unit code',
85
287
  required: false
86
288
  )
@@ -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
@@ -49,14 +49,14 @@ data = Eancom::Edifact::Data.new(
49
49
  description: 'Beneficiarys reference',
50
50
  identifier: 'beneficiarys_reference'
51
51
  },
52
- 'AJS' => {
53
- description: 'Agreement number',
54
- identifier: 'agreement_number'
55
- },
56
52
  'ALL' => {
57
53
  description: 'Message Batch number',
58
54
  identifier: 'message_batch_number'
59
55
  },
56
+ 'ALO' => {
57
+ description: 'Receiving advice number',
58
+ identifier: 'receiving_advice_number'
59
+ },
60
60
  'AIZ' => {
61
61
  description: 'Consolidated Invoice number',
62
62
  identifier: 'consolidated_invoice_number'
@@ -73,6 +73,26 @@ data = Eancom::Edifact::Data.new(
73
73
  description: 'Administrative reference Code',
74
74
  identifier: 'administrative_reference_code'
75
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
+ },
76
96
  'CD' => {
77
97
  description: 'Credit note number',
78
98
  identifier: 'credit_note_number'
@@ -85,13 +105,13 @@ data = Eancom::Edifact::Data.new(
85
105
  description: 'Contact number',
86
106
  identifier: 'contact_number'
87
107
  },
88
- 'DL' => {
89
- description: 'Debit note number',
90
- identifier: 'debit_note_number'
91
- },
92
108
  'DQ' => {
93
109
  description: 'Delivery note number',
94
- identifier: 'delivery_note_number'
110
+ identifier: 'deliver_note_number'
111
+ },
112
+ 'GN' => {
113
+ description: 'Government reference number',
114
+ identifier: 'government_reference_number'
95
115
  },
96
116
  'FC' => {
97
117
  description: 'Fiscal number',
@@ -125,6 +145,10 @@ data = Eancom::Edifact::Data.new(
125
145
  description: 'Purchase order change number',
126
146
  identifier: 'purchase_order_change_number'
127
147
  },
148
+ 'PQ' => {
149
+ description: 'Payment reference',
150
+ identifier: 'payment_reference'
151
+ },
128
152
  'RF' => {
129
153
  description: 'Export reference number',
130
154
  identifier: 'export_reference_number'
@@ -133,6 +157,10 @@ data = Eancom::Edifact::Data.new(
133
157
  description: 'Transaction reference number',
134
158
  identifier: 'transaction_reference_number'
135
159
  },
160
+ 'UC' => {
161
+ description: 'Ultimate consignee',
162
+ identifier: 'ultimate_consignee'
163
+ },
136
164
  'VN' => {
137
165
  description: 'Order number (supplier)',
138
166
  identifier: 'order_number_supplier'
@@ -141,9 +169,17 @@ data = Eancom::Edifact::Data.new(
141
169
  description: 'VAT registration number',
142
170
  identifier: 'vat_registration_number'
143
171
  },
144
- 'XB8' => {
145
- description: 'Agreement number',
146
- identifier: 'agreement_number_old'
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'
147
183
  }
148
184
  },
149
185
  description: "Reference code quailifier",
@@ -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