eancom 0.1.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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,89 @@
1
+ tag = 'CTA'
2
+ Eancom.register_segment(tag: tag, klass: Eancom::Edifact::CTA)
3
+
4
+ structure = Eancom::Edifact::Structure.new(tag: tag)
5
+
6
+ #==============================================================================
7
+ # Tag #
8
+ #==============================================================================
9
+ tag = Eancom::Edifact::Composite.new
10
+ data = Eancom::Edifact::Data.new(
11
+ type: String,
12
+ length: 1..3,
13
+ dictionary: nil,
14
+ description: 'Message Header',
15
+ required: true
16
+ )
17
+ tag.add(:tag, data)
18
+ structure << tag
19
+ #==============================================================================
20
+ # Contact function code #
21
+ #==============================================================================
22
+ contact_function_code = Eancom::Edifact::Composite.new
23
+
24
+ data = Eancom::Edifact::Data.new(
25
+ type: String,
26
+ length: 1..3,
27
+ dictionary: {
28
+ 'AD' => {
29
+ description: 'Accounting contact',
30
+ identifier: 'accounting_contact'
31
+ },
32
+ 'AP' => {
33
+ description: 'Accounts payable contact',
34
+ identifier: 'accounts_payable_contact'
35
+ },
36
+ 'AR' => {
37
+ description: 'Accounts receivable contact',
38
+ identifier: 'accounts_receivable_contact'
39
+ },
40
+ 'GR' => {
41
+ description: 'Goods receiving contact',
42
+ identifier: 'goods_receiving_contact'
43
+ },
44
+ 'IC' => {
45
+ description: 'Information contact',
46
+ identifier: 'information_contact'
47
+ },
48
+ 'BJ' => {
49
+ description: 'Department or person responsible for processing purchase order',
50
+ identifier: 'dep_or_per_resp_for_proc_purchase_order'
51
+ },
52
+ 'BO' => {
53
+ description: 'After business hour contact',
54
+ identifier: 'after_business_hour_contact'
55
+ },
56
+ 'OC' => {
57
+ description: 'Order contact',
58
+ identifier: 'order_contact'
59
+ },
60
+ 'PD' => {
61
+ description: 'Purchasing contact',
62
+ identifier: 'purchasing_contact'
63
+ },
64
+ 'PM' => {
65
+ description: 'Product management contact',
66
+ identifier: 'product_management_contact'
67
+ },
68
+ 'SR' => {
69
+ description: 'Sales representative or department',
70
+ identifier: 'sales_representative_or_department'
71
+ },
72
+ 'QC' => {
73
+ description: 'Quality coordinator contact',
74
+ identifier: 'quality_coordinator_contact'
75
+ }
76
+ },
77
+ description: 'Contact function code',
78
+ required: true
79
+ )
80
+ contact_function_code.add(:contact_function_code, data)
81
+
82
+ structure << contact_function_code
83
+ #==============================================================================
84
+ # DEPARTMENT OR EMPLOYEE DETAILS
85
+ #==============================================================================
86
+
87
+ # TODO
88
+
89
+ Eancom.register_structure(tag: 'CTA', structure: structure)
@@ -0,0 +1,174 @@
1
+ tag = 'CUX'
2
+ Eancom.register_segment(tag: tag, klass: Eancom::Edifact::CUX)
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
+ # Currency Details 1
21
+ #==============================================================================
22
+ currency_type_dictionary = {
23
+ '2' => {
24
+ description: 'Reference Currency',
25
+ identifier: 'reference_currency'
26
+ },
27
+ '3' => {
28
+ description: 'Target Currency',
29
+ identifier: 'target_currency'
30
+ },
31
+ '4' => {
32
+ description: 'Invoicing Currency',
33
+ identifier: 'invoicing_currency'
34
+ },
35
+ '8' => {
36
+ description: 'Price list currency',
37
+ identifier: 'price_list_currency'
38
+ },
39
+ '9' => {
40
+ description: 'Order currency',
41
+ identifier: 'order_currency'
42
+ },
43
+ '10' => {
44
+ description: 'Pricing_currency',
45
+ identifier: 'pricing_currency'
46
+ },
47
+ '11' => {
48
+ description: 'Payment currency',
49
+ identifier: 'payment_currency'
50
+ },
51
+ '12' => {
52
+ description: 'Quotation currency',
53
+ identifier: 'quotation_currency'
54
+ }
55
+ }
56
+
57
+ currency_details = Eancom::Edifact::Composite.new()
58
+
59
+ data = Eancom::Edifact::Data.new(
60
+ type: String,
61
+ length: 1..3,
62
+ dictionary: currency_type_dictionary,
63
+ description: 'Currency usage code qualifier',
64
+ required: true
65
+ )
66
+ currency_details.add(:currency_usage_code_qualifier_1, data)
67
+
68
+ data = Eancom::Edifact::Data.new(
69
+ type: String,
70
+ length: 1..3,
71
+ dictionary: nil,
72
+ description: 'Currency identification code',
73
+ required: true
74
+ )
75
+ currency_details.add(:currency_identification_code_1, data)
76
+
77
+
78
+ data = Eancom::Edifact::Data.new(
79
+ type: String,
80
+ length: 1..3,
81
+ dictionary: currency_type_dictionary,
82
+ description: 'Currency type code qualifier',
83
+ required: true
84
+ )
85
+ currency_details.add(:currency_type_code_qualifier_1, data)
86
+
87
+ data = Eancom::Edifact::Data.new(
88
+ type: String,
89
+ length: 0..4,
90
+ dictionary: nil,
91
+ description: 'Currency rate value',
92
+ required: false
93
+ )
94
+
95
+ currency_details.add(:currency_rate_value_1, data)
96
+
97
+ structure << currency_details
98
+ #==============================================================================
99
+ # Currency Details 2
100
+ #==============================================================================
101
+ currency_details_2 = Eancom::Edifact::Composite.new()
102
+
103
+ data = Eancom::Edifact::Data.new(
104
+ type: String,
105
+ length: 1..3,
106
+ dictionary: currency_type_dictionary,
107
+ description: 'Currency usage code qualifier',
108
+ required: true
109
+ )
110
+
111
+ currency_details_2.add(:currency_usage_code_qualifier_2, data)
112
+
113
+ data = Eancom::Edifact::Data.new(
114
+ type: String,
115
+ length: 1..3,
116
+ dictionary: nil,
117
+ description: 'Currency identification code',
118
+ required: false
119
+ )
120
+ currency_details_2.add(:currency_identification_code_2, data)
121
+
122
+ data = Eancom::Edifact::Data.new(
123
+ type: String,
124
+ length: 1..3,
125
+ dictionary: currency_type_dictionary,
126
+ description: 'Currency type code qualifier',
127
+ required: false
128
+ )
129
+ currency_details_2.add(:currency_type_code_qualifier_2, data)
130
+
131
+ data = Eancom::Edifact::Data.new(
132
+ type: String,
133
+ length: 0..4,
134
+ dictionary: nil,
135
+ description: 'Currency rate value',
136
+ required: false
137
+ )
138
+
139
+ currency_details_2.add(:currency_rate_value_2, data)
140
+
141
+ structure << currency_details_2
142
+ #==============================================================================
143
+ # Currency Exchange Rate
144
+ #==============================================================================
145
+ currency_exchange_rate = Eancom::Edifact::Composite.new()
146
+
147
+ data = Eancom::Edifact::Data.new(
148
+ type: String,
149
+ length: 0..12,
150
+ dictionary: nil,
151
+ description: 'Currency exchange rate',
152
+ required: false
153
+ )
154
+ currency_exchange_rate.add(:currency_exchange_rate, data)
155
+
156
+ structure << currency_exchange_rate
157
+ #==============================================================================
158
+ # Exchange rate currency market identifier
159
+ #==============================================================================
160
+ exchange_rate_currency_market_identifier = Eancom::Edifact::Composite.new()
161
+
162
+ data = Eancom::Edifact::Data.new(
163
+ type: String,
164
+ length: 0..3,
165
+ dictionary: nil,
166
+ description: 'Exchange rate currency market identifier',
167
+ required: false
168
+ )
169
+ exchange_rate_currency_market_identifier.add(:exchange_rate_currency_market_identifier, data)
170
+
171
+ structure << exchange_rate_currency_market_identifier
172
+ #==============================================================================
173
+ Eancom.register_structure(tag: 'CUX', structure: structure)
174
+
@@ -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)
@@ -0,0 +1,243 @@
1
+ tag = 'DTM'
2
+ Eancom.register_segment(tag: tag, klass: Eancom::Edifact::DTM)
3
+
4
+ structure = Eancom::Edifact::Structure.new(tag: tag)
5
+
6
+ composite = Eancom::Edifact::Composite.new()
7
+ data = Eancom::Edifact::Data.new(
8
+ type: String,
9
+ length: 3,
10
+ description: "DATE/TIME/PERIOD",
11
+ required: true
12
+ )
13
+ composite.add(:tag, data)
14
+ structure << composite
15
+
16
+ composite = Eancom::Edifact::Composite.new()
17
+
18
+ type_dictionary = {
19
+ '1' => {
20
+ description: 'Service completion date/time, actual',
21
+ identifier: 'service_completion_date_time_actual'
22
+ },
23
+ '2' => {
24
+ description: 'Delivery date/time, requested',
25
+ identifier: 'delivery_date_time'
26
+ },
27
+ '3' => {
28
+ description: 'Invoice date/time, requested',
29
+ identifier: 'invoice_date_time'
30
+ },
31
+ '7' => {
32
+ description: 'Effectiv date/time',
33
+ identifier: 'effectiv_date_time'
34
+ },
35
+ '11' => {
36
+ description: 'Despatch date and/or time',
37
+ identifier: 'despatch_date_and_or_time'
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
+ },
47
+ '17' => {
48
+ description: 'Delivery date/time, estimated',
49
+ identifier: 'delivery_date_time_estimated'
50
+ },
51
+ '35' => {
52
+ description: 'Delivery date and/or time',
53
+ identifier: 'delivery_date_and_or_time'
54
+ },
55
+ '36' => {
56
+ description: 'Expiry Date',
57
+ identifier: 'expiry_date'
58
+ },
59
+ '44' => {
60
+ description: 'Availability',
61
+ identifier: 'availability'
62
+ },
63
+ '50' => {
64
+ description: 'Goods receipt date/time',
65
+ identifier: 'goods_receipt_date_time'
66
+ },
67
+ '63' => {
68
+ description: 'Delivery date/time, latest',
69
+ identifier: 'delivery_date_time_latest'
70
+ },
71
+ '90' => {
72
+ description: 'Report start date',
73
+ identifier: 'report_start_date'
74
+ },
75
+ '91' => {
76
+ description: 'Report end date',
77
+ identifier: 'report_end_date'
78
+ },
79
+ '64' => {
80
+ description: 'Delivery date/time, earliest',
81
+ identifier: 'delivery_date_time_earliest'
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
+ },
103
+ '137' => {
104
+ description: 'Document/message date/time',
105
+ identifier: 'document_message_date_time'
106
+ },
107
+ '140' => {
108
+ description: 'Payment due date',
109
+ identifier: 'payment_due_date'
110
+ },
111
+ '157' => {
112
+ description: 'Validity start date',
113
+ identifier: 'valitity_start_date'
114
+ },
115
+ '171' => {
116
+ description: 'Reference date/time',
117
+ identifier: 'reference_date_time'
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
+ },
127
+ '200' => {
128
+ description: 'Pick-up/collection date/time of cargo',
129
+ identifier: 'pick_up_collection_date_time_of_cargo'
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
+ },
143
+ '263' => {
144
+ description: 'Invoicing period',
145
+ identifier: 'invoicing_period'
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
+ },
155
+ '325' => {
156
+ description: 'Tax period',
157
+ identifier: 'tax_period'
158
+ },
159
+ '326' => {
160
+ description: 'Charge period',
161
+ identifier: 'charge_period'
162
+ },
163
+ '356' => {
164
+ description: 'Sales date, and or time, and or period',
165
+ identifier: 'sales_date_and_or_time_and_or_period'
166
+ },
167
+ '366' => {
168
+ description: 'Inventory report date',
169
+ identifier: 'inventory_report_date'
170
+ },
171
+ '454' => {
172
+ description: 'Accounting value date',
173
+ identifier: 'accounting_value_date'
174
+ },
175
+ '44E' => {
176
+ description: 'Connection date/time',
177
+ identifier: 'connection_date_time'
178
+ },
179
+ }
180
+
181
+ data = Eancom::Edifact::Data.new(
182
+ type: String,
183
+ length: 1..3,
184
+ dictionary: type_dictionary,
185
+ description: 'Date or time or period function code qualifier',
186
+ required: true
187
+ )
188
+ composite.add(:type, data)
189
+
190
+ data = Eancom::Edifact::Data.new(
191
+ type: String,
192
+ length: 1..35,
193
+ description: 'Date or time or period value',
194
+ required: true
195
+ )
196
+ composite.add(:date_time, data)
197
+
198
+ format_dictionary = {
199
+ '102' => {
200
+ description: 'Date',
201
+ value: 'CCYYMMDD',
202
+ identifier: 'date'
203
+ },
204
+ '203' => {
205
+ description: 'Date and Time',
206
+ value: 'CCYYMMDDHHMM',
207
+ identifier: 'date_time'
208
+ },
209
+ '204' => {
210
+ description: 'Date and Time',
211
+ value: 'CCYYMMDDHHMMSS',
212
+ identifier: 'date_time_second'
213
+ },
214
+ '718' => {
215
+ description: 'Period',
216
+ value: 'CCYYMMDD-CCZZMMDD',
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'
230
+ }
231
+ }
232
+
233
+ data = Eancom::Edifact::Data.new(
234
+ type: String,
235
+ length: 1..35,
236
+ dictionary: format_dictionary,
237
+ description: 'Date or time or period value',
238
+ required: true
239
+ )
240
+ composite.add(:format, data)
241
+ structure << composite
242
+
243
+ Eancom.register_structure(tag: 'DTM', structure: structure)