eancom 1.4.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (115) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +7 -3
  3. data/.gitlab-ci.yml +11 -13
  4. data/.ruby-version +1 -1
  5. data/Gemfile +2 -4
  6. data/Gemfile.lock +23 -103
  7. data/README.md +46 -0
  8. data/definitions/desadv/d01b.rb +139 -93
  9. data/definitions/desadv/d96a.rb +187 -101
  10. data/definitions/invoic/d01b.rb +559 -0
  11. data/definitions/invoic/d96a.rb +389 -0
  12. data/definitions/invrpt/d01b.rb +134 -0
  13. data/definitions/invrpt/d96a.rb +125 -0
  14. data/definitions/orders/d01b.rb +182 -0
  15. data/definitions/orders/d96b.rb +198 -0
  16. data/definitions/ordrsp/d01b.rb +251 -0
  17. data/definitions/ordrsp/d96b.rb +226 -0
  18. data/definitions/pricat/d01b.rb +225 -0
  19. data/definitions/pricat/d96b.rb +207 -0
  20. data/definitions/retann/d01b.rb +172 -0
  21. data/definitions/retann/d96b.rb +221 -0
  22. data/definitions/segments/ajt.rb +47 -0
  23. data/definitions/segments/alc.rb +128 -36
  24. data/definitions/segments/bgm.rb +128 -0
  25. data/definitions/segments/cdi.rb +39 -0
  26. data/definitions/segments/cnt.rb +4 -0
  27. data/definitions/segments/cta.rb +89 -0
  28. data/definitions/segments/cux.rb +9 -2
  29. data/definitions/segments/dgs.rb +34 -0
  30. data/definitions/segments/doc.rb +45 -0
  31. data/definitions/segments/dtm.rb +85 -1
  32. data/definitions/segments/efi.rb +67 -0
  33. data/definitions/segments/eqd.rb +37 -0
  34. data/definitions/segments/ftx.rb +24 -2
  35. data/definitions/segments/gin.rb +113 -0
  36. data/definitions/segments/imd.rb +5 -1
  37. data/definitions/segments/inv.rb +94 -0
  38. data/definitions/segments/lin.rb +23 -3
  39. data/definitions/segments/loc.rb +52 -4
  40. data/definitions/segments/moa.rb +86 -2
  41. data/definitions/segments/nad.rb +69 -9
  42. data/definitions/segments/pac.rb +12 -0
  43. data/definitions/segments/pat.rb +171 -0
  44. data/definitions/segments/pcd.rb +72 -0
  45. data/definitions/segments/pci.rb +110 -0
  46. data/definitions/segments/pgi.rb +6 -2
  47. data/definitions/segments/pia.rb +21 -21
  48. data/definitions/segments/pri.rb +21 -1
  49. data/definitions/segments/qty.rb +219 -5
  50. data/definitions/segments/rff.rb +51 -7
  51. data/definitions/segments/rte.rb +52 -0
  52. data/definitions/segments/tax.rb +17 -10
  53. data/definitions/segments/tdt.rb +24 -0
  54. data/definitions/segments/tod.rb +64 -0
  55. data/definitions/segments/tru.rb +34 -0
  56. data/definitions/segments/una.rb +7 -7
  57. data/definitions/segments/unb.rb +4 -4
  58. data/definitions/segments/unh.rb +70 -5
  59. data/definitions/segments/uns.rb +2 -2
  60. data/definitions/segments/unt.rb +2 -2
  61. data/definitions/slsrpt/d01b.rb +104 -100
  62. data/definitions/slsrpt/d96a.rb +104 -99
  63. data/eancom.gemspec +5 -8
  64. data/lib/eancom/edifact/document.rb +2 -2
  65. data/lib/eancom/edifact/footer.rb +1 -0
  66. data/lib/eancom/edifact/segment.rb +2 -2
  67. data/lib/eancom/edifact/segments/ajt.rb +32 -0
  68. data/lib/eancom/edifact/segments/ali.rb +2 -4
  69. data/lib/eancom/edifact/segments/bgm.rb +4 -3
  70. data/lib/eancom/edifact/segments/cdi.rb +30 -0
  71. data/lib/eancom/edifact/segments/cnt.rb +8 -1
  72. data/lib/eancom/edifact/segments/cps.rb +4 -1
  73. data/lib/eancom/edifact/segments/cta.rb +30 -0
  74. data/lib/eancom/edifact/segments/cux.rb +1 -1
  75. data/lib/eancom/edifact/segments/dgs.rb +31 -0
  76. data/lib/eancom/edifact/segments/doc.rb +30 -0
  77. data/lib/eancom/edifact/segments/dtm.rb +10 -6
  78. data/lib/eancom/edifact/segments/efi.rb +38 -0
  79. data/lib/eancom/edifact/segments/eqd.rb +30 -0
  80. data/lib/eancom/edifact/segments/ftx.rb +2 -2
  81. data/lib/eancom/edifact/segments/gin.rb +45 -0
  82. data/lib/eancom/edifact/segments/imd.rb +1 -1
  83. data/lib/eancom/edifact/segments/inv.rb +43 -0
  84. data/lib/eancom/edifact/segments/lin.rb +7 -3
  85. data/lib/eancom/edifact/segments/loc.rb +8 -5
  86. data/lib/eancom/edifact/segments/mea.rb +1 -0
  87. data/lib/eancom/edifact/segments/moa.rb +3 -3
  88. data/lib/eancom/edifact/segments/nad.rb +11 -6
  89. data/lib/eancom/edifact/segments/pac.rb +3 -1
  90. data/lib/eancom/edifact/segments/pat.rb +37 -0
  91. data/lib/eancom/edifact/segments/pcd.rb +33 -0
  92. data/lib/eancom/edifact/segments/pci.rb +40 -0
  93. data/lib/eancom/edifact/segments/pia.rb +1 -0
  94. data/lib/eancom/edifact/segments/pri.rb +0 -1
  95. data/lib/eancom/edifact/segments/qty.rb +9 -5
  96. data/lib/eancom/edifact/segments/rff.rb +8 -2
  97. data/lib/eancom/edifact/segments/rte.rb +33 -0
  98. data/lib/eancom/edifact/segments/tax.rb +7 -1
  99. data/lib/eancom/edifact/segments/tdt.rb +4 -1
  100. data/lib/eancom/edifact/segments/tod.rb +33 -0
  101. data/lib/eancom/edifact/segments/tru.rb +31 -0
  102. data/lib/eancom/edifact/segments/una.rb +2 -1
  103. data/lib/eancom/edifact/segments/unb.rb +4 -5
  104. data/lib/eancom/edifact/segments/unh.rb +6 -4
  105. data/lib/eancom/edifact/segments/uns.rb +3 -0
  106. data/lib/eancom/edifact/structure.rb +0 -1
  107. data/lib/eancom/edifact.rb +15 -1
  108. data/lib/eancom/factory.rb +1 -1
  109. data/lib/eancom/parser/document.rb +2 -10
  110. data/lib/eancom/version.rb +1 -1
  111. data/lib/eancom.rb +3 -1
  112. data/pricat.json +1 -0
  113. metadata +51 -52
  114. data/.rspec_status +0 -225
  115. data/.rubocop.yml +0 -2
@@ -8,7 +8,7 @@ structure = Eancom::Edifact::Structure.new(tag: tag)
8
8
  tag = Eancom::Edifact::Composite.new()
9
9
  data = Eancom::Edifact::Data.new(
10
10
  type: String,
11
- length: 3,
11
+ length: 1..3,
12
12
  dictionary: nil,
13
13
  description: "Message Header",
14
14
  required: true
@@ -23,12 +23,32 @@ location_function_qualifier = Eancom::Edifact::Composite.new()
23
23
 
24
24
  data = Eancom::Edifact::Data.new(
25
25
  type: String,
26
- length: 3,
26
+ length: 1..3,
27
27
  dictionary: {
28
+ '1' => {
29
+ description: 'Place of terms of delivery',
30
+ identifier: 'place_of_terms_of_delivery'
31
+ },
32
+ '5' => {
33
+ description: 'Place of departure',
34
+ identifier: 'place_of_departure'
35
+ },
28
36
  '7' => {
29
37
  description: 'Place of Delivery',
30
38
  identifier: 'place_of_delivery'
31
39
  },
40
+ '14' => {
41
+ description: 'Location of goods',
42
+ identifier: 'location_of_goods'
43
+ },
44
+ '18' => {
45
+ description: 'Warehouse',
46
+ identifier: 'warehouse'
47
+ },
48
+ '19' => {
49
+ description: 'Factory/plant',
50
+ identifier: 'factory_plant'
51
+ },
32
52
  '150' => {
33
53
  description: 'Container stack position',
34
54
  identifier: 'container_stack_position'
@@ -44,7 +64,7 @@ data = Eancom::Edifact::Data.new(
44
64
  location_function_qualifier.add(:location_function_qualifier, data)
45
65
  structure << location_function_qualifier
46
66
  #==============================================================================
47
- # Location Identification #
67
+ # First Location Identification #
48
68
  #==============================================================================
49
69
  location_identification = Eancom::Edifact::Composite.new()
50
70
 
@@ -70,6 +90,10 @@ data = Eancom::Edifact::Data.new(
70
90
  type: String,
71
91
  length: 0..3,
72
92
  dictionary: {
93
+ '3' => {
94
+ description: 'IATA (International Air Transport Association',
95
+ identifier: 'iata'
96
+ },
73
97
  '9' => {
74
98
  description: 'GS1',
75
99
  identifier: 'gs1'
@@ -82,8 +106,32 @@ data = Eancom::Edifact::Data.new(
82
106
  description: "Code list responsible agency code",
83
107
  required: false
84
108
  )
85
- location_identification.add(:code_list_responsible_agancy_code, data)
109
+ location_identification.add(:code_list_responsible_agency_code, data)
110
+
111
+ data = Eancom::Edifact::Data.new(
112
+ type: String,
113
+ length: 1..25,
114
+ dictionary: nil,
115
+ description: 'First related location name code',
116
+ required: false
117
+ )
118
+ location_identification.add(:first_related_name_code, data)
86
119
 
87
120
  structure << location_identification
88
121
  #==============================================================================
122
+ # Second Location Identification #
123
+ #==============================================================================
124
+ second_location_identification = Eancom::Edifact::Composite.new
125
+
126
+ data = Eancom::Edifact::Data.new(
127
+ type: String,
128
+ length: 1..25,
129
+ dictionary: nil,
130
+ description: 'Second related location name code',
131
+ required: false
132
+ )
133
+ second_location_identification.add(:second_location_identification, data)
134
+
135
+ structure << second_location_identification
136
+ #==============================================================================
89
137
  Eancom.register_structure(tag: 'LOC', structure: structure)
@@ -33,6 +33,22 @@ data = Eancom::Edifact::Data.new(
33
33
  description: 'Amount due/amount payable',
34
34
  identifier: 'amount_due_amount_payable'
35
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
+ },
36
52
  '53' => {
37
53
  description: 'Discount amount due',
38
54
  identifier: 'discount_amount_due'
@@ -77,18 +93,58 @@ data = Eancom::Edifact::Data.new(
77
93
  description: 'Message total duty/tax/fee amount',
78
94
  identifier: 'message_total_duty_tax_fee_amount'
79
95
  },
96
+ '201' => {
97
+ description: 'Penalty amount',
98
+ identifier: 'penalty_amount'
99
+ },
80
100
  '203' => {
81
101
  description: 'Line item amount',
82
102
  identifier: 'line_item_amount'
83
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
+ },
84
132
  '396' => {
85
133
  description: 'Total price subsidy value',
86
134
  identifier: 'total_price_subsidy_value'
87
135
  },
136
+ '400' => {
137
+ description: 'Rebate amount',
138
+ identifier: 'rebate_amount'
139
+ },
88
140
  '402' => {
89
141
  description: 'Total retail value',
90
142
  identifier: 'total_retail_value'
91
143
  },
144
+ '496' => {
145
+ description: 'Total returnable packages deposit amount',
146
+ identifier: 'total_returnable_packages_deposit_amount'
147
+ },
92
148
  '507' => {
93
149
  description: 'Net-progress payment amount',
94
150
  identifier: 'net_progress_payment_amount'
@@ -97,8 +153,20 @@ data = Eancom::Edifact::Data.new(
97
153
  description: 'Calculation basis excluding all taxes',
98
154
  identifier: 'calculation_basis_excluding_all_taxes'
99
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
+ }
100
168
  },
101
- description: "Monetary amount type code qualifier ",
169
+ description: "Monetary amount type code qualifier",
102
170
  required: true
103
171
  )
104
172
  monetary_amount.add(:monetary_amount_type_code_qualifier, data)
@@ -125,6 +193,18 @@ data = Eancom::Edifact::Data.new(
125
193
  type: String,
126
194
  length: 0..3,
127
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
+ },
128
208
  '13' => {
129
209
  description: 'Recipient local currency',
130
210
  identifier: 'recipient_local_currency'
@@ -132,6 +212,10 @@ data = Eancom::Edifact::Data.new(
132
212
  '15' => {
133
213
  description: 'Sender local currency',
134
214
  identifier: 'sender_local_currency'
215
+ },
216
+ '18' => {
217
+ description: 'Tax currency',
218
+ identifier: 'tax_currency'
135
219
  }
136
220
  },
137
221
  description: "Currency type code qualifier",
@@ -141,4 +225,4 @@ monetary_amount.add(:currency_type_code_qualifier, data)
141
225
 
142
226
  structure << monetary_amount
143
227
  #==============================================================================
144
- Eancom.register_structure(tag: 'MOA', structure: structure)
228
+ Eancom.register_structure(tag: 'MOA', structure: structure)
@@ -29,6 +29,14 @@ data = Eancom::Edifact::Data.new(
29
29
  description: 'Buyer',
30
30
  identifier: 'buyer'
31
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
+ },
32
40
  'DP' => {
33
41
  description: 'Delivery party',
34
42
  identifier: 'delivery_party'
@@ -41,10 +49,30 @@ data = Eancom::Edifact::Data.new(
41
49
  description: 'Supplier',
42
50
  identifier: 'supplier'
43
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
+ },
44
68
  'UC' => {
45
69
  description: 'Ultimate consignee',
46
70
  identifier: 'ultimate_consignee'
47
71
  },
72
+ 'UD' => {
73
+ description: 'UD',
74
+ identifier: 'Ultimate customer'
75
+ },
48
76
  'MF' => {
49
77
  description: 'Manufacturer',
50
78
  identifier: 'manufacturer'
@@ -53,9 +81,45 @@ data = Eancom::Edifact::Data.new(
53
81
  description: 'Message recipient',
54
82
  identifier: 'message_recipient'
55
83
  },
84
+ 'II' => {
85
+ desription: 'Issuer of invoice',
86
+ identifier: 'issuer_of_invoice'
87
+ },
56
88
  'IV' => {
57
89
  description: 'Invoicee',
58
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'
59
123
  }
60
124
  },
61
125
  description: "Party function code qualifier",
@@ -94,16 +158,12 @@ data = Eancom::Edifact::Data.new(
94
158
  '9' => {
95
159
  description: 'GS1',
96
160
  identifier: 'gs1'
97
- },
98
- '92' => {
99
- description: 'Assigned by buyer or buyers agent',
100
- identifier: 'assigned_by_buyer_or_buyers_agent',
101
- },
161
+ }
102
162
  },
103
163
  description: 'Code list responsible agency code (9 = GS1)',
104
164
  required: true
105
165
  )
106
- party_identification_details.add(:code_list_responsible_agancy_code_1, data)
166
+ party_identification_details.add(:code_list_responsible_agency_code_1, data)
107
167
 
108
168
  structure << party_identification_details
109
169
  #==============================================================================
@@ -116,7 +176,7 @@ data = Eancom::Edifact::Data.new(
116
176
  length: 1..35,
117
177
  dictionary: nil,
118
178
  description: 'Name and address description',
119
- required: false
179
+ required: true
120
180
  )
121
181
  name_address.add(:name_and_address_description_1, data)
122
182
  name_address.add(:name_and_address_description_2, data)
@@ -135,7 +195,7 @@ data = Eancom::Edifact::Data.new(
135
195
  length: 1..35,
136
196
  dictionary: nil,
137
197
  description: 'Party Name',
138
- required: false
198
+ required: true
139
199
  )
140
200
  party_name.add(:party_name_1, data)
141
201
  party_name.add(:party_name_2, data)
@@ -154,7 +214,7 @@ data = Eancom::Edifact::Data.new(
154
214
  length: 1..35,
155
215
  dictionary: nil,
156
216
  description: 'Street and number or post office box identifier',
157
- required: false
217
+ required: true
158
218
  )
159
219
  street.add(:street_and_number_1, data)
160
220
  street.add(:street_and_number_2, data)
@@ -38,6 +38,16 @@ packaging_details = Eancom::Edifact::Composite.new()
38
38
  packaging_level_code = Eancom::Edifact::Data.new(
39
39
  type: String,
40
40
  length: 1..3,
41
+ dictionary: {
42
+ '1' => {
43
+ description: 'Inner',
44
+ identifier: 'inner'
45
+ },
46
+ '3' => {
47
+ description: 'Outer',
48
+ identifier: 'outer'
49
+ }
50
+ },
41
51
  description: "Packaging level code",
42
52
  required: false
43
53
  )
@@ -132,11 +142,13 @@ package_type_description_code = Eancom::Edifact::Data.new(
132
142
  },
133
143
  'PK' => {
134
144
  # TODO: Find out what this is used for
145
+ # PK means package. This should explain its use.
135
146
  description: 'PK: Function Unknown',
136
147
  identifier: 'pk_function_unknown'
137
148
  },
138
149
  'SL' => {
139
150
  # TODO: Find out what this is used for
151
+ # SL means slipsheet. This should explain its use.
140
152
  description: 'SL: Function Unknown',
141
153
  identifier: 'sl_function_unknown'
142
154
  },
@@ -0,0 +1,171 @@
1
+ tag = 'PAT'
2
+ Eancom.register_segment(tag: tag, klass: Eancom::Edifact::PAT)
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
+ payment_terms_type_code_qualifier = Eancom::Edifact::Composite.new
21
+ data = Eancom::Edifact::Data.new(
22
+ type: String,
23
+ length: 1..3,
24
+ dictionary: {
25
+ '1' => {
26
+ description: 'Basic',
27
+ identifier: 'basic'
28
+ },
29
+ '2' => {
30
+ description: 'End of month',
31
+ identifier: 'end_of_month'
32
+ },
33
+ '3' => {
34
+ description: 'Fixed date',
35
+ identifier: 'fixed_date'
36
+ },
37
+ '4' => {
38
+ description: 'Deferred',
39
+ identifier: 'deferred'
40
+ },
41
+ '5' => {
42
+ description: 'Discount not applicable',
43
+ identifier: 'discount_not_applicable'
44
+ },
45
+ '6' => {
46
+ description: 'Mixed',
47
+ identifier: 'mixed'
48
+ },
49
+ '7' => {
50
+ description: 'Extended',
51
+ identifier: 'extended'
52
+ },
53
+ '8' => {
54
+ desription: 'Basic discount offered',
55
+ identifier: 'basic_discount_offered'
56
+ },
57
+ '9' => {
58
+ description: 'Proximo',
59
+ identifier: 'proximo'
60
+ },
61
+ '10' => {
62
+ description: 'Instant',
63
+ identifier: 'instant'
64
+ },
65
+ '11' => {
66
+ description: 'Elective',
67
+ identifier: 'elective'
68
+ },
69
+ '12' => {
70
+ description: '10 days after end of month',
71
+ identifier: '10_days_after_end_of_month'
72
+ },
73
+ '18' => {
74
+ description: 'Previously agreed upon',
75
+ identifier: 'previously_agreed_upon'
76
+ },
77
+ '20' => {
78
+ description: 'Penalty terms',
79
+ identifier: 'penalty_terms'
80
+ },
81
+ '22' => {
82
+ description: 'Discount',
83
+ identifier: 'discount'
84
+ },
85
+ '37' => {
86
+ description: 'Complete payment',
87
+ identifier: 'complete_payment'
88
+ }
89
+ },
90
+ description: 'Payment terms type code qualifier',
91
+ required: true
92
+ )
93
+ payment_terms_type_code_qualifier.add(:payment_terms_type_code_qualifier, data)
94
+
95
+ structure << payment_terms_type_code_qualifier
96
+ #==============================================================================
97
+ # PAYMENT TERMS #
98
+ #==============================================================================
99
+ payment_terms_type_description_identifier = Eancom::Edifact::Composite.new
100
+ data = Eancom::Edifact::Data.new(
101
+ type: String,
102
+ length: 1..17,
103
+ dictionary: {
104
+ '1' => {
105
+ description: 'Draft(s) drawn on issuing bank',
106
+ identifier: 'drafts_drawn_on_issuing_bank'
107
+ },
108
+ '2' => {
109
+ description: 'Draft(s) drawn on advising bank',
110
+ identifier: 'drafts_drawn_on_advising_bank'
111
+ },
112
+ '3' => {
113
+ description: 'Draft(s) drawn on reimbursing bank',
114
+ identifier: 'drafts_drawn_on_reimbursing_bank'
115
+ },
116
+ '4' => {
117
+ description: 'Draft(s) drawn on applicant',
118
+ identifier: 'drafts_drawn_on_applicant'
119
+ },
120
+ '5' => {
121
+ description: 'Draft(s) drawn on any other drawee',
122
+ identifier: 'drafts_drawn_on_any_other_drawee'
123
+ },
124
+ '6' => {
125
+ description: 'No drafts',
126
+ identifier: 'no_drafts'
127
+ },
128
+ 'ZZZ' => {
129
+ description: 'Mutually defined',
130
+ identifier: 'mutually_defined'
131
+ }
132
+ },
133
+ description: 'Payment terms description identifier',
134
+ required: true
135
+ )
136
+ payment_terms_type_description_identifier.add(:payment_terms_type_description_identifier, data)
137
+
138
+ structure << payment_terms_type_description_identifier
139
+ #==============================================================================
140
+ # TERMS/TIME INFORMATION #
141
+ #==============================================================================
142
+ time_reference_code = Eancom::Edifact::Composite.new
143
+ data = Eancom::Edifact::Data.new(
144
+ type: String,
145
+ length: 1..3,
146
+ dictionary: {
147
+ '5' => {
148
+ description: 'Date of invoice',
149
+ identifier: 'date_of_invoice'
150
+ },
151
+ '66' => {
152
+ description: 'Specified date',
153
+ identifier: 'specified_date'
154
+ },
155
+ '69' => {
156
+ description: 'Invoice transmission date',
157
+ identifier: 'invoice_transmission_date'
158
+ },
159
+ '81' => {
160
+ description: 'Date of shipment as evidenced by the transport document(s)',
161
+ identifier: 'date_of_shipment_as_evid_by_the_transp_docs'
162
+ }
163
+ },
164
+ description: 'Time reference code',
165
+ required: true
166
+ )
167
+ time_reference_code.add(:time_reference_code, data)
168
+
169
+ structure << time_reference_code
170
+ #==============================================================================
171
+ Eancom.register_structure(tag: 'PAT', structure: structure)
@@ -0,0 +1,72 @@
1
+ tag = 'PCD'
2
+ Eancom.register_segment(tag: tag, klass: Eancom::Edifact::PCD)
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
+ # PERCENTAGE DETAILS #
21
+ #==============================================================================
22
+ percentage_details = Eancom::Edifact::Composite.new
23
+ data = Eancom::Edifact::Data.new(
24
+ type: String,
25
+ length: 1..3,
26
+ dictionary: {
27
+ '1' => {
28
+ description: 'Allowance',
29
+ identifier: 'allowance'
30
+ },
31
+ '2' => {
32
+ description: 'Charge',
33
+ identifier: 'charge'
34
+ },
35
+ '3' => {
36
+ description: 'Allowance or charge',
37
+ identifier: 'allowance_or_charge'
38
+ },
39
+ '7' => {
40
+ description: 'Percentage of invoice',
41
+ identifier: 'percentage_of_invoice'
42
+ },
43
+ '12' => {
44
+ description: 'Discount',
45
+ identifier: 'discount'
46
+ },
47
+ '15' => {
48
+ description: 'Penalty percentage',
49
+ identifier: 'penalty_percentage'
50
+ },
51
+ '16' => {
52
+ description: 'Interest percentage',
53
+ identifier: 'interest_percentage'
54
+ }
55
+ },
56
+ description: 'Percentage type code qualifier',
57
+ required: true
58
+ )
59
+ percentage_details.add(:percentage_type_code_qualifier, data)
60
+
61
+ data = Eancom::Edifact::Data.new(
62
+ type: String,
63
+ length: 1..10,
64
+ dictionary: nil,
65
+ description: 'Percentage',
66
+ required: false
67
+ )
68
+ percentage_details.add(:percentage, data)
69
+
70
+ structure << percentage_details
71
+ #===============================================================================#
72
+ Eancom.register_structure(tag: 'PCD', structure: structure)