eancom 0.1.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (137) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +190 -5
  3. data/.gitlab-ci.yml +25 -0
  4. data/.ruby-version +1 -0
  5. data/Gemfile.lock +22 -18
  6. data/README.md +46 -0
  7. data/bin/console +3 -2
  8. data/definitions/desadv/d01b.rb +251 -0
  9. data/definitions/desadv/d96a.rb +208 -87
  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 +328 -0
  24. data/definitions/segments/ali.rb +93 -0
  25. data/definitions/segments/bgm.rb +395 -0
  26. data/definitions/segments/cav.rb +122 -0
  27. data/definitions/segments/cci.rb +136 -0
  28. data/definitions/segments/cdi.rb +39 -0
  29. data/definitions/segments/cnt.rb +82 -0
  30. data/definitions/segments/cps.rb +76 -0
  31. data/definitions/segments/cta.rb +89 -0
  32. data/definitions/segments/cux.rb +174 -0
  33. data/definitions/segments/dgs.rb +34 -0
  34. data/definitions/segments/doc.rb +45 -0
  35. data/definitions/segments/dtm.rb +243 -0
  36. data/definitions/segments/efi.rb +67 -0
  37. data/definitions/segments/eqd.rb +37 -0
  38. data/definitions/segments/ftx.rb +165 -0
  39. data/definitions/segments/gin.rb +113 -0
  40. data/definitions/segments/imd.rb +360 -0
  41. data/definitions/segments/inv.rb +94 -0
  42. data/definitions/segments/lin.rb +133 -0
  43. data/definitions/segments/loc.rb +137 -0
  44. data/definitions/segments/mea.rb +189 -0
  45. data/definitions/segments/moa.rb +228 -0
  46. data/definitions/segments/nad.rb +314 -0
  47. data/definitions/segments/pac.rb +262 -0
  48. data/definitions/segments/pat.rb +171 -0
  49. data/definitions/segments/pcd.rb +72 -0
  50. data/definitions/segments/pci.rb +110 -0
  51. data/definitions/segments/pgi.rb +152 -0
  52. data/definitions/segments/pia.rb +501 -0
  53. data/definitions/segments/pri.rb +208 -0
  54. data/definitions/segments/qty.rb +293 -0
  55. data/definitions/segments/rff.rb +210 -0
  56. data/definitions/segments/rte.rb +52 -0
  57. data/definitions/segments/tax.rb +266 -0
  58. data/definitions/segments/tdt.rb +278 -0
  59. data/definitions/segments/tod.rb +64 -0
  60. data/definitions/segments/tru.rb +34 -0
  61. data/definitions/segments/una.rb +85 -0
  62. data/definitions/segments/unb.rb +284 -0
  63. data/definitions/segments/unh.rb +183 -0
  64. data/definitions/segments/uns.rb +40 -0
  65. data/definitions/segments/unt.rb +48 -0
  66. data/definitions/segments/unz.rb +48 -0
  67. data/definitions/slsrpt/d01b.rb +206 -0
  68. data/definitions/slsrpt/d96a.rb +199 -0
  69. data/eancom.gemspec +2 -1
  70. data/lib/eancom.rb +61 -16
  71. data/lib/eancom/definition.rb +1 -1
  72. data/lib/eancom/edifact.rb +60 -13
  73. data/lib/eancom/edifact/body.rb +63 -0
  74. data/lib/eancom/edifact/composite.rb +38 -0
  75. data/lib/eancom/edifact/data.rb +108 -0
  76. data/lib/eancom/edifact/document.rb +43 -11
  77. data/lib/eancom/edifact/document_element.rb +26 -0
  78. data/lib/eancom/edifact/footer.rb +7 -0
  79. data/lib/eancom/edifact/header.rb +15 -0
  80. data/lib/eancom/edifact/item.rb +40 -0
  81. data/lib/eancom/edifact/message.rb +24 -16
  82. data/lib/eancom/edifact/segment.rb +131 -12
  83. data/lib/eancom/edifact/segments/ajt.rb +32 -0
  84. data/lib/eancom/edifact/segments/alc.rb +61 -0
  85. data/lib/eancom/edifact/segments/ali.rb +50 -0
  86. data/lib/eancom/edifact/segments/bgm.rb +46 -0
  87. data/lib/eancom/edifact/segments/cav.rb +47 -0
  88. data/lib/eancom/edifact/segments/cci.rb +53 -0
  89. data/lib/eancom/edifact/segments/cdi.rb +30 -0
  90. data/lib/eancom/edifact/segments/cnt.rb +40 -0
  91. data/lib/eancom/edifact/segments/cps.rb +33 -0
  92. data/lib/eancom/edifact/segments/cta.rb +30 -0
  93. data/lib/eancom/edifact/segments/cux.rb +60 -0
  94. data/lib/eancom/edifact/segments/dgs.rb +31 -0
  95. data/lib/eancom/edifact/segments/doc.rb +30 -0
  96. data/lib/eancom/edifact/segments/dtm.rb +47 -0
  97. data/lib/eancom/edifact/segments/efi.rb +38 -0
  98. data/lib/eancom/edifact/segments/eqd.rb +30 -0
  99. data/lib/eancom/edifact/segments/ftx.rb +63 -0
  100. data/lib/eancom/edifact/segments/gin.rb +45 -0
  101. data/lib/eancom/edifact/segments/imd.rb +69 -0
  102. data/lib/eancom/edifact/segments/inv.rb +43 -0
  103. data/lib/eancom/edifact/segments/lin.rb +47 -0
  104. data/lib/eancom/edifact/segments/loc.rb +46 -0
  105. data/lib/eancom/edifact/segments/mea.rb +54 -0
  106. data/lib/eancom/edifact/segments/moa.rb +45 -0
  107. data/lib/eancom/edifact/segments/nad.rb +112 -0
  108. data/lib/eancom/edifact/segments/pac.rb +56 -0
  109. data/lib/eancom/edifact/segments/pat.rb +37 -0
  110. data/lib/eancom/edifact/segments/pcd.rb +33 -0
  111. data/lib/eancom/edifact/segments/pci.rb +40 -0
  112. data/lib/eancom/edifact/segments/pgi.rb +45 -0
  113. data/lib/eancom/edifact/segments/pia.rb +108 -0
  114. data/lib/eancom/edifact/segments/pri.rb +53 -0
  115. data/lib/eancom/edifact/segments/qty.rb +44 -0
  116. data/lib/eancom/edifact/segments/rff.rb +47 -0
  117. data/lib/eancom/edifact/segments/rte.rb +33 -0
  118. data/lib/eancom/edifact/segments/tax.rb +78 -0
  119. data/lib/eancom/edifact/segments/tdt.rb +57 -0
  120. data/lib/eancom/edifact/segments/tod.rb +33 -0
  121. data/lib/eancom/edifact/segments/tru.rb +31 -0
  122. data/lib/eancom/edifact/segments/una.rb +52 -0
  123. data/lib/eancom/edifact/segments/unb.rb +68 -0
  124. data/lib/eancom/edifact/segments/unh.rb +50 -0
  125. data/lib/eancom/edifact/segments/uns.rb +32 -0
  126. data/lib/eancom/edifact/segments/unt.rb +28 -0
  127. data/lib/eancom/edifact/segments/unz.rb +28 -0
  128. data/lib/eancom/edifact/structure.rb +90 -0
  129. data/lib/eancom/factory.rb +9 -8
  130. data/lib/eancom/parser.rb +7 -0
  131. data/lib/eancom/parser/document.rb +60 -0
  132. data/lib/eancom/parser/segment.rb +71 -0
  133. data/lib/eancom/version.rb +1 -1
  134. data/pricat.json +1 -0
  135. metadata +141 -9
  136. data/lib/eancom/edifact/element.rb +0 -16
  137. data/lib/eancom/edifact/envelope.rb +0 -24
@@ -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)
@@ -0,0 +1,165 @@
1
+ tag = 'FTX'
2
+ Eancom.register_segment(tag: tag, klass: Eancom::Edifact::FTX)
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
+ # Text subject code qualifier #
21
+ #==============================================================================
22
+ text_subject_code_qualifier = Eancom::Edifact::Composite.new()
23
+
24
+ data = Eancom::Edifact::Data.new(
25
+ type: String,
26
+ length: 1..3,
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
+ },
41
+ description: "Text subject code qualifier",
42
+ required: true
43
+ )
44
+ text_subject_code_qualifier.add(:text_subject_code_qualifier, data)
45
+
46
+ structure << text_subject_code_qualifier
47
+ #==============================================================================
48
+ # Free Text function code
49
+ #==============================================================================
50
+ free_text_function_code = Eancom::Edifact::Composite.new()
51
+
52
+ data = Eancom::Edifact::Data.new(
53
+ type: String,
54
+ length: 0..3,
55
+ dictionary: {
56
+ '1' => {
57
+ description: 'Text for subsequent use',
58
+ identifier: 'text_for_subsequent_use'
59
+ },
60
+ '3' => {
61
+ description: 'Text for subsequent use',
62
+ identifier: 'text_for_subsequent_use'
63
+ }
64
+ },
65
+ description: "Free Text function code",
66
+ required: false
67
+ )
68
+ free_text_function_code.add(:free_text_function_code, data)
69
+
70
+ structure << free_text_function_code
71
+ #==============================================================================
72
+ # Text Reference
73
+ #==============================================================================
74
+ text_reference = Eancom::Edifact::Composite.new()
75
+
76
+ data = Eancom::Edifact::Data.new(
77
+ type: String,
78
+ length: 0..3,
79
+ dictionary: {
80
+ '001' => {
81
+ description: 'Standard Text',
82
+ identifier: 'standard_text'
83
+ }
84
+ },
85
+ description: "Free Text value_code",
86
+ required: false
87
+ )
88
+ text_reference.add(:free_text_value_code, data)
89
+
90
+ data = Eancom::Edifact::Data.new(
91
+ type: String,
92
+ length: 0..17,
93
+ description: "Code list identification code",
94
+ required: false
95
+ )
96
+ text_reference.add(:code_list_identification_code, data)
97
+
98
+ data = Eancom::Edifact::Data.new(
99
+ type: String,
100
+ length: 0..3,
101
+ dictionary: {
102
+ '9' => {
103
+ description: 'GS1',
104
+ identifier: 'gs1'
105
+ },
106
+ '91' => {
107
+ description: "Assigned by supplier or supplier's agent",
108
+ identifier: 'assigned_by_supplier_or_suppliers_agent'
109
+ },
110
+ '92' => {
111
+ description: "Assigned by buyer or buyer's agent",
112
+ identifier: 'assigned_by_buyer_or_buyers_agent'
113
+ },
114
+ '246' => {
115
+ description: "GS1 Germany",
116
+ identifier: 'gs1_germany'
117
+ }
118
+ },
119
+ description: "Code list responsible agency code",
120
+ required: false
121
+ )
122
+ text_reference.add(:code_list_responsible_agency_code, data)
123
+
124
+ structure << text_reference
125
+ #==============================================================================
126
+ # Text Literal
127
+ #==============================================================================
128
+ text_literal = Eancom::Edifact::Composite.new()
129
+
130
+ data = Eancom::Edifact::Data.new(
131
+ type: String,
132
+ length: 0..512,
133
+ dictionary: nil,
134
+ description: "Free Text Value",
135
+ required: false
136
+ )
137
+ text_literal.add(:free_text_value_1, data)
138
+
139
+ data = Eancom::Edifact::Data.new(
140
+ type: String,
141
+ length: 0..512,
142
+ dictionary: nil,
143
+ description: "Free Text Value",
144
+ required: false
145
+ )
146
+ text_literal.add(:free_text_value_2, data)
147
+ text_literal.add(:free_text_value_3, data)
148
+ text_literal.add(:free_text_value_4, data)
149
+ text_literal.add(:free_text_value_5, data)
150
+
151
+ structure << text_literal
152
+ #==============================================================================
153
+ # Language Name code
154
+ language_name_code = Eancom::Edifact::Composite.new()
155
+
156
+ data = Eancom::Edifact::Data.new(
157
+ type: String,
158
+ length: 0..3,
159
+ dictionary: nil,
160
+ description: "Language name Code",
161
+ required: false
162
+ )
163
+ language_name_code.add(:language_name_code, data)
164
+ #==============================================================================
165
+ Eancom.register_structure(tag: 'FTX', structure: structure)
@@ -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)
@@ -0,0 +1,360 @@
1
+ tag = 'IMD'
2
+ Eancom.register_segment(tag: tag, klass: Eancom::Edifact::IMD)
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
+ # Description Format Code #
21
+ #==============================================================================
22
+ description_format_code = Eancom::Edifact::Composite.new()
23
+
24
+ data = Eancom::Edifact::Data.new(
25
+ type: String,
26
+ length: 1..3,
27
+ dictionary: {
28
+ 'C' => {
29
+ description: 'Code (from industry code list)',
30
+ identifier: 'code'
31
+ },
32
+ 'D' => {
33
+ description: 'Free-from price look up',
34
+ identifier: 'free_form_price_look_up'
35
+ },
36
+ 'E' => {
37
+ description: 'Free-form short description',
38
+ identifier: 'free_form_short_description'
39
+ },
40
+ 'F' => {
41
+ description: 'Free-form',
42
+ identifier: 'free_form'
43
+ },
44
+ 'S' => {
45
+ description: 'Structured (from industry code list)',
46
+ identifier: 'structured'
47
+ },
48
+ 'B' => {
49
+ description: 'Code and text',
50
+ identifier: 'code_and_text'
51
+ }
52
+ },
53
+ description: "Description format code",
54
+ required: true
55
+ )
56
+ description_format_code.add(:description_format_code, data)
57
+
58
+ structure << description_format_code
59
+ #==============================================================================
60
+ # Item Characteristic #
61
+ #==============================================================================
62
+ item_characteristic = Eancom::Edifact::Composite.new()
63
+
64
+ item_characteristic_code = Eancom::Edifact::Data.new(
65
+ type: String,
66
+ length: 0..3,
67
+ dictionary: {
68
+ '2' => {
69
+ description: 'General product form',
70
+ identifier: 'general_product_form'
71
+ },
72
+ '4' => {
73
+ description: 'Finish',
74
+ identifier: 'finish'
75
+ },
76
+ '35' => {
77
+ description: 'Colour',
78
+ identifier: 'colour'
79
+ },
80
+ '44' => {
81
+ description: 'Further identifying characteristic',
82
+ identifier: 'further_identifying_characteristic'
83
+ },
84
+ '98' => {
85
+ description: 'Size',
86
+ identifier: 'Size'
87
+ },
88
+ 'ANM' => {
89
+ description: 'Article Name',
90
+ identifier: 'article_name'
91
+ },
92
+ 'BRN' => {
93
+ description: 'Brand Name',
94
+ identifier: 'brand_name'
95
+ },
96
+ 'DSC' => {
97
+ description: 'Description',
98
+ identifier: 'description'
99
+ },
100
+ 'FN' => {
101
+ description: 'Function Name',
102
+ identifier: 'function_name'
103
+ },
104
+ 'IN' => {
105
+ description: 'Invoice name',
106
+ identifier: 'invoice_name'
107
+ },
108
+ 'PR' => {
109
+ description: 'Product range',
110
+ identifier: 'product_range'
111
+ },
112
+ 'SB' => {
113
+ description: 'Subbrand',
114
+ identifier: 'subbrand'
115
+ },
116
+ 'TPE' => {
117
+ description: 'Article Type',
118
+ identifier: 'article_type'
119
+ },
120
+ 'STE' => {
121
+ description: 'Style',
122
+ identifier: 'style'
123
+ },
124
+ 'MNF' => {
125
+ description: 'Manufacturer',
126
+ identifier: 'manufacturer'
127
+ },
128
+ 'XX1' => {
129
+ description: 'Collar Type',
130
+ identifier: 'collar_type'
131
+ },
132
+ 'XX3' => {
133
+ description: 'Colthing Cut',
134
+ identifier: 'colthing_cut'
135
+ },
136
+ 'XX4' => {
137
+ description: 'Non marked traded item components',
138
+ identifier: 'non_marked_traded_item_components'
139
+ },
140
+ 'XX5' => {
141
+ description: 'Campaign name',
142
+ identifier: 'campaign_name'
143
+ },
144
+ 'XX6' => {
145
+ description: 'Season name',
146
+ identifier: 'season_name'
147
+ },
148
+ },
149
+ description: "Item characteristic code",
150
+ required: true
151
+ )
152
+ item_characteristic.add(:item_characteristic_code, item_characteristic_code)
153
+
154
+ code_list_identification_code = Eancom::Edifact::Data.new(
155
+ type: String,
156
+ length: 0..17,
157
+ description: "Code list identification code",
158
+ required: false
159
+ )
160
+ item_characteristic.add(:code_list_identification_code, code_list_identification_code)
161
+
162
+ code_list_responsible_agency_code = Eancom::Edifact::Data.new(
163
+ type: String,
164
+ length: 0..3,
165
+ dictionary: {
166
+ '9' => {
167
+ description: 'GS1',
168
+ identifier: 'gs1'
169
+ }
170
+ },
171
+ description: "Code list responsible agency code",
172
+ required: false
173
+ )
174
+ item_characteristic.add(:code_list_responsible_agency_code, code_list_responsible_agency_code)
175
+
176
+ structure << item_characteristic
177
+ #==============================================================================
178
+ # Item Description #
179
+ #==============================================================================
180
+ item_description = Eancom::Edifact::Composite.new()
181
+
182
+ data = Eancom::Edifact::Data.new(
183
+ type: String,
184
+ length: 0..17,
185
+ dictionary: {
186
+ 'ORU' => {
187
+ description: 'Ordering Unit',
188
+ identifier: 'ordering_unit'
189
+ },
190
+ 'NO' => {
191
+ description: 'Not an ordering Unit',
192
+ identifier: 'not_an_ordering_unit'
193
+ },
194
+ 'BU' => {
195
+ description: 'Base unit',
196
+ identifier: 'base_unit'
197
+ },
198
+ 'NBU' => {
199
+ description: 'Not a Base unit',
200
+ identifier: 'not_a_base_unit'
201
+ },
202
+ 'CU' => {
203
+ description: 'Consumer unit (GS1 Permanent Code)',
204
+ identifier: 'consumer_unit'
205
+ },
206
+ 'NCU' => {
207
+ description: 'Not a Consumer unit (GS1 Permanent Code)',
208
+ identifier: 'not_a_consumer_unit'
209
+ },
210
+ 'DU' => {
211
+ description: 'Despatch unit (GS1 Permanent Code)',
212
+ identifier: 'despatch_unit'
213
+ },
214
+ 'NDU' => {
215
+ description: 'Not a Despatch unit (GS1 Permanent Code)',
216
+ identifier: 'not_a_despatch_unit'
217
+ },
218
+ 'IN' => {
219
+ description: 'Invoicing unit',
220
+ identifier: 'invoicing_unit'
221
+ },
222
+ 'NIN' => {
223
+ description: 'Not a Invoicing unit',
224
+ identifier: 'not_a_invoicing_unit'
225
+ },
226
+ 'TU' => {
227
+ description: 'Traded unit (GS1 Permanent Code)',
228
+ identifier: 'traded_unit'
229
+ },
230
+ 'VQ' => {
231
+ description: 'Variable quantity product (GS1 Permanent Code)',
232
+ identifier: 'variable_quantity_product'
233
+ },
234
+ 'NVQ' => {
235
+ description: 'Not a Variable quantity product (GS1 Permanent Code)',
236
+ identifier: 'not_a_variable_quantity_product'
237
+ },
238
+ 'DST' => {
239
+ description: 'Display stand',
240
+ identifier: 'display_stand'
241
+ },
242
+ 'SU' => {
243
+ description: 'Smallest unit',
244
+ identifier: 'smallest_unit'
245
+ },
246
+ 'CA' => {
247
+ description: 'Case',
248
+ identifier: 'case'
249
+ },
250
+ 'DSP' => {
251
+ description: 'Display shipper',
252
+ identifier: 'display_shipper'
253
+ },
254
+ 'MM' => {
255
+ description: 'Mixed module',
256
+ identifier: 'mixed_module'
257
+ },
258
+ 'MP' => {
259
+ description: 'Multipack',
260
+ identifier: 'multipack'
261
+ },
262
+ 'PIP' => {
263
+ description: 'Packer or inner pack',
264
+ identifier: 'packer_or_inner_pack'
265
+ },
266
+ 'PAL' => {
267
+ description: 'Pallet',
268
+ identifier: 'pallet'
269
+ },
270
+ 'PPK' => {
271
+ description: 'Prepack',
272
+ identifier: 'prepack'
273
+ },
274
+ 'PAS' => {
275
+ description: 'Prepack assortment',
276
+ identifier: 'prepack_assortment'
277
+ },
278
+ 'SPK' => {
279
+ description: 'Setpack',
280
+ identifier: 'setpack'
281
+ },
282
+ 'NOT' => {
283
+ description: 'Not, not an NOS item (GS1 Permanent Code)',
284
+ identifier: 'not_not_an_nos_item'
285
+ },
286
+ '*' => {
287
+ description: 'N/A',
288
+ identifier: 'na'
289
+ }
290
+ },
291
+ description: 'Item description code',
292
+ required: false
293
+ )
294
+ item_description.add(:item_description_code, data)
295
+
296
+ code_list_identification_code_1 = Eancom::Edifact::Data.new(
297
+ type: String,
298
+ length: 0..17,
299
+ description: 'Code list identification code',
300
+ required: false
301
+ )
302
+ item_description.add(:code_list_identification_code_1, code_list_identification_code_1)
303
+
304
+ code_list_responsible_agency_code_1 = Eancom::Edifact::Data.new(
305
+ type: String,
306
+ length: 0..3,
307
+ dictionary: {
308
+ '9' => {
309
+ description: 'GS1',
310
+ identifier: 'gs1'
311
+ },
312
+ '91' => {
313
+ description: "Assigned by supplier or supplier's agent",
314
+ identifier: 'assigned_by_supplier_or_suppliers_agent'
315
+ },
316
+ '92' => {
317
+ description: "Assigned by buyer or buyer's agent",
318
+ identifier: "assigned_by_buyer_or_buyers_agent"
319
+ }
320
+ },
321
+ description: 'Code list responsible agency code',
322
+ required: false
323
+ )
324
+ item_description.add(:code_list_responsible_agency_code_1, code_list_responsible_agency_code_1)
325
+
326
+ description = Eancom::Edifact::Data.new(
327
+ type: String,
328
+ length: 0..256,
329
+ description: 'Item description',
330
+ required: false
331
+ )
332
+ item_description.add(:item_description_1, description)
333
+ item_description.add(:item_description_2, description)
334
+
335
+ language_name_code = Eancom::Edifact::Data.new(
336
+ type: String,
337
+ length: 0..3,
338
+ description: 'Language name code',
339
+ required: false
340
+ )
341
+ item_description.add(:language_name_code, language_name_code)
342
+
343
+ structure << item_description
344
+ #==============================================================================
345
+ # Surface or Layer Code #
346
+ #==============================================================================
347
+ surface_or_layer_code = Eancom::Edifact::Composite.new()
348
+
349
+ data = Eancom::Edifact::Data.new(
350
+ type: String,
351
+ length: 0..3,
352
+ dictionary: nil,
353
+ description: "Surface or layer code",
354
+ required: false
355
+ )
356
+ surface_or_layer_code.add(:surface_or_layer_code, data)
357
+
358
+ structure << surface_or_layer_code
359
+ #==============================================================================
360
+ Eancom.register_structure(tag: 'IMD', structure: structure)