eancom 0.1.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +190 -5
- data/.gitlab-ci.yml +25 -0
- data/.ruby-version +1 -0
- data/Gemfile.lock +22 -18
- data/README.md +46 -0
- data/bin/console +3 -2
- data/definitions/desadv/d01b.rb +251 -0
- data/definitions/desadv/d96a.rb +208 -87
- data/definitions/invoic/d01b.rb +559 -0
- data/definitions/invoic/d96a.rb +389 -0
- data/definitions/invrpt/d01b.rb +134 -0
- data/definitions/invrpt/d96a.rb +125 -0
- data/definitions/orders/d01b.rb +182 -0
- data/definitions/orders/d96b.rb +198 -0
- data/definitions/ordrsp/d01b.rb +251 -0
- data/definitions/ordrsp/d96b.rb +226 -0
- data/definitions/pricat/d01b.rb +225 -0
- data/definitions/pricat/d96b.rb +207 -0
- data/definitions/retann/d01b.rb +172 -0
- data/definitions/retann/d96b.rb +221 -0
- data/definitions/segments/ajt.rb +47 -0
- data/definitions/segments/alc.rb +328 -0
- data/definitions/segments/ali.rb +93 -0
- data/definitions/segments/bgm.rb +395 -0
- data/definitions/segments/cav.rb +122 -0
- data/definitions/segments/cci.rb +136 -0
- data/definitions/segments/cdi.rb +39 -0
- data/definitions/segments/cnt.rb +82 -0
- data/definitions/segments/cps.rb +76 -0
- data/definitions/segments/cta.rb +89 -0
- data/definitions/segments/cux.rb +174 -0
- data/definitions/segments/dgs.rb +34 -0
- data/definitions/segments/doc.rb +45 -0
- data/definitions/segments/dtm.rb +243 -0
- data/definitions/segments/efi.rb +67 -0
- data/definitions/segments/eqd.rb +37 -0
- data/definitions/segments/ftx.rb +165 -0
- data/definitions/segments/gin.rb +113 -0
- data/definitions/segments/imd.rb +360 -0
- data/definitions/segments/inv.rb +94 -0
- data/definitions/segments/lin.rb +133 -0
- data/definitions/segments/loc.rb +137 -0
- data/definitions/segments/mea.rb +189 -0
- data/definitions/segments/moa.rb +228 -0
- data/definitions/segments/nad.rb +314 -0
- data/definitions/segments/pac.rb +262 -0
- data/definitions/segments/pat.rb +171 -0
- data/definitions/segments/pcd.rb +72 -0
- data/definitions/segments/pci.rb +110 -0
- data/definitions/segments/pgi.rb +152 -0
- data/definitions/segments/pia.rb +501 -0
- data/definitions/segments/pri.rb +208 -0
- data/definitions/segments/qty.rb +293 -0
- data/definitions/segments/rff.rb +210 -0
- data/definitions/segments/rte.rb +52 -0
- data/definitions/segments/tax.rb +266 -0
- data/definitions/segments/tdt.rb +278 -0
- data/definitions/segments/tod.rb +64 -0
- data/definitions/segments/tru.rb +34 -0
- data/definitions/segments/una.rb +85 -0
- data/definitions/segments/unb.rb +284 -0
- data/definitions/segments/unh.rb +183 -0
- data/definitions/segments/uns.rb +40 -0
- data/definitions/segments/unt.rb +48 -0
- data/definitions/segments/unz.rb +48 -0
- data/definitions/slsrpt/d01b.rb +206 -0
- data/definitions/slsrpt/d96a.rb +199 -0
- data/eancom.gemspec +2 -1
- data/lib/eancom.rb +61 -16
- data/lib/eancom/definition.rb +1 -1
- data/lib/eancom/edifact.rb +60 -13
- data/lib/eancom/edifact/body.rb +63 -0
- data/lib/eancom/edifact/composite.rb +38 -0
- data/lib/eancom/edifact/data.rb +108 -0
- data/lib/eancom/edifact/document.rb +43 -11
- data/lib/eancom/edifact/document_element.rb +26 -0
- data/lib/eancom/edifact/footer.rb +7 -0
- data/lib/eancom/edifact/header.rb +15 -0
- data/lib/eancom/edifact/item.rb +40 -0
- data/lib/eancom/edifact/message.rb +24 -16
- data/lib/eancom/edifact/segment.rb +131 -12
- data/lib/eancom/edifact/segments/ajt.rb +32 -0
- data/lib/eancom/edifact/segments/alc.rb +61 -0
- data/lib/eancom/edifact/segments/ali.rb +50 -0
- data/lib/eancom/edifact/segments/bgm.rb +46 -0
- data/lib/eancom/edifact/segments/cav.rb +47 -0
- data/lib/eancom/edifact/segments/cci.rb +53 -0
- data/lib/eancom/edifact/segments/cdi.rb +30 -0
- data/lib/eancom/edifact/segments/cnt.rb +40 -0
- data/lib/eancom/edifact/segments/cps.rb +33 -0
- data/lib/eancom/edifact/segments/cta.rb +30 -0
- data/lib/eancom/edifact/segments/cux.rb +60 -0
- data/lib/eancom/edifact/segments/dgs.rb +31 -0
- data/lib/eancom/edifact/segments/doc.rb +30 -0
- data/lib/eancom/edifact/segments/dtm.rb +47 -0
- data/lib/eancom/edifact/segments/efi.rb +38 -0
- data/lib/eancom/edifact/segments/eqd.rb +30 -0
- data/lib/eancom/edifact/segments/ftx.rb +63 -0
- data/lib/eancom/edifact/segments/gin.rb +45 -0
- data/lib/eancom/edifact/segments/imd.rb +69 -0
- data/lib/eancom/edifact/segments/inv.rb +43 -0
- data/lib/eancom/edifact/segments/lin.rb +47 -0
- data/lib/eancom/edifact/segments/loc.rb +46 -0
- data/lib/eancom/edifact/segments/mea.rb +54 -0
- data/lib/eancom/edifact/segments/moa.rb +45 -0
- data/lib/eancom/edifact/segments/nad.rb +112 -0
- data/lib/eancom/edifact/segments/pac.rb +56 -0
- data/lib/eancom/edifact/segments/pat.rb +37 -0
- data/lib/eancom/edifact/segments/pcd.rb +33 -0
- data/lib/eancom/edifact/segments/pci.rb +40 -0
- data/lib/eancom/edifact/segments/pgi.rb +45 -0
- data/lib/eancom/edifact/segments/pia.rb +108 -0
- data/lib/eancom/edifact/segments/pri.rb +53 -0
- data/lib/eancom/edifact/segments/qty.rb +44 -0
- data/lib/eancom/edifact/segments/rff.rb +47 -0
- data/lib/eancom/edifact/segments/rte.rb +33 -0
- data/lib/eancom/edifact/segments/tax.rb +78 -0
- data/lib/eancom/edifact/segments/tdt.rb +57 -0
- data/lib/eancom/edifact/segments/tod.rb +33 -0
- data/lib/eancom/edifact/segments/tru.rb +31 -0
- data/lib/eancom/edifact/segments/una.rb +52 -0
- data/lib/eancom/edifact/segments/unb.rb +68 -0
- data/lib/eancom/edifact/segments/unh.rb +50 -0
- data/lib/eancom/edifact/segments/uns.rb +32 -0
- data/lib/eancom/edifact/segments/unt.rb +28 -0
- data/lib/eancom/edifact/segments/unz.rb +28 -0
- data/lib/eancom/edifact/structure.rb +90 -0
- data/lib/eancom/factory.rb +9 -8
- data/lib/eancom/parser.rb +7 -0
- data/lib/eancom/parser/document.rb +60 -0
- data/lib/eancom/parser/segment.rb +71 -0
- data/lib/eancom/version.rb +1 -1
- data/pricat.json +1 -0
- metadata +141 -9
- data/lib/eancom/edifact/element.rb +0 -16
- data/lib/eancom/edifact/envelope.rb +0 -24
@@ -0,0 +1,228 @@
|
|
1
|
+
tag = 'MOA'
|
2
|
+
Eancom.register_segment(tag: tag, klass: Eancom::Edifact::MOA)
|
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
|
+
# Monetary Amount
|
21
|
+
#==============================================================================
|
22
|
+
monetary_amount = Eancom::Edifact::Composite.new()
|
23
|
+
|
24
|
+
data = Eancom::Edifact::Data.new(
|
25
|
+
type: String,
|
26
|
+
length: 0..3,
|
27
|
+
dictionary: {
|
28
|
+
'8' => {
|
29
|
+
description: 'Allowance or charge amount',
|
30
|
+
identifier: 'allowance_or_charge_amount'
|
31
|
+
},
|
32
|
+
'9' => {
|
33
|
+
description: 'Amount due/amount payable',
|
34
|
+
identifier: 'amount_due_amount_payable'
|
35
|
+
},
|
36
|
+
'21' => {
|
37
|
+
description: 'Cash discount',
|
38
|
+
identifier: 'cash_discount'
|
39
|
+
},
|
40
|
+
'23' => {
|
41
|
+
description: 'Charge amount',
|
42
|
+
identifier: 'charge_amount'
|
43
|
+
},
|
44
|
+
'25' => {
|
45
|
+
description: 'Charge/allowance bias',
|
46
|
+
identifier: 'charge_allowance_bias'
|
47
|
+
},
|
48
|
+
'52' => {
|
49
|
+
description: 'Discount amount',
|
50
|
+
identifier: 'discount_amount'
|
51
|
+
},
|
52
|
+
'53' => {
|
53
|
+
description: 'Discount amount due',
|
54
|
+
identifier: 'discount_amount_due'
|
55
|
+
},
|
56
|
+
'77' => {
|
57
|
+
description: 'Invoice amount',
|
58
|
+
identifier: 'invoice_amount'
|
59
|
+
},
|
60
|
+
'79' => {
|
61
|
+
description: 'Total line items amount',
|
62
|
+
identifier: 'total_line_items_amount'
|
63
|
+
},
|
64
|
+
'86' => {
|
65
|
+
description: 'Message total monetary amount',
|
66
|
+
identifier: 'message_total_monetary_amount'
|
67
|
+
},
|
68
|
+
'113' => {
|
69
|
+
description: 'Prepaid amount',
|
70
|
+
identifier: 'prepaid_amount'
|
71
|
+
},
|
72
|
+
'124' => {
|
73
|
+
description: 'Tax amount',
|
74
|
+
identifier: 'tax_amount'
|
75
|
+
},
|
76
|
+
'125' => {
|
77
|
+
description: 'Taxable amount',
|
78
|
+
identifier: 'taxable_amount'
|
79
|
+
},
|
80
|
+
'129' => {
|
81
|
+
description: 'Total amount subject to payment discount',
|
82
|
+
identifier: 'total_amount_subject_to_payment_discount'
|
83
|
+
},
|
84
|
+
'131' => {
|
85
|
+
description: 'Total charge/allowances',
|
86
|
+
identifier: 'total_charge_allowances'
|
87
|
+
},
|
88
|
+
'165' => {
|
89
|
+
description: 'Adjustment amount',
|
90
|
+
identifier: 'adjustment_amount'
|
91
|
+
},
|
92
|
+
'176' => {
|
93
|
+
description: 'Message total duty/tax/fee amount',
|
94
|
+
identifier: 'message_total_duty_tax_fee_amount'
|
95
|
+
},
|
96
|
+
'201' => {
|
97
|
+
description: 'Penalty amount',
|
98
|
+
identifier: 'penalty_amount'
|
99
|
+
},
|
100
|
+
'203' => {
|
101
|
+
description: 'Line item amount',
|
102
|
+
identifier: 'line_item_amount'
|
103
|
+
},
|
104
|
+
'204' => {
|
105
|
+
description: 'Allowance amount',
|
106
|
+
identifier: 'allowance_amount'
|
107
|
+
},
|
108
|
+
'210' => {
|
109
|
+
description: 'Credit note amount',
|
110
|
+
identifier: 'credit_note_amount'
|
111
|
+
},
|
112
|
+
'227' => {
|
113
|
+
description: 'Deposit',
|
114
|
+
identifier: 'deposit'
|
115
|
+
},
|
116
|
+
'236' => {
|
117
|
+
description: 'Amount subject to price adjustment',
|
118
|
+
identifier: 'amount_subject_to_price_adjustment'
|
119
|
+
},
|
120
|
+
'286' => {
|
121
|
+
description: 'Administration charge',
|
122
|
+
identifier: 'administration_charge'
|
123
|
+
},
|
124
|
+
'369' => {
|
125
|
+
description: 'Goods and services tax',
|
126
|
+
identifier: 'goods_and_services_tax'
|
127
|
+
},
|
128
|
+
'388' => {
|
129
|
+
description: 'Total amount including Value Added Tax (VAT)',
|
130
|
+
identifier: 'total_amount_including_value_added_tax_vat'
|
131
|
+
},
|
132
|
+
'396' => {
|
133
|
+
description: 'Total price subsidy value',
|
134
|
+
identifier: 'total_price_subsidy_value'
|
135
|
+
},
|
136
|
+
'400' => {
|
137
|
+
description: 'Rebate amount',
|
138
|
+
identifier: 'rebate_amount'
|
139
|
+
},
|
140
|
+
'402' => {
|
141
|
+
description: 'Total retail value',
|
142
|
+
identifier: 'total_retail_value'
|
143
|
+
},
|
144
|
+
'496' => {
|
145
|
+
description: 'Total returnable packages deposit amount',
|
146
|
+
identifier: 'total_returnable_packages_deposit_amount'
|
147
|
+
},
|
148
|
+
'507' => {
|
149
|
+
description: 'Net-progress payment amount',
|
150
|
+
identifier: 'net_progress_payment_amount'
|
151
|
+
},
|
152
|
+
'528' => {
|
153
|
+
description: 'Calculation basis excluding all taxes',
|
154
|
+
identifier: 'calculation_basis_excluding_all_taxes'
|
155
|
+
},
|
156
|
+
'529' => {
|
157
|
+
description: 'Calculation basis which includes all taxes except VAT',
|
158
|
+
identifier: 'calculation_basis_which_includes_all_taxes_except_vat'
|
159
|
+
},
|
160
|
+
'X41' => {
|
161
|
+
description: 'Total returnable items rental fee amount',
|
162
|
+
identifier: 'total_returnable_items_rental_fee_amount'
|
163
|
+
},
|
164
|
+
'X42' => {
|
165
|
+
description: 'Rental fee (GS1 Temporary Code)',
|
166
|
+
identifier: 'rental_fee_gs1_temporary_code'
|
167
|
+
}
|
168
|
+
},
|
169
|
+
description: "Monetary amount type code qualifier",
|
170
|
+
required: true
|
171
|
+
)
|
172
|
+
monetary_amount.add(:monetary_amount_type_code_qualifier, data)
|
173
|
+
|
174
|
+
data = Eancom::Edifact::Data.new(
|
175
|
+
type: String,
|
176
|
+
length: 0..35,
|
177
|
+
dictionary: nil,
|
178
|
+
description: "Monetary amount",
|
179
|
+
required: true
|
180
|
+
)
|
181
|
+
monetary_amount.add(:monetary_amount, data)
|
182
|
+
|
183
|
+
data = Eancom::Edifact::Data.new(
|
184
|
+
type: String,
|
185
|
+
length: 0..3,
|
186
|
+
dictionary: nil,
|
187
|
+
description: "Currency identification code",
|
188
|
+
required: false
|
189
|
+
)
|
190
|
+
monetary_amount.add(:currency_identification_code, data)
|
191
|
+
|
192
|
+
data = Eancom::Edifact::Data.new(
|
193
|
+
type: String,
|
194
|
+
length: 0..3,
|
195
|
+
dictionary: {
|
196
|
+
'4' => {
|
197
|
+
description: 'Invoicing currency',
|
198
|
+
identifier: 'invoicing_currency'
|
199
|
+
},
|
200
|
+
'10' => {
|
201
|
+
description: 'Pricing currency',
|
202
|
+
identifier: 'pricing_currency'
|
203
|
+
},
|
204
|
+
'11' => {
|
205
|
+
description: 'Payment currency',
|
206
|
+
identifier: 'payment_currency'
|
207
|
+
},
|
208
|
+
'13' => {
|
209
|
+
description: 'Recipient local currency',
|
210
|
+
identifier: 'recipient_local_currency'
|
211
|
+
},
|
212
|
+
'15' => {
|
213
|
+
description: 'Sender local currency',
|
214
|
+
identifier: 'sender_local_currency'
|
215
|
+
},
|
216
|
+
'18' => {
|
217
|
+
description: 'Tax currency',
|
218
|
+
identifier: 'tax_currency'
|
219
|
+
}
|
220
|
+
},
|
221
|
+
description: "Currency type code qualifier",
|
222
|
+
required: false
|
223
|
+
)
|
224
|
+
monetary_amount.add(:currency_type_code_qualifier, data)
|
225
|
+
|
226
|
+
structure << monetary_amount
|
227
|
+
#==============================================================================
|
228
|
+
Eancom.register_structure(tag: 'MOA', structure: structure)
|
@@ -0,0 +1,314 @@
|
|
1
|
+
tag = 'NAD'
|
2
|
+
Eancom.register_segment(tag: tag, klass: Eancom::Edifact::NAD)
|
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
|
+
# Party function code qualifier #
|
21
|
+
#==============================================================================
|
22
|
+
party_function_code_qualifier = Eancom::Edifact::Composite.new()
|
23
|
+
|
24
|
+
data = Eancom::Edifact::Data.new(
|
25
|
+
type: String,
|
26
|
+
length: 1..3,
|
27
|
+
dictionary: {
|
28
|
+
'BY' => {
|
29
|
+
description: 'Buyer',
|
30
|
+
identifier: 'buyer'
|
31
|
+
},
|
32
|
+
'BO' => {
|
33
|
+
description: 'Broker or sales office',
|
34
|
+
identifier: 'broker_or_sales_office'
|
35
|
+
},
|
36
|
+
'BS' => {
|
37
|
+
description: 'Bill and ship to',
|
38
|
+
identifier: 'bill_and_ship_to'
|
39
|
+
},
|
40
|
+
'DP' => {
|
41
|
+
description: 'Delivery party',
|
42
|
+
identifier: 'delivery_party'
|
43
|
+
},
|
44
|
+
'DEQ' => {
|
45
|
+
description: 'Shipper',
|
46
|
+
identifier: 'shipper'
|
47
|
+
},
|
48
|
+
'SU' => {
|
49
|
+
description: 'Supplier',
|
50
|
+
identifier: 'supplier'
|
51
|
+
},
|
52
|
+
'SN' => {
|
53
|
+
description: 'Store number',
|
54
|
+
identifier: 'store_number'
|
55
|
+
},
|
56
|
+
'SE' => {
|
57
|
+
description: 'Seller',
|
58
|
+
identifier: 'seller'
|
59
|
+
},
|
60
|
+
'SR' => {
|
61
|
+
description: "Supplier's agent/representative",
|
62
|
+
identifier: 'suppliers_agent_representative'
|
63
|
+
},
|
64
|
+
'RB' => {
|
65
|
+
description: 'Receiving financial institution',
|
66
|
+
identifier: 'receiving_financial_institution'
|
67
|
+
},
|
68
|
+
'UC' => {
|
69
|
+
description: 'Ultimate consignee',
|
70
|
+
identifier: 'ultimate_consignee'
|
71
|
+
},
|
72
|
+
'UD' => {
|
73
|
+
description: 'UD',
|
74
|
+
identifier: 'Ultimate customer'
|
75
|
+
},
|
76
|
+
'MF' => {
|
77
|
+
description: 'Manufacturer',
|
78
|
+
identifier: 'manufacturer'
|
79
|
+
},
|
80
|
+
'MR' => {
|
81
|
+
description: 'Message recipient',
|
82
|
+
identifier: 'message_recipient'
|
83
|
+
},
|
84
|
+
'II' => {
|
85
|
+
desription: 'Issuer of invoice',
|
86
|
+
identifier: 'issuer_of_invoice'
|
87
|
+
},
|
88
|
+
'IV' => {
|
89
|
+
description: 'Invoicee',
|
90
|
+
identifier: 'invoicee'
|
91
|
+
},
|
92
|
+
'CO' => {
|
93
|
+
description: 'Corporate officer',
|
94
|
+
identifier: 'corporate_officer'
|
95
|
+
},
|
96
|
+
'GY' => {
|
97
|
+
description: 'Inventory reporting party',
|
98
|
+
identifier: 'inventory_reporting_party'
|
99
|
+
},
|
100
|
+
'WH' => {
|
101
|
+
description: 'Warehouse keeper',
|
102
|
+
identifier: 'warehouse_keeper'
|
103
|
+
},
|
104
|
+
'GO' => {
|
105
|
+
description: 'Goods owner',
|
106
|
+
identifier: 'goods_owner'
|
107
|
+
},
|
108
|
+
'PO' => {
|
109
|
+
description: 'Ordering party',
|
110
|
+
identifier: 'ordering_party'
|
111
|
+
},
|
112
|
+
'PE' => {
|
113
|
+
description: 'Payee',
|
114
|
+
identifier: 'payee'
|
115
|
+
},
|
116
|
+
'CN' => {
|
117
|
+
description: 'Consignee',
|
118
|
+
identifier: 'consignee'
|
119
|
+
},
|
120
|
+
'X52' => {
|
121
|
+
description: 'Breeder (GS1 Temporary Code)',
|
122
|
+
identifier: 'breeder'
|
123
|
+
}
|
124
|
+
},
|
125
|
+
description: "Party function code qualifier",
|
126
|
+
required: true
|
127
|
+
)
|
128
|
+
party_function_code_qualifier.add(:party_function_code_qualifier, data)
|
129
|
+
|
130
|
+
structure << party_function_code_qualifier
|
131
|
+
#==============================================================================
|
132
|
+
# Party Identification details #
|
133
|
+
#==============================================================================
|
134
|
+
party_identification_details = Eancom::Edifact::Composite.new()
|
135
|
+
|
136
|
+
data = Eancom::Edifact::Data.new(
|
137
|
+
type: String,
|
138
|
+
length: 1..35,
|
139
|
+
dictionary: nil,
|
140
|
+
description: "GLN - Format n13\nFor identification of parties it is recommended to use GLN - Format n13",
|
141
|
+
required: true
|
142
|
+
)
|
143
|
+
party_identification_details.add(:party_identifier, data)
|
144
|
+
|
145
|
+
data = Eancom::Edifact::Data.new(
|
146
|
+
type: String,
|
147
|
+
length: 0..17,
|
148
|
+
dictionary: nil,
|
149
|
+
description: 'Code list identification code',
|
150
|
+
required: false
|
151
|
+
)
|
152
|
+
party_identification_details.add(:code_list_identification_code_1, data)
|
153
|
+
|
154
|
+
data = Eancom::Edifact::Data.new(
|
155
|
+
type: String,
|
156
|
+
length: 1..3,
|
157
|
+
dictionary: {
|
158
|
+
'9' => {
|
159
|
+
description: 'GS1',
|
160
|
+
identifier: 'gs1'
|
161
|
+
}
|
162
|
+
},
|
163
|
+
description: 'Code list responsible agency code (9 = GS1)',
|
164
|
+
required: true
|
165
|
+
)
|
166
|
+
party_identification_details.add(:code_list_responsible_agency_code_1, data)
|
167
|
+
|
168
|
+
structure << party_identification_details
|
169
|
+
#==============================================================================
|
170
|
+
# Name and Address #
|
171
|
+
#==============================================================================
|
172
|
+
name_address = Eancom::Edifact::Composite.new()
|
173
|
+
|
174
|
+
data = Eancom::Edifact::Data.new(
|
175
|
+
type: String,
|
176
|
+
length: 1..35,
|
177
|
+
dictionary: nil,
|
178
|
+
description: 'Name and address description',
|
179
|
+
required: true
|
180
|
+
)
|
181
|
+
name_address.add(:name_and_address_description_1, data)
|
182
|
+
name_address.add(:name_and_address_description_2, data)
|
183
|
+
name_address.add(:name_and_address_description_3, data)
|
184
|
+
name_address.add(:name_and_address_description_4, data)
|
185
|
+
name_address.add(:name_and_address_description_5, data)
|
186
|
+
|
187
|
+
structure << name_address
|
188
|
+
#==============================================================================
|
189
|
+
# Party Name #
|
190
|
+
#==============================================================================
|
191
|
+
party_name = Eancom::Edifact::Composite.new()
|
192
|
+
|
193
|
+
data = Eancom::Edifact::Data.new(
|
194
|
+
type: String,
|
195
|
+
length: 1..35,
|
196
|
+
dictionary: nil,
|
197
|
+
description: 'Party Name',
|
198
|
+
required: true
|
199
|
+
)
|
200
|
+
party_name.add(:party_name_1, data)
|
201
|
+
party_name.add(:party_name_2, data)
|
202
|
+
party_name.add(:party_name_3, data)
|
203
|
+
party_name.add(:party_name_4, data)
|
204
|
+
party_name.add(:party_name_5, data)
|
205
|
+
|
206
|
+
structure << party_name
|
207
|
+
#==============================================================================
|
208
|
+
# Street #
|
209
|
+
#==============================================================================
|
210
|
+
street = Eancom::Edifact::Composite.new()
|
211
|
+
|
212
|
+
data = Eancom::Edifact::Data.new(
|
213
|
+
type: String,
|
214
|
+
length: 1..35,
|
215
|
+
dictionary: nil,
|
216
|
+
description: 'Street and number or post office box identifier',
|
217
|
+
required: true
|
218
|
+
)
|
219
|
+
street.add(:street_and_number_1, data)
|
220
|
+
street.add(:street_and_number_2, data)
|
221
|
+
street.add(:street_and_number_3, data)
|
222
|
+
street.add(:street_and_number_4, data)
|
223
|
+
street.add(:street_and_number_5, data)
|
224
|
+
|
225
|
+
structure << street
|
226
|
+
#==============================================================================
|
227
|
+
# City name #
|
228
|
+
#==============================================================================
|
229
|
+
city_name = Eancom::Edifact::Composite.new()
|
230
|
+
|
231
|
+
data = Eancom::Edifact::Data.new(
|
232
|
+
type: String,
|
233
|
+
length: 1..35,
|
234
|
+
dictionary: nil,
|
235
|
+
description: 'City/Town, clear text',
|
236
|
+
required: false
|
237
|
+
)
|
238
|
+
city_name.add(:city_name, data)
|
239
|
+
|
240
|
+
structure << city_name
|
241
|
+
#==============================================================================
|
242
|
+
# Country Sub-Entity details #
|
243
|
+
#==============================================================================
|
244
|
+
country_sub_entity_details = Eancom::Edifact::Composite.new()
|
245
|
+
|
246
|
+
data = Eancom::Edifact::Data.new(
|
247
|
+
type: String,
|
248
|
+
length: 1..9,
|
249
|
+
dictionary: nil,
|
250
|
+
description: 'Country sub-entity name code',
|
251
|
+
required: false
|
252
|
+
)
|
253
|
+
country_sub_entity_details.add(:country_sub_entity_name_code, data)
|
254
|
+
|
255
|
+
data = Eancom::Edifact::Data.new(
|
256
|
+
type: String,
|
257
|
+
length: 1..17,
|
258
|
+
dictionary: nil,
|
259
|
+
description: 'Code list identification code',
|
260
|
+
required: false
|
261
|
+
)
|
262
|
+
country_sub_entity_details.add(:code_list_identification_code_2, data)
|
263
|
+
|
264
|
+
data = Eancom::Edifact::Data.new(
|
265
|
+
type: String,
|
266
|
+
length: 1..3,
|
267
|
+
dictionary: nil,
|
268
|
+
description: 'Code list responsible agency code',
|
269
|
+
required: false
|
270
|
+
)
|
271
|
+
country_sub_entity_details.add(:code_list_responsible_agency_code_2, data)
|
272
|
+
|
273
|
+
data = Eancom::Edifact::Data.new(
|
274
|
+
type: String,
|
275
|
+
length: 1..70,
|
276
|
+
dictionary: nil,
|
277
|
+
description: 'Country sub-entry name',
|
278
|
+
required: false
|
279
|
+
)
|
280
|
+
country_sub_entity_details.add(:country_sub_entry_name, data)
|
281
|
+
|
282
|
+
structure << country_sub_entity_details
|
283
|
+
#==============================================================================
|
284
|
+
# Postal Identification Code #
|
285
|
+
#==============================================================================
|
286
|
+
postal_identification_code = Eancom::Edifact::Composite.new()
|
287
|
+
|
288
|
+
data = Eancom::Edifact::Data.new(
|
289
|
+
type: String,
|
290
|
+
length: 1..17,
|
291
|
+
dictionary: nil,
|
292
|
+
description: 'Postal identification code',
|
293
|
+
required: false
|
294
|
+
)
|
295
|
+
postal_identification_code.add(:postal_identification_code, data)
|
296
|
+
|
297
|
+
structure << postal_identification_code
|
298
|
+
#==============================================================================
|
299
|
+
# Country Name Code #
|
300
|
+
#==============================================================================
|
301
|
+
country_name_code = Eancom::Edifact::Composite.new()
|
302
|
+
|
303
|
+
data = Eancom::Edifact::Data.new(
|
304
|
+
type: String,
|
305
|
+
length: 1..3,
|
306
|
+
dictionary: nil,
|
307
|
+
description: 'ISO 3166 two alpha code',
|
308
|
+
required: false
|
309
|
+
)
|
310
|
+
country_name_code.add(:country_name_code, data)
|
311
|
+
|
312
|
+
structure << country_name_code
|
313
|
+
#==============================================================================
|
314
|
+
Eancom.register_structure(tag: 'NAD', structure: structure)
|