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,110 @@
1
+ tag = 'PCI'
2
+ Eancom.register_segment(tag: tag, klass: Eancom::Edifact::PCI)
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
+ # Marking instructions code #
21
+ #==============================================================================
22
+ marking_instructions_code = Eancom::Edifact::Composite.new
23
+ data = Eancom::Edifact::Data.new(
24
+ type: String,
25
+ length: 1..3,
26
+ dictionary: {
27
+ '1' => {
28
+ description: 'Do not mark suppliers company name',
29
+ identifier: 'do_not_mark_suppliers_company_name'
30
+ },
31
+ '2' => {
32
+ description: 'Mark customers company name',
33
+ identifier: 'mark_customers_company_name'
34
+ },
35
+ '3' => {
36
+ description: 'Mark customers references',
37
+ identifier: 'mark_customers_references'
38
+ },
39
+ '6' => {
40
+ description: 'Mark packages dimensions',
41
+ identifier: 'mark_packages_dimensions'
42
+ },
43
+ '7' => {
44
+ description: 'Mark net weight',
45
+ identifier: 'mark_net_weight'
46
+ },
47
+ '8' => {
48
+ description: 'Mark gross weight',
49
+ identifier: 'mark_gross_weight'
50
+ },
51
+ '10' => {
52
+ description: 'Mark batch number',
53
+ identifier: 'mark_batch_number'
54
+ },
55
+ '14' => {
56
+ description: 'Mark expiry date',
57
+ identifier: 'mark_expiry_date'
58
+ },
59
+ '16' => {
60
+ description: 'Buyers instructions',
61
+ identifier: 'buyers_instructions'
62
+ },
63
+ '17' => {
64
+ description: "Supplier's instructions",
65
+ identifier: 'supliers_instructions'
66
+ },
67
+ '18' => {
68
+ description: "Carrier's instructions",
69
+ identifier: 'carriers_instructions'
70
+ },
71
+ '33E' => {
72
+ description: 'Marked with serial shipping container code (GS1 Temporary Code)',
73
+ identifier: 'marked_with_serial_shipping_container_code_gs1_temporary_code'
74
+ },
75
+ '34E' => {
76
+ description: 'Marked with GS1 number (GS1 Temporary Code)',
77
+ identifier: 'marked_with_gs1_number'
78
+ }
79
+ },
80
+ description: 'Marking instructions code',
81
+ required: false
82
+ )
83
+ marking_instructions_code.add(:marking_instructions_code, data)
84
+
85
+ structure << marking_instructions_code
86
+ #==============================================================================
87
+ # MARKS & LABELS #
88
+ #==============================================================================
89
+ marks_and_labels_code = Eancom::Edifact::Composite.new
90
+ data = Eancom::Edifact::Data.new(
91
+ type: String,
92
+ length: 1..35,
93
+ dictionary: nil,
94
+ description: 'Shipping marks description',
95
+ required: true
96
+ )
97
+ marks_and_labels_code.add(:shipping_marks_description, data)
98
+
99
+ data = Eancom::Edifact::Data.new(
100
+ type: String,
101
+ length: 1..3,
102
+ dictionary: nil,
103
+ description: 'Container or package contents indicator code',
104
+ required: false
105
+ )
106
+ marks_and_labels_code.add(:container_or_package_contents_indicator_mode, data)
107
+
108
+ structure << marks_and_labels_code
109
+
110
+ Eancom.register_structure(tag: 'PCI', structure: structure)
@@ -0,0 +1,152 @@
1
+ tag = 'PGI'
2
+ Eancom.register_segment(tag: tag, klass: Eancom::Edifact::PGI)
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
+ # Product group type code #
21
+ #==============================================================================
22
+ product_group_type_code = Eancom::Edifact::Composite.new()
23
+
24
+ data = Eancom::Edifact::Data.new(
25
+ type: String,
26
+ length: 1..3,
27
+ dictionary: {
28
+ '2' => {
29
+ description: 'No price group used',
30
+ identifier: 'no_price_group_used'
31
+ },
32
+ '3' => {
33
+ description: 'Catalogue',
34
+ identifier: 'catalogue'
35
+ },
36
+ '4' => {
37
+ description: 'Group of products with same price',
38
+ identifier: 'group_of_products_with_same_price'
39
+ },
40
+ '9' => {
41
+ description: 'No group used',
42
+ identifier: 'no_group_uses'
43
+ },
44
+ '10' => {
45
+ description: 'Price group',
46
+ identifier: 'price_group'
47
+ },
48
+ '12' => {
49
+ description: 'Promotional group',
50
+ identifier: 'promotional_group'
51
+ },
52
+ '14' => {
53
+ description: 'Geographical target market devsion/subdivison code',
54
+ identifier: 'geographical_targeg_marget_devision_subdivision_code'
55
+ },
56
+ 'BAX' => {
57
+ description: 'Base article execution rule group',
58
+ identifier: 'base_article_execution_rule_group'
59
+ },
60
+ '11' => {
61
+ description: 'Product group',
62
+ identifier: 'product_group'
63
+ },
64
+ '10E' => {
65
+ description: 'Group of complementary products',
66
+ identifier: 'group_of_complementary_products'
67
+ },
68
+ 'BEX' => {
69
+ description: 'GTIN allocation group for special purposes (GS1 Temporary Code)',
70
+ identifier: 'gtin_allocation_group_for_special_purposes'
71
+ },
72
+ 'DEF' => {
73
+ description: 'Definition Group',
74
+ identifier: 'definition_group'
75
+ },
76
+ 'MUL' => {
77
+ description: 'Metadata linked to multi-media objects group',
78
+ identifier: 'metadata_linked_to_multi_media_objects_group'
79
+ },
80
+ 'PAX' => {
81
+ description: 'Price allocation group',
82
+ identifier: 'price_allocation_group'
83
+ },
84
+ 'PXC' => {
85
+ description: 'Price execution rule group',
86
+ identifier: 'price_execution_rule_group'
87
+ }
88
+ },
89
+ description: 'Product group type code',
90
+ required: true
91
+ )
92
+ product_group_type_code.add(:product_group_type_code, data)
93
+
94
+ structure << product_group_type_code
95
+ #==============================================================================
96
+ # Product group #
97
+ #==============================================================================
98
+ product_group = Eancom::Edifact::Composite.new()
99
+
100
+ data = Eancom::Edifact::Data.new(
101
+ type: String,
102
+ length: 0..25,
103
+ dictionary: nil,
104
+ description: 'Product group name code',
105
+ required: false
106
+ )
107
+ product_group.add(:product_group_name_code, data)
108
+
109
+ data = Eancom::Edifact::Data.new(
110
+ type: String,
111
+ length: 0..17,
112
+ dictionary: nil,
113
+ description: 'Code list identification code',
114
+ required: false
115
+ )
116
+ product_group.add(:code_list_idenfitifaction_code, data)
117
+
118
+ data = Eancom::Edifact::Data.new(
119
+ type: String,
120
+ length: 0..3,
121
+ dictionary: {
122
+ '9' => {
123
+ description: 'GS1',
124
+ identifier: 'gs1',
125
+ },
126
+ '91' => {
127
+ description: 'Assigned by supplier or suppliers agent',
128
+ identifier: 'assigned_by_supplier_or_suppliers_agent'
129
+ },
130
+ '92' => {
131
+ description: 'Assigned by buyer or buyers agent',
132
+ identifier: 'assigned_by_buyer_or_buyers_agent'
133
+ }
134
+ },
135
+ description: 'Code list responsible agency code',
136
+ required: false
137
+ )
138
+ product_group.add(:code_list_responsibility_agency_code, data)
139
+
140
+ data = Eancom::Edifact::Data.new(
141
+ type: String,
142
+ length: 0..35,
143
+ dictionary: nil,
144
+ description: 'Product group name',
145
+ required: false
146
+ )
147
+ product_group.add(:product_group_name, data)
148
+
149
+
150
+ structure << product_group
151
+ #==============================================================================
152
+ Eancom.register_structure(tag: 'PGI', structure: structure)
@@ -0,0 +1,501 @@
1
+ tag = 'PIA'
2
+ Eancom.register_segment(tag: tag, klass: Eancom::Edifact::PIA)
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
+ description: 'Message Header',
13
+ required: true
14
+ )
15
+ tag.add(:tag, data)
16
+
17
+ structure << tag
18
+ #==============================================================================
19
+ # Product Identifier Code Qualifier #
20
+ #==============================================================================
21
+ product_identifier_code_qualifier = Eancom::Edifact::Composite.new
22
+
23
+ data = Eancom::Edifact::Data.new(
24
+ type: String,
25
+ length: 1..3,
26
+ dictionary: {
27
+ '1' => {
28
+ description: 'Additional information',
29
+ identifier: 'additional_information'
30
+ },
31
+ '3' => {
32
+ description: 'Substituted by',
33
+ identifier: 'substituted_by'
34
+ },
35
+ '4' => {
36
+ description: 'Substituted for',
37
+ identifier: 'substituted_for'
38
+ },
39
+ '5' => {
40
+ description: 'Product identification',
41
+ identifier: 'product_identification'
42
+ }
43
+ },
44
+ description: 'product identifier code qualifier',
45
+ required: true
46
+ )
47
+ product_identifier_code_qualifier.add(:product_identifier_code_qualifier, data)
48
+
49
+ structure << product_identifier_code_qualifier
50
+ #==============================================================================
51
+ # Item Number Identification 1 #
52
+ #==============================================================================
53
+ item_number_identification_1 = Eancom::Edifact::Composite.new
54
+
55
+ data = Eancom::Edifact::Data.new(
56
+ type: String,
57
+ length: 1..35,
58
+ description: "Despatch Advice number assigned by the document sender.\nFor global unique identification of documents Global Document Identifier (GDTI) is available.",
59
+ required: true
60
+ )
61
+ item_number_identification_1.add(:item_identifier_1, data)
62
+
63
+ data = Eancom::Edifact::Data.new(
64
+ type: String,
65
+ length: 1..3,
66
+ dictionary: {
67
+ 'AC' => {
68
+ description: 'HIBC (Health Industry Bar Code)',
69
+ identifier: 'hibc'
70
+ },
71
+ 'CG' => {
72
+ description: 'Commodity grouping',
73
+ identifier: 'commoditiy grouping'
74
+ },
75
+ 'IB' => {
76
+ description: 'ISBN (International Standard Book Number)',
77
+ identifier: 'isbn'
78
+ },
79
+ 'IN' => {
80
+ description: "Buyer's item number",
81
+ identifier: 'buyers_item_number'
82
+ },
83
+ 'HS' => {
84
+ description: 'Harmonised system',
85
+ identifier: 'harmonised_system'
86
+ },
87
+ 'GD' => {
88
+ description: 'Industry sector article group number/product classification code (GS1 Code)',
89
+ identifier: 'industry_sector_article_group_number_product_classification_code'
90
+ },
91
+ 'GU' => {
92
+ description: "Supplier's internal article group number/product classification code (GS1 Code)",
93
+ identifier: 'suppliers_internal_article_group_number_product_classification_code'
94
+ },
95
+ 'PV' => {
96
+ description: 'Promotional variant number',
97
+ identifier: 'promotional_variant_number'
98
+ },
99
+ 'SA' => {
100
+ description: "Supplier's article number",
101
+ identifier: 'suppliers_article_number'
102
+ },
103
+ 'SRV' => {
104
+ description: 'GS1 Global Trade Item Number',
105
+ identifier: 'gs1_global_trade_item_number'
106
+ },
107
+ 'SRX' => {
108
+ description: 'Slaughter number',
109
+ identifier: 'slaughter_number'
110
+ },
111
+ 'X2' => {
112
+ description: 'Ear-tag number (GS1 Temporary Code)',
113
+ identifier: 'ear_tag_number'
114
+ }
115
+ },
116
+ description: 'Item type identification code',
117
+ required: true
118
+ )
119
+ item_number_identification_1.add(:item_type_identification_code_1, data)
120
+
121
+ data = Eancom::Edifact::Data.new(
122
+ type: String,
123
+ length: 0..17,
124
+ description: 'Code list identification code',
125
+ required: false
126
+ )
127
+ item_number_identification_1.add(:code_list_identification_code_1, data)
128
+
129
+ data = Eancom::Edifact::Data.new(
130
+ type: String,
131
+ length: 0..3,
132
+ dictionary: {
133
+ '9' => {
134
+ description: 'GS1',
135
+ identifier: 'gs1'
136
+ },
137
+ '91' => {
138
+ description: "Assigned by supplier or supplier's agent",
139
+ identifier: 'assigned_by_supplier_or_suppliers_agent'
140
+ },
141
+ '92' => {
142
+ description: "Assigned by buyer or buyer's agent",
143
+ identifier: 'assigned_by_buyer_or_buyers_agent'
144
+ }
145
+ },
146
+ description: 'Code list responsible agency code',
147
+ required: false
148
+ )
149
+ item_number_identification_1.add(:code_list_responsible_agency_code_1, data)
150
+
151
+ structure << item_number_identification_1
152
+ #==============================================================================
153
+ # Item Number Identification 2 #
154
+ #==============================================================================
155
+ item_number_identification_2 = Eancom::Edifact::Composite.new
156
+
157
+ data = Eancom::Edifact::Data.new(
158
+ type: String,
159
+ length: 1..35,
160
+ description: "Despatch Advice number assigned by the document sender.\nFor global unique identification of documents Global Document Identifier (GDTI) is available.",
161
+ required: true
162
+ )
163
+ item_number_identification_2.add(:item_identifier_2, data)
164
+
165
+ data = Eancom::Edifact::Data.new(
166
+ type: String,
167
+ length: 1..3,
168
+ dictionary: {
169
+ 'AC' => {
170
+ description: 'HIBC (Health Industry Bar Code)',
171
+ identifier: 'hibc'
172
+ },
173
+ 'IB' => {
174
+ description: 'ISBN (International Standard Book Number)',
175
+ identifier: 'isbn'
176
+ },
177
+ 'IN' => {
178
+ description: "Buyer's item number",
179
+ identifier: 'buyers_item_number'
180
+ },
181
+ 'PV' => {
182
+ description: 'Promotional variant number',
183
+ identifier: 'promotional_variant_number'
184
+ },
185
+ 'SA' => {
186
+ description: "Supplier's article number",
187
+ identifier: 'suppliers_article_number'
188
+ },
189
+ 'SRV' => {
190
+ description: 'GS1 Global Trade Item Number',
191
+ identifier: 'gs1_global_trade_item_number'
192
+ },
193
+ 'SRX' => {
194
+ description: 'Slaughter number',
195
+ identifier: 'slaughter_number'
196
+ },
197
+ 'GU' => {
198
+ description: "Supplier's internal article group number/product classification code (GS1 Code)",
199
+ identifier: 'suppliers_internal_article_group_number_product_classification_code'
200
+ },
201
+ 'X2' => {
202
+ description: 'Ear-tag number (GS1 Temporary Code)',
203
+ identifier: 'ear_tag_number'
204
+ }
205
+ },
206
+ description: 'Item type identification code',
207
+ required: true
208
+ )
209
+ item_number_identification_2.add(:item_type_identification_code_2, data)
210
+
211
+ data = Eancom::Edifact::Data.new(
212
+ type: String,
213
+ length: 0..17,
214
+ description: 'Code list identification code',
215
+ required: false
216
+ )
217
+ item_number_identification_2.add(:code_list_identification_code_2, data)
218
+
219
+ data = Eancom::Edifact::Data.new(
220
+ type: String,
221
+ length: 0..3,
222
+ dictionary: {
223
+ '9' => {
224
+ description: 'GS1',
225
+ identification: 'gs1'
226
+ },
227
+ '91' => {
228
+ description: "Assigned by supplier or supplier's agent",
229
+ identification: 'assigned_by_supplier_or_suppliers_agent'
230
+ },
231
+ '92' => {
232
+ description: "Assigned by buyer or buyer's agent",
233
+ identification: 'assigned_by_buyer_or_buyers_agent'
234
+ }
235
+ },
236
+ description: 'Code list responsible agency code',
237
+ required: false
238
+ )
239
+ item_number_identification_2.add(:code_list_responsible_agency_code_2, data)
240
+
241
+ structure << item_number_identification_2
242
+ #==============================================================================
243
+ # Item Number Identification 3 #
244
+ #==============================================================================
245
+ item_number_identification_3 = Eancom::Edifact::Composite.new
246
+
247
+ data = Eancom::Edifact::Data.new(
248
+ type: String,
249
+ length: 1..35,
250
+ description: "Despatch Advice number assigned by the document sender.\nFor global unique identification of documents Global Document Identifier (GDTI) is available.",
251
+ required: true
252
+ )
253
+ item_number_identification_3.add(:item_identifier_3, data)
254
+
255
+ data = Eancom::Edifact::Data.new(
256
+ type: String,
257
+ length: 1..3,
258
+ dictionary: {
259
+ 'AC' => {
260
+ description: 'HIBC (Health Industry Bar Code)',
261
+ identifier: 'hibc'
262
+ },
263
+ 'IB' => {
264
+ description: 'ISBN (International Standard Book Number)',
265
+ identifier: 'isbn'
266
+ },
267
+ 'IN' => {
268
+ description: "Buyer's item number",
269
+ identifier: 'buyers_item_number'
270
+ },
271
+ 'PV' => {
272
+ description: 'Promotional variant number',
273
+ identifier: 'promotional_variant_number'
274
+ },
275
+ 'SA' => {
276
+ description: "Supplier's article number",
277
+ identifier: 'suppliers_article_number'
278
+ },
279
+ 'SRV' => {
280
+ description: 'GS1 Global Trade Item Number',
281
+ identifier: 'gs1_global_trade_item_number'
282
+ },
283
+ 'SRX' => {
284
+ description: 'Slaughter number',
285
+ identifier: 'slaughter_number'
286
+ },
287
+ 'X2' => {
288
+ description: 'Ear-tag number (GS1 Temporary Code)',
289
+ identifier: 'ear_tag_number'
290
+ }
291
+ },
292
+ description: 'Item type identification code',
293
+ required: true
294
+ )
295
+ item_number_identification_3.add(:item_type_identification_code_3, data)
296
+
297
+ data = Eancom::Edifact::Data.new(
298
+ type: String,
299
+ length: 0..17,
300
+ description: 'Code list identification code',
301
+ required: false
302
+ )
303
+ item_number_identification_3.add(:code_list_identification_code_3, data)
304
+
305
+ data = Eancom::Edifact::Data.new(
306
+ type: String,
307
+ length: 0..3,
308
+ dictionary: {
309
+ '9' => {
310
+ description: 'GS1',
311
+ identification: 'gs1'
312
+ },
313
+ '91' => {
314
+ description: "Assigned by supplier or supplier's agent",
315
+ identification: 'assigned_by_supplier_or_suppliers_agent'
316
+ },
317
+ '92' => {
318
+ description: "Assigned by buyer or buyer's agent",
319
+ identification: 'assigned_by_buyer_or_buyers_agent'
320
+ }
321
+ },
322
+ description: 'Code list responsible agency code',
323
+ required: false
324
+ )
325
+ item_number_identification_3.add(:code_list_responsible_agency_code_3, data)
326
+
327
+ structure << item_number_identification_3
328
+ #==============================================================================
329
+ # Item Number Identification 4 #
330
+ #==============================================================================
331
+ item_number_identification_4 = Eancom::Edifact::Composite.new
332
+
333
+ data = Eancom::Edifact::Data.new(
334
+ type: String,
335
+ length: 1..35,
336
+ description: "Despatch Advice number assigned by the document sender.\nFor global unique identification of documents Global Document Identifier (GDTI) is available.",
337
+ required: true
338
+ )
339
+ item_number_identification_4.add(:item_identifier_4, data)
340
+
341
+ data = Eancom::Edifact::Data.new(
342
+ type: String,
343
+ length: 1..3,
344
+ dictionary: {
345
+ 'AC' => {
346
+ description: 'HIBC (Health Industry Bar Code)',
347
+ identifier: 'hibc'
348
+ },
349
+ 'IB' => {
350
+ description: 'ISBN (International Standard Book Number)',
351
+ identifier: 'isbn'
352
+ },
353
+ 'IN' => {
354
+ description: "Buyer's item number",
355
+ identifier: 'buyers_item_number'
356
+ },
357
+ 'PV' => {
358
+ description: 'Promotional variant number',
359
+ identifier: 'promotional_variant_number'
360
+ },
361
+ 'SA' => {
362
+ description: "Supplier's article number",
363
+ identifier: 'suppliers_article_number'
364
+ },
365
+ 'SRV' => {
366
+ description: 'GS1 Global Trade Item Number',
367
+ identifier: 'gs1_global_trade_item_number'
368
+ },
369
+ 'SRX' => {
370
+ description: 'Slaughter number',
371
+ identifier: 'slaughter_number'
372
+ },
373
+ 'X2' => {
374
+ description: 'Ear-tag number (GS1 Temporary Code)',
375
+ identifier: 'ear_tag_number'
376
+ }
377
+ },
378
+ description: 'Item type identification code',
379
+ required: true
380
+ )
381
+ item_number_identification_4.add(:item_type_identification_code_4, data)
382
+
383
+ data = Eancom::Edifact::Data.new(
384
+ type: String,
385
+ length: 0..17,
386
+ description: 'Code list identification code',
387
+ required: false
388
+ )
389
+ item_number_identification_4.add(:code_list_identification_code_4, data)
390
+
391
+ data = Eancom::Edifact::Data.new(
392
+ type: String,
393
+ length: 0..3,
394
+ dictionary: {
395
+ '9' => {
396
+ description: 'GS1',
397
+ identifier: 'gs1'
398
+ },
399
+ '91' => {
400
+ description: "Assigned by supplier or supplier's agent",
401
+ identifier: 'assigned_by_supplier_or_suppliers_agent'
402
+ },
403
+ '92' => {
404
+ description: "Assigned by buyer or buyer's agent",
405
+ identifier: 'assigned_by_buyer_or_buyers_agent'
406
+ }
407
+ },
408
+ description: 'Code list responsible agency code',
409
+ required: false
410
+ )
411
+ item_number_identification_4.add(:code_list_responsible_agency_code_4, data)
412
+
413
+ structure << item_number_identification_4
414
+ #==============================================================================
415
+ # Item Number Identification 5 #
416
+ #==============================================================================
417
+ item_number_identification_5 = Eancom::Edifact::Composite.new
418
+
419
+ data = Eancom::Edifact::Data.new(
420
+ type: String,
421
+ length: 1..35,
422
+ description: "Despatch Advice number assigned by the document sender.\nFor global unique identification of documents Global Document Identifier (GDTI) is available.",
423
+ required: true
424
+ )
425
+ item_number_identification_5.add(:item_identifier_5, data)
426
+
427
+ data = Eancom::Edifact::Data.new(
428
+ type: String,
429
+ length: 1..3,
430
+ dictionary: {
431
+ 'AC' => {
432
+ description: 'HIBC (Health Industry Bar Code)',
433
+ identifier: 'hibc'
434
+ },
435
+ 'IB' => {
436
+ description: 'ISBN (International Standard Book Number)',
437
+ identifier: 'isbn'
438
+ },
439
+ 'IN' => {
440
+ description: "Buyer's item number",
441
+ identifier: 'buyers_item_number'
442
+ },
443
+ 'PV' => {
444
+ description: 'Promotional variant number',
445
+ identifier: 'promotional_variant_number'
446
+ },
447
+ 'SA' => {
448
+ description: "Supplier's article number",
449
+ identifier: 'suppliers_article_number'
450
+ },
451
+ 'SRV' => {
452
+ description: 'GS1 Global Trade Item Number',
453
+ identifier: 'gs1_global_trade_item_number'
454
+ },
455
+ 'SRX' => {
456
+ description: 'Slaughter number',
457
+ identifier: 'slaughter_number'
458
+ },
459
+ 'X2' => {
460
+ description: 'Ear-tag number (GS1 Temporary Code)',
461
+ identifier: 'ear_tag_number'
462
+ }
463
+ },
464
+ description: 'Item type identification code',
465
+ required: true
466
+ )
467
+ item_number_identification_5.add(:item_type_identification_code_5, data)
468
+
469
+ data = Eancom::Edifact::Data.new(
470
+ type: String,
471
+ length: 0..17,
472
+ description: 'Code list identification code',
473
+ required: false
474
+ )
475
+ item_number_identification_5.add(:code_list_identification_code_5, data)
476
+
477
+ data = Eancom::Edifact::Data.new(
478
+ type: String,
479
+ length: 0..3,
480
+ dictionary: {
481
+ '9' => {
482
+ description: 'GS1',
483
+ identification: 'gs1'
484
+ },
485
+ '91' => {
486
+ description: "Assigned by supplier or supplier's agent",
487
+ identification: 'assigned_by_supplier_or_suppliers_agent'
488
+ },
489
+ '92' => {
490
+ description: "Assigned by buyer or buyer's agent",
491
+ identification: 'assigned_by_buyer_or_buyers_agent'
492
+ }
493
+ },
494
+ description: 'Code list responsible agency code',
495
+ required: false
496
+ )
497
+ item_number_identification_5.add(:code_list_responsible_agency_code_5, data)
498
+
499
+ structure << item_number_identification_5
500
+ #==============================================================================
501
+ Eancom.register_structure(tag: 'PIA', structure: structure)