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
@@ -36,6 +36,10 @@ currency_type_dictionary = {
36
36
  description: 'Price list currency',
37
37
  identifier: 'price_list_currency'
38
38
  },
39
+ '9' => {
40
+ description: 'Order currency',
41
+ identifier: 'order_currency'
42
+ },
39
43
  '10' => {
40
44
  description: 'Pricing_currency',
41
45
  identifier: 'pricing_currency'
@@ -43,6 +47,10 @@ currency_type_dictionary = {
43
47
  '11' => {
44
48
  description: 'Payment currency',
45
49
  identifier: 'payment_currency'
50
+ },
51
+ '12' => {
52
+ description: 'Quotation currency',
53
+ identifier: 'quotation_currency'
46
54
  }
47
55
  }
48
56
 
@@ -55,7 +63,6 @@ data = Eancom::Edifact::Data.new(
55
63
  description: 'Currency usage code qualifier',
56
64
  required: true
57
65
  )
58
-
59
66
  currency_details.add(:currency_usage_code_qualifier_1, data)
60
67
 
61
68
  data = Eancom::Edifact::Data.new(
@@ -98,7 +105,7 @@ data = Eancom::Edifact::Data.new(
98
105
  length: 1..3,
99
106
  dictionary: currency_type_dictionary,
100
107
  description: 'Currency usage code qualifier',
101
- required: false
108
+ required: true
102
109
  )
103
110
 
104
111
  currency_details_2.add(:currency_usage_code_qualifier_2, data)
@@ -0,0 +1,34 @@
1
+ tag = 'DGS'
2
+ Eancom.register_segment(tag: tag, klass: Eancom::Edifact::DGS)
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
+ # HAZARD CODE #
21
+ #==============================================================================
22
+ hazard_identification_code = Eancom::Edifact::Composite.new()
23
+ data = Eancom::Edifact::Data.new(
24
+ type: String,
25
+ length: 1..7,
26
+ dictionary: nil,
27
+ description: 'Hazard identification code',
28
+ required: true
29
+ )
30
+ hazard_identification_code.add(:hazard_identification_code, data)
31
+
32
+ structure << hazard_identification_code
33
+ #==============================================================================
34
+ Eancom.register_structure(tag: 'DGS', structure: structure)
@@ -0,0 +1,45 @@
1
+ tag = 'DOC'
2
+ Eancom.register_segment(tag: tag, klass: Eancom::Edifact::DOC)
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
+ # DOCUMENT/MESSAGE NAME #
21
+ #==============================================================================
22
+ document_name_code = Eancom::Edifact::Composite.new
23
+
24
+ data = Eancom::Edifact::Data.new(
25
+ type: String,
26
+ length: 1..3,
27
+ dictionary: {
28
+ '270' => {
29
+ description: 'Delivery note'
30
+ },
31
+ '381' => {
32
+ description: 'Credit note - goods and services'
33
+ },
34
+ '71E' => {
35
+ description: 'Instruction for returns (GS1 Temporary Code)'
36
+ }
37
+ },
38
+ description: 'Document name code',
39
+ required: false
40
+ )
41
+ document_name_code.add(:document_name_code, data)
42
+
43
+ structure << document_name_code
44
+ #==============================================================================
45
+ Eancom.register_structure(tag: 'DOC', structure: structure)
@@ -21,9 +21,13 @@ type_dictionary = {
21
21
  identifier: 'service_completion_date_time_actual'
22
22
  },
23
23
  '2' => {
24
- description: 'Delivery date/time, reqested',
24
+ description: 'Delivery date/time, requested',
25
25
  identifier: 'delivery_date_time'
26
26
  },
27
+ '3' => {
28
+ description: 'Invoice date/time, requested',
29
+ identifier: 'invoice_date_time'
30
+ },
27
31
  '7' => {
28
32
  description: 'Effectiv date/time',
29
33
  identifier: 'effectiv_date_time'
@@ -32,6 +36,14 @@ type_dictionary = {
32
36
  description: 'Despatch date and/or time',
33
37
  identifier: 'despatch_date_and_or_time'
34
38
  },
39
+ '12' => {
40
+ description: 'Terms discount due date/time',
41
+ identifier: 'terms_discount_due_date_time'
42
+ },
43
+ '13' => {
44
+ description: 'Terms net due date',
45
+ identifier: 'terms_net_due_date'
46
+ },
35
47
  '17' => {
36
48
  description: 'Delivery date/time, estimated',
37
49
  identifier: 'delivery_date_time_estimated'
@@ -68,10 +80,34 @@ type_dictionary = {
68
80
  description: 'Delivery date/time, earliest',
69
81
  identifier: 'delivery_date_time_earliest'
70
82
  },
83
+ '100' => {
84
+ description: 'Product ageing period before delivery',
85
+ identifier: 'product_ageing_period_before_delivery'
86
+ },
87
+ '110' => {
88
+ description: 'ship date/time',
89
+ identifier: 'ship_date_time'
90
+ },
91
+ '132' => {
92
+ description: 'Arrival date/time, estimated',
93
+ identifier: 'arrival_date_time_estimated'
94
+ },
95
+ '133' => {
96
+ description: 'Departure date/time, estimated',
97
+ identifier: 'departure_date_time_estimated'
98
+ },
99
+ '134' => {
100
+ description: 'Rate of exchange date/time',
101
+ identifier: 'rate_of_exchange_date_time'
102
+ },
71
103
  '137' => {
72
104
  description: 'Document/message date/time',
73
105
  identifier: 'document_message_date_time'
74
106
  },
107
+ '140' => {
108
+ description: 'Payment due date',
109
+ identifier: 'payment_due_date'
110
+ },
75
111
  '157' => {
76
112
  description: 'Validity start date',
77
113
  identifier: 'valitity_start_date'
@@ -80,22 +116,58 @@ type_dictionary = {
80
116
  description: 'Reference date/time',
81
117
  identifier: 'reference_date_time'
82
118
  },
119
+ '186' => {
120
+ description: 'Departure date/time, actual',
121
+ identifier: 'departure_date_time_actual'
122
+ },
123
+ '194' => {
124
+ description: 'Start date/time',
125
+ identifier: 'start_date_time'
126
+ },
83
127
  '200' => {
84
128
  description: 'Pick-up/collection date/time of cargo',
85
129
  identifier: 'pick_up_collection_date_time_of_cargo'
86
130
  },
131
+ '206' => {
132
+ description: 'End date/time',
133
+ identifier: 'end_date_time'
134
+ },
135
+ '209' => {
136
+ description: 'Value date',
137
+ identifier: 'value_date'
138
+ },
139
+ '235' => {
140
+ description: 'Collection date/time',
141
+ identifier: 'collection_date_time'
142
+ },
87
143
  '263' => {
88
144
  description: 'Invoicing period',
89
145
  identifier: 'invoicing_period'
90
146
  },
147
+ '267' => {
148
+ description: 'Rate/price date/time',
149
+ identifier: 'rate_price_date_time'
150
+ },
151
+ '273' => {
152
+ description: 'Validity period',
153
+ identifier: 'validity_period'
154
+ },
91
155
  '325' => {
92
156
  description: 'Tax period',
93
157
  identifier: 'tax_period'
94
158
  },
159
+ '326' => {
160
+ description: 'Charge period',
161
+ identifier: 'charge_period'
162
+ },
95
163
  '356' => {
96
164
  description: 'Sales date, and or time, and or period',
97
165
  identifier: 'sales_date_and_or_time_and_or_period'
98
166
  },
167
+ '366' => {
168
+ description: 'Inventory report date',
169
+ identifier: 'inventory_report_date'
170
+ },
99
171
  '454' => {
100
172
  description: 'Accounting value date',
101
173
  identifier: 'accounting_value_date'
@@ -143,6 +215,18 @@ format_dictionary = {
143
215
  description: 'Period',
144
216
  value: 'CCYYMMDD-CCZZMMDD',
145
217
  identifier: 'period'
218
+ },
219
+ '802' => {
220
+ description: 'Month',
221
+ identifier: 'month'
222
+ },
223
+ '803' => {
224
+ description: 'Week',
225
+ identifier: 'week'
226
+ },
227
+ '804' => {
228
+ description: 'Day',
229
+ identifier: 'day'
146
230
  }
147
231
  }
148
232
 
@@ -0,0 +1,67 @@
1
+ tag = 'EFI'
2
+ Eancom.register_segment(tag: tag, klass: Eancom::Edifact::EFI)
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
+ # FILE IDENTIFICATION #
21
+ #==============================================================================
22
+ file_name = Eancom::Edifact::Composite.new()
23
+
24
+ data = Eancom::Edifact::Data.new(
25
+ type: String,
26
+ length: 1..3,
27
+ dictionary: nil,
28
+ description: 'File name',
29
+ required: true
30
+ )
31
+ file_name.add(:file_name, data)
32
+
33
+ structure << file_name
34
+ #==============================================================================
35
+ # FILE DETAILS #
36
+ #==============================================================================
37
+ file_format_name = Eancom::Edifact::Composite.new()
38
+
39
+ data = Eancom::Edifact::Data.new(
40
+ type: String,
41
+ length: 1..3,
42
+ dictionary: nil,
43
+ description: 'File format name',
44
+ required: true
45
+ )
46
+ file_format_name.add(:file_format_name, data)
47
+
48
+ data = Eancom::Edifact::Data.new(
49
+ type: String,
50
+ length: 1..3,
51
+ dictionary: {
52
+ '3' => {
53
+ description: 'Binary',
54
+ identifier: 'binary'
55
+ },
56
+ '4' => {
57
+ description: 'Analogue',
58
+ identifier: 'analogue'
59
+ }
60
+ },
61
+ description: 'Data format description code',
62
+ required: false
63
+ )
64
+ file_format_name.add(:data_format_description_code, data)
65
+ structure << file_format_name
66
+ #==============================================================================
67
+ Eancom.register_structure(tag: 'EFI', structure: structure)
@@ -0,0 +1,37 @@
1
+ tag = 'EQD'
2
+ Eancom.register_segment(tag: tag, klass: Eancom::Edifact::EQD)
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
+ equipment_code_qualifier = Eancom::Edifact::Composite.new
21
+ data = Eancom::Edifact::Data.new(
22
+ type: String,
23
+ length: 1..3,
24
+ dictionary: {
25
+ 'CN' => {
26
+ description: 'Container',
27
+ identifier: 'container'
28
+ }
29
+ },
30
+ description: 'Equipment code qualifier',
31
+ required: true
32
+ )
33
+ equipment_code_qualifier.add(:equipment_code_qualifier, data)
34
+
35
+ structure << equipment_code_qualifier
36
+ #==============================================================================
37
+ Eancom.register_structure(tag: 'EQD', structure: structure)
@@ -24,7 +24,20 @@ text_subject_code_qualifier = Eancom::Edifact::Composite.new()
24
24
  data = Eancom::Edifact::Data.new(
25
25
  type: String,
26
26
  length: 1..3,
27
- dictionary: nil,
27
+ dictionary: {
28
+ 'PUR' => {
29
+ description: 'Purchasing information',
30
+ identifier: 'purchasing_information'
31
+ },
32
+ 'ZZZ' => {
33
+ description: 'Mutually defined',
34
+ identifier: 'mutually_defined'
35
+ },
36
+ 'SUR' => {
37
+ description: 'Supplier remarks',
38
+ identifier: 'supplier_remarks'
39
+ }
40
+ },
28
41
  description: "Text subject code qualifier",
29
42
  required: true
30
43
  )
@@ -43,6 +56,10 @@ data = Eancom::Edifact::Data.new(
43
56
  '1' => {
44
57
  description: 'Text for subsequent use',
45
58
  identifier: 'text_for_subsequent_use'
59
+ },
60
+ '3' => {
61
+ description: 'Text for subsequent use',
62
+ identifier: 'text_for_subsequent_use'
46
63
  }
47
64
  },
48
65
  description: "Free Text function code",
@@ -59,7 +76,12 @@ text_reference = Eancom::Edifact::Composite.new()
59
76
  data = Eancom::Edifact::Data.new(
60
77
  type: String,
61
78
  length: 0..3,
62
- dictionary: nil,
79
+ dictionary: {
80
+ '001' => {
81
+ description: 'Standard Text',
82
+ identifier: 'standard_text'
83
+ }
84
+ },
63
85
  description: "Free Text value_code",
64
86
  required: false
65
87
  )
@@ -0,0 +1,113 @@
1
+ tag = 'GIN'
2
+ Eancom.register_segment(tag: tag, klass: Eancom::Edifact::GIN)
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 identification code qualifier
21
+ #==============================================================================
22
+ object_identification_code_qualifier = Eancom::Edifact::Composite.new()
23
+ data = Eancom::Edifact::Data.new(
24
+ type: String,
25
+ length: 1..3,
26
+ dictionary: {
27
+ 'BJ' => {
28
+ description: 'Serial shipping container code',
29
+ identifier: 'serial_shipping_container_code'
30
+ },
31
+ 'SRV' => {
32
+ description: 'GS1 Global Trade Item Number (GS1 Temporary Code)',
33
+ identifier: 'gs1_global_trade_item_number'
34
+ }
35
+ },
36
+ description: 'Object identification code qualifier',
37
+ required: true
38
+ )
39
+ object_identification_code_qualifier.add(:object_identification_code_qualifier, data)
40
+
41
+ structure << object_identification_code_qualifier
42
+ #==============================================================================
43
+ # Identity number range
44
+ #==============================================================================
45
+ object_identifier_1 = Eancom::Edifact::Composite.new()
46
+ data = Eancom::Edifact::Data.new(
47
+ type: String,
48
+ length: 1..35,
49
+ dictionary: nil,
50
+ description: 'Object identifier one',
51
+ required: true
52
+ )
53
+ object_identifier_1.add(:object_identifier_1, data)
54
+
55
+ structure << object_identifier_1
56
+ #==============================================================================
57
+ # Identity number range
58
+ #==============================================================================
59
+ object_identifier_2 = Eancom::Edifact::Composite.new()
60
+ data = Eancom::Edifact::Data.new(
61
+ type: String,
62
+ length: 1..35,
63
+ dictionary: nil,
64
+ description: 'Object identifier two',
65
+ required: true
66
+ )
67
+ object_identifier_2.add(:object_identifier_2, data)
68
+
69
+ structure << object_identifier_2
70
+ #==============================================================================
71
+ # Identity number range
72
+ #==============================================================================
73
+ object_identifier_3 = Eancom::Edifact::Composite.new()
74
+ data = Eancom::Edifact::Data.new(
75
+ type: String,
76
+ length: 1..35,
77
+ dictionary: nil,
78
+ description: 'Object identifier three',
79
+ required: true
80
+ )
81
+ object_identifier_3.add(:object_identifier_3, data)
82
+
83
+ structure << object_identifier_3
84
+ #==============================================================================
85
+ # Identity number range
86
+ #==============================================================================
87
+ object_identifier_4 = Eancom::Edifact::Composite.new()
88
+ data = Eancom::Edifact::Data.new(
89
+ type: String,
90
+ length: 1..35,
91
+ dictionary: nil,
92
+ description: 'Object identifier four',
93
+ required: true
94
+ )
95
+ object_identifier_4.add(:object_identifier_4, data)
96
+
97
+ structure << object_identifier_4
98
+ #==============================================================================
99
+ # Identity number range
100
+ #==============================================================================
101
+ object_identifier_5 = Eancom::Edifact::Composite.new()
102
+ data = Eancom::Edifact::Data.new(
103
+ type: String,
104
+ length: 1..35,
105
+ dictionary: nil,
106
+ description: 'Object identifier five',
107
+ required: true
108
+ )
109
+ object_identifier_5.add(:object_identifier_5, data)
110
+
111
+ structure << object_identifier_5
112
+
113
+ Eancom.register_structure(tag: 'GIN', structure: structure)
@@ -63,7 +63,7 @@ item_characteristic = Eancom::Edifact::Composite.new()
63
63
 
64
64
  item_characteristic_code = Eancom::Edifact::Data.new(
65
65
  type: String,
66
- length: 1..3,
66
+ length: 0..3,
67
67
  dictionary: {
68
68
  '2' => {
69
69
  description: 'General product form',
@@ -121,6 +121,10 @@ item_characteristic_code = Eancom::Edifact::Data.new(
121
121
  description: 'Style',
122
122
  identifier: 'style'
123
123
  },
124
+ 'MNF' => {
125
+ description: 'Manufacturer',
126
+ identifier: 'manufacturer'
127
+ },
124
128
  'XX1' => {
125
129
  description: 'Collar Type',
126
130
  identifier: 'collar_type'
@@ -0,0 +1,94 @@
1
+ tag = 'INV'
2
+ Eancom.register_segment(tag: tag, klass: Eancom::Edifact::INV)
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
+ # Inventory movement direction code #
21
+ #==============================================================================
22
+ inventory_movement_direction_code = Eancom::Edifact::Composite.new
23
+ data = Eancom::Edifact::Data.new(
24
+ type: String,
25
+ length: 1..3,
26
+ dictionary: {
27
+ '1' => {
28
+ description: 'Movement out of inventory',
29
+ identifier: 'movement_out_of_inventory'
30
+ },
31
+ '2' => {
32
+ description: 'Movement into inventory',
33
+ identifier: 'movement_into_inventory'
34
+ }
35
+ },
36
+ description: 'Inventory movement direction code',
37
+ required: false
38
+ )
39
+ inventory_movement_direction_code.add(:inventory_movement_direction_code, data)
40
+ structure << inventory_movement_direction_code
41
+ #==============================================================================
42
+ # Inventory type code #
43
+ #==============================================================================
44
+ inventory_type_code = Eancom::Edifact::Composite.new
45
+ data = Eancom::Edifact::Data.new(
46
+ type: String,
47
+ length: 1..3,
48
+ dictionary: nil,
49
+ description: 'Inventory type code',
50
+ required: false
51
+ )
52
+ inventory_type_code.add(:inventory_type_code, data)
53
+ structure << inventory_type_code
54
+ #==============================================================================
55
+ # Inventory movement reason code #
56
+ #==============================================================================
57
+ inventory_movement_reason_code = Eancom::Edifact::Composite.new
58
+ data = Eancom::Edifact::Data.new(
59
+ type: String,
60
+ length: 1..3,
61
+ dictionary: nil,
62
+ description: 'Inventory movement reason code',
63
+ required: false
64
+ )
65
+ inventory_movement_reason_code.add(:inventory_movement_reason_code, data)
66
+ structure << inventory_movement_reason_code
67
+ #==============================================================================
68
+ # Inventory balance method code #
69
+ #==============================================================================
70
+ inventory_balance_method_code = Eancom::Edifact::Composite.new
71
+ data = Eancom::Edifact::Data.new(
72
+ type: String,
73
+ length: 1..3,
74
+ dictionary: {
75
+ '1' => {
76
+ description: 'Book-keeping inventory balance',
77
+ identifier: 'book_keeping_inventory_balance'
78
+ },
79
+ '2' => {
80
+ description: 'Formal inventory balance',
81
+ identifier: 'formal_inventory_balance'
82
+ }
83
+ },
84
+ description: 'Inventory balance method code',
85
+ required: false
86
+ )
87
+ inventory_balance_method_code.add(:inventory_balance_method_code, data)
88
+ structure << inventory_balance_method_code
89
+ #==============================================================================
90
+ # INSTRUCTION #
91
+ #==============================================================================
92
+ # TODO
93
+
94
+ Eancom.register_structure(tag: 'INV', structure: structure)
@@ -39,7 +39,28 @@ action_request_notification_description_code = Eancom::Edifact::Composite.new()
39
39
  data = Eancom::Edifact::Data.new(
40
40
  type: String,
41
41
  length: 0..3,
42
- dictionary: nil,
42
+ dictionary: {
43
+ '1' => {
44
+ description: 'Added',
45
+ identifier: 'added'
46
+ },
47
+ '3' => {
48
+ description: 'Changed',
49
+ identifier: 'changed'
50
+ },
51
+ '4' => {
52
+ description: 'No action',
53
+ identifier: 'no_action'
54
+ },
55
+ '5' => {
56
+ description: 'Accepted without amendment',
57
+ identifier: 'accepted_without_amendment'
58
+ },
59
+ '7' => {
60
+ description: 'Not accepted',
61
+ identifier: 'not_accepted'
62
+ }
63
+ },
43
64
  description: 'Action request/notification description code',
44
65
  required: false
45
66
  )
@@ -90,7 +111,7 @@ data = Eancom::Edifact::Data.new(
90
111
  dictionary: {
91
112
  '1' => {
92
113
  description: 'Sub-line information',
93
- identifier: 'sub_line_information',
114
+ identifier: 'sub_line_information'
94
115
  }
95
116
  },
96
117
  description: 'Sub-line indicator code',
@@ -107,7 +128,6 @@ data = Eancom::Edifact::Data.new(
107
128
  )
108
129
  sub_line_information.add(:line_item_identifier_2, data)
109
130
 
110
-
111
131
  structure << sub_line_information
112
132
  #==============================================================================
113
133
  Eancom.register_structure(tag: 'LIN', structure: structure)