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,53 @@
|
|
1
|
+
module Eancom
|
2
|
+
module Edifact
|
3
|
+
class PRI < Segment
|
4
|
+
TAG = 'PRI'.freeze
|
5
|
+
TYPE = :body.freeze
|
6
|
+
|
7
|
+
attr_reader :segment_type
|
8
|
+
|
9
|
+
def initialize(
|
10
|
+
tag: nil,
|
11
|
+
price_code_qualifier:,
|
12
|
+
price_amount:,
|
13
|
+
price_type_code: nil,
|
14
|
+
price_specification_code: nil,
|
15
|
+
unit_price_basis_value: nil,
|
16
|
+
measurment_unit_code: nil,
|
17
|
+
subline_item_price_change_operation_code: nil
|
18
|
+
)
|
19
|
+
@tag = tag
|
20
|
+
|
21
|
+
@price_code_qualifier = price_code_qualifier
|
22
|
+
@price_amount = price_amount
|
23
|
+
@price_type_code = price_type_code
|
24
|
+
@price_specification_code = price_specification_code
|
25
|
+
@unit_price_basis_value = unit_price_basis_value
|
26
|
+
@measurment_unit_code = measurment_unit_code
|
27
|
+
@subline_item_price_change_operation_code = subline_item_price_change_operation_code
|
28
|
+
|
29
|
+
super(tag: tag || TAG)
|
30
|
+
end
|
31
|
+
|
32
|
+
def to_json_hash
|
33
|
+
hash = {}
|
34
|
+
hash.merge!(price_code_qualifier: find_identifier(:price_code_qualifier)) if @price_code_qualifier
|
35
|
+
hash.merge!(price_amount: @price_amount) if @price_amount
|
36
|
+
hash.merge!(price_type_code: find_identifier(:price_type_code)) if @price_type_code
|
37
|
+
hash.merge!(price_specification_code: find_identifier(:price_specification_code)) if @price_specification_code
|
38
|
+
hash.merge!(unit_price_basis_value: @unit_price_basis_value) if @unit_price_basis_value
|
39
|
+
hash.merge!(measurment_unit_code: find_identifier(:measurment_unit_code)) if @measurment_unit_code
|
40
|
+
{ price: hash }
|
41
|
+
end
|
42
|
+
|
43
|
+
def group_name
|
44
|
+
'prices'
|
45
|
+
end
|
46
|
+
|
47
|
+
def segment_type
|
48
|
+
TYPE
|
49
|
+
end
|
50
|
+
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module Eancom
|
2
|
+
module Edifact
|
3
|
+
class QTY < Segment
|
4
|
+
TAG = 'QTY'.freeze
|
5
|
+
TYPE = :body.freeze
|
6
|
+
|
7
|
+
def initialize(
|
8
|
+
tag: nil,
|
9
|
+
quantity_type_code_qualifier:,
|
10
|
+
quantity:,
|
11
|
+
measurement_unit_code: nil
|
12
|
+
)
|
13
|
+
@tag = tag
|
14
|
+
@quantity_type_code_qualifier = quantity_type_code_qualifier
|
15
|
+
@quantity = quantity
|
16
|
+
@measurement_unit_code = measurement_unit_code
|
17
|
+
|
18
|
+
super(tag: tag || TAG)
|
19
|
+
end
|
20
|
+
|
21
|
+
def to_json_hash
|
22
|
+
hash = { identifier => {} }
|
23
|
+
hash[identifier].merge!({ quantity: @quantity }) if @quantity
|
24
|
+
hash.merge!(measurement_unit_code: find_identifier(:measurement_unit_code)) if @measurement_unit_code
|
25
|
+
hash.merge!(identifier: @identifier) if @identifier
|
26
|
+
hash
|
27
|
+
end
|
28
|
+
|
29
|
+
def group_name
|
30
|
+
'quantities'
|
31
|
+
end
|
32
|
+
|
33
|
+
def segment_type
|
34
|
+
TYPE
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def identifier
|
40
|
+
@identifier ||= structure.find(:quantity_type_code_qualifier).dictionary[@quantity_type_code_qualifier][:identifier]
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
@@ -0,0 +1,47 @@
|
|
1
|
+
module Eancom
|
2
|
+
module Edifact
|
3
|
+
class RFF < Segment
|
4
|
+
TAG = 'RFF'.freeze
|
5
|
+
TYPE = :body.freeze
|
6
|
+
|
7
|
+
def initialize(
|
8
|
+
tag: nil,
|
9
|
+
reference_code_qualifier:,
|
10
|
+
reference_identifier: nil,
|
11
|
+
document_line_identifier: nil
|
12
|
+
)
|
13
|
+
@tag = tag
|
14
|
+
@reference_code_qualifier = reference_code_qualifier
|
15
|
+
@reference_identifier = reference_identifier
|
16
|
+
@document_line_identifier = document_line_identifier
|
17
|
+
|
18
|
+
super(tag: @tag || TAG)
|
19
|
+
end
|
20
|
+
|
21
|
+
def to_json_hash
|
22
|
+
{
|
23
|
+
identifier => {
|
24
|
+
reference_identifier: @reference_identifier,
|
25
|
+
document_line_identifier: @document_line_identifier
|
26
|
+
},
|
27
|
+
identifier: @identifier
|
28
|
+
}
|
29
|
+
end
|
30
|
+
|
31
|
+
def group_name
|
32
|
+
'references'
|
33
|
+
end
|
34
|
+
|
35
|
+
def segment_type
|
36
|
+
TYPE
|
37
|
+
end
|
38
|
+
|
39
|
+
private
|
40
|
+
|
41
|
+
def identifier
|
42
|
+
@identifier ||= structure.find(:reference_code_qualifier).dictionary[@reference_code_qualifier][:identifier]
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Eancom
|
2
|
+
module Edifact
|
3
|
+
class RTE < Segment
|
4
|
+
TAG = 'RTE'.freeze
|
5
|
+
TYPE = :header
|
6
|
+
|
7
|
+
attr_reader :segment_type
|
8
|
+
|
9
|
+
def initialize(
|
10
|
+
tag: nil,
|
11
|
+
rate_type_code_qualifier: nil,
|
12
|
+
unit_price_basis_rate: nil
|
13
|
+
)
|
14
|
+
@tag = tag
|
15
|
+
@rate_type_code_qualifier = rate_type_code_qualifier
|
16
|
+
@unit_price_basis_rate = unit_price_basis_rate
|
17
|
+
|
18
|
+
super(tag: tag || TAG)
|
19
|
+
end
|
20
|
+
|
21
|
+
def to_json_hash
|
22
|
+
hash = {}
|
23
|
+
hash.merge!(rate_type_code_qualifier: find_identifier(:rate_type_code_qualifier)) if @rate_type_code_qualifier
|
24
|
+
hash.merge!(unit_price_basis_rate: @unit_price_basis_rate) if @unit_price_basis_rate
|
25
|
+
hash
|
26
|
+
end
|
27
|
+
|
28
|
+
def segment_type
|
29
|
+
TYPE
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,78 @@
|
|
1
|
+
module Eancom
|
2
|
+
module Edifact
|
3
|
+
class TAX < Segment
|
4
|
+
TAG = 'TAX'.freeze
|
5
|
+
TYPE = :body.freeze
|
6
|
+
|
7
|
+
attr_reader :segment_type
|
8
|
+
|
9
|
+
def initialize(
|
10
|
+
tag: nil,
|
11
|
+
duty_or_tax_or_fee_function_code_qualifier:,
|
12
|
+
duty_or_tax_or_fee_name_code: nil,
|
13
|
+
code_list_identification_code_1: nil,
|
14
|
+
code_list_responsibility_agency_code_1: nil,
|
15
|
+
duty_or_tax_or_fee_type_name: nil,
|
16
|
+
duty_or_tax_or_fee_account_code: nil,
|
17
|
+
code_list_identification_code_2: nil,
|
18
|
+
code_list_responsibility_agency_code_2: nil,
|
19
|
+
duty_or_tax_of_fee_assessment_basis_value: nil,
|
20
|
+
duty_tax_fee_rate_code: nil,
|
21
|
+
code_list_identification_code_3: nil,
|
22
|
+
code_list_responsibility_agency_code_3: nil,
|
23
|
+
duty_or_tax_or_fee_rate: nil,
|
24
|
+
duty_or_tax_or_fee_basis_code: nil,
|
25
|
+
code_list_identification_code_4: nil,
|
26
|
+
code_list_responsibility_agency_code_4: nil,
|
27
|
+
duty_or_tax_or_fee_category_code: nil
|
28
|
+
)
|
29
|
+
@tag = tag
|
30
|
+
@duty_or_tax_or_fee_function_code_qualifier = duty_or_tax_or_fee_function_code_qualifier
|
31
|
+
@duty_or_tax_or_fee_name_code = duty_or_tax_or_fee_name_code
|
32
|
+
@code_list_identification_code_1 = code_list_identification_code_1
|
33
|
+
@code_list_responsibility_agency_code_1 = code_list_responsibility_agency_code_1
|
34
|
+
@duty_or_tax_or_fee_type_name = duty_or_tax_or_fee_type_name
|
35
|
+
@duty_or_tax_or_fee_account_code = duty_or_tax_or_fee_account_code
|
36
|
+
@code_list_identification_code_2 = code_list_identification_code_2
|
37
|
+
@code_list_responsibility_agency_code_2 = code_list_responsibility_agency_code_2
|
38
|
+
@duty_or_tax_of_fee_assessment_basis_value = duty_or_tax_of_fee_assessment_basis_value
|
39
|
+
@duty_tax_fee_rate_code = duty_tax_fee_rate_code
|
40
|
+
@code_list_identification_code_3 = code_list_identification_code_3
|
41
|
+
@code_list_responsibility_agency_code_3 = code_list_responsibility_agency_code_3
|
42
|
+
@duty_or_tax_or_fee_rate = duty_or_tax_or_fee_rate
|
43
|
+
@duty_or_tax_or_fee_basis_code = duty_or_tax_or_fee_basis_code
|
44
|
+
@code_list_identification_code_4 = code_list_identification_code_4
|
45
|
+
@code_list_responsibility_agency_code_4 = code_list_responsibility_agency_code_4
|
46
|
+
@duty_or_tax_or_fee_category_code = duty_or_tax_or_fee_category_code
|
47
|
+
|
48
|
+
super(tag: tag || TAG)
|
49
|
+
end
|
50
|
+
|
51
|
+
def to_json_hash
|
52
|
+
hash = {}
|
53
|
+
hash.merge!(duty_or_tax_or_fee_function_code_qualifier: find_identifier(:duty_or_tax_or_fee_function_code_qualifier)) if @duty_or_tax_or_fee_function_code_qualifier
|
54
|
+
hash.merge!(duty_or_tax_or_fee_name_code: find_identifier(:duty_or_tax_or_fee_name_code)) if @duty_or_tax_or_fee_name_code
|
55
|
+
hash.merge!(duty_or_tax_or_fee_account_code: @duty_or_tax_or_fee_account_code) if @duty_or_tax_or_fee_account_code
|
56
|
+
hash.merge!(duty_tax_fee_rate_code: @duty_tax_fee_rate_code) if @duty_tax_fee_rate_code
|
57
|
+
hash.merge!(duty_or_tax_or_fee_rate: @duty_or_tax_or_fee_rate) if @duty_or_tax_or_fee_rate
|
58
|
+
hash.merge!(code_list_identification_code_3: @code_list_identification_code_3) if @code_list_identification_code_3
|
59
|
+
hash.merge!(code_list_responsibility_agency_code_3: @code_list_responsibility_agency_code_3) if @code_list_responsibility_agency_code_3
|
60
|
+
hash.merge!(code_list_responsibility_agency_code_4: @code_list_responsibility_agency_code_4) if @code_list_responsibility_agency_code_4
|
61
|
+
hash.merge!(duty_or_tax_or_fee_category_code: find_identifier(:duty_or_tax_or_fee_category_code)) if @duty_or_tax_or_fee_category_code
|
62
|
+
outer_hash = {}
|
63
|
+
identifier = find_identifier(:duty_or_tax_or_fee_function_code_qualifier)
|
64
|
+
outer_hash[identifier] = hash
|
65
|
+
outer_hash
|
66
|
+
end
|
67
|
+
|
68
|
+
def group_name
|
69
|
+
'taxes'
|
70
|
+
end
|
71
|
+
|
72
|
+
def segment_type
|
73
|
+
TYPE
|
74
|
+
end
|
75
|
+
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
module Eancom
|
2
|
+
module Edifact
|
3
|
+
class TDT < Segment
|
4
|
+
TAG = 'TDT'.freeze
|
5
|
+
TYPE = :body.freeze
|
6
|
+
|
7
|
+
def initialize(
|
8
|
+
tag: nil,
|
9
|
+
transport_stage_code_qualifier:,
|
10
|
+
means_of_transport_journey_identifier: nil,
|
11
|
+
transport_mode_name_code:,
|
12
|
+
transport_means_description_code: nil,
|
13
|
+
transport_means_description: nil,
|
14
|
+
carrier_identifier: nil,
|
15
|
+
code_list_identification_code_1: nil,
|
16
|
+
code_list_responsible_agency_1: nil,
|
17
|
+
carrier_name: nil,
|
18
|
+
transit_direction_identicator_code: nil,
|
19
|
+
transport_means_identification_name_identifier: nil,
|
20
|
+
code_list_identification_code_2: nil,
|
21
|
+
code_list_responsible_agency_2: nil,
|
22
|
+
transport_means_identification_name: nil,
|
23
|
+
transport_means_nationality_code: nil
|
24
|
+
)
|
25
|
+
@tag = tag
|
26
|
+
@transport_stage_code_qualifier = transport_stage_code_qualifier
|
27
|
+
@means_of_transport_journey_identifier = means_of_transport_journey_identifier
|
28
|
+
@transport_mode_name_code = transport_mode_name_code
|
29
|
+
@transport_means_description_code = transport_means_description_code
|
30
|
+
@transport_means_description = transport_means_description
|
31
|
+
@carrier_identifier = carrier_identifier
|
32
|
+
@code_list_identification_code_1 = code_list_identification_code_1
|
33
|
+
@code_list_responsible_agency_1 = code_list_responsible_agency_1
|
34
|
+
@carrier_name = carrier_name
|
35
|
+
@transit_direction_identicator_code = transit_direction_identicator_code
|
36
|
+
@transport_means_identification_name_identifier = transport_means_identification_name_identifier
|
37
|
+
@code_list_identification_code_2 = code_list_identification_code_2
|
38
|
+
@code_list_responsible_agency_2 = code_list_responsible_agency_2
|
39
|
+
@transport_means_identification_name = transport_means_identification_name
|
40
|
+
@transport_means_nationality_code = transport_means_nationality_code
|
41
|
+
|
42
|
+
super(tag: tag || TAG)
|
43
|
+
end
|
44
|
+
|
45
|
+
def to_json_hash
|
46
|
+
hash = {}
|
47
|
+
hash.merge!(transport_stage_code_qualifier: find_identifier(:transport_stage_code_qualifier)) if @transport_stage_code_qualifier
|
48
|
+
hash.merge!(transport_mode_name_code: find_identifier(:transport_mode_name_code)) if @transport_mode_name_code
|
49
|
+
hash
|
50
|
+
end
|
51
|
+
|
52
|
+
def segment_type
|
53
|
+
TYPE
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Eancom
|
2
|
+
module Edifact
|
3
|
+
class TOD < Segment
|
4
|
+
TAG = 'TOD'.freeze
|
5
|
+
TYPE = :header
|
6
|
+
|
7
|
+
attr_reader :segment_type
|
8
|
+
|
9
|
+
def initialize(
|
10
|
+
tag: nil,
|
11
|
+
delivery_or_transport_terms_function_code: nil,
|
12
|
+
delivery_or_transport_terms_description_code: nil
|
13
|
+
)
|
14
|
+
@tag = tag
|
15
|
+
@delivery_or_transport_terms_function_code = delivery_or_transport_terms_function_code
|
16
|
+
@delivery_or_transport_terms_description_code = delivery_or_transport_terms_description_code
|
17
|
+
|
18
|
+
super(tag: tag || TAG)
|
19
|
+
end
|
20
|
+
|
21
|
+
def to_json_hash
|
22
|
+
hash = {}
|
23
|
+
hash.merge!(delivery_or_transport_terms_function_code: @delivery_or_transport_terms_function_code) if @delivery_or_transport_terms_function_code
|
24
|
+
hash.merge!(delivery_or_transport_terms_description_code: @delivery_or_transport_terms_description_code) if @delivery_or_transport_terms_description_code
|
25
|
+
hash
|
26
|
+
end
|
27
|
+
|
28
|
+
def segment_type
|
29
|
+
TYPE
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
module Eancom
|
2
|
+
module Edifact
|
3
|
+
class TRU < Segment
|
4
|
+
TAG = 'TRU'.freeze
|
5
|
+
TYPE = :body
|
6
|
+
|
7
|
+
attr_reader :segment_type
|
8
|
+
|
9
|
+
def initialize(
|
10
|
+
tag: nil,
|
11
|
+
object_identifier:
|
12
|
+
)
|
13
|
+
|
14
|
+
@tag = tag
|
15
|
+
@object_identifier = object_identifier
|
16
|
+
|
17
|
+
super(tag: tag || TAG)
|
18
|
+
end
|
19
|
+
|
20
|
+
def to_json_hash
|
21
|
+
hash = {}
|
22
|
+
hash.merge!(object_identifier: @object_identifier)
|
23
|
+
hash
|
24
|
+
end
|
25
|
+
|
26
|
+
def segment_type
|
27
|
+
TYPE
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
module Eancom
|
2
|
+
module Edifact
|
3
|
+
class UNA < Segment
|
4
|
+
TAG = 'UNA'.freeze
|
5
|
+
TYPE = :header.freeze
|
6
|
+
|
7
|
+
attr_reader :tag, :una1, :una2, :una3, :una4, :una5, :una6
|
8
|
+
|
9
|
+
def initialize(tag: nil,
|
10
|
+
una1: ':',
|
11
|
+
una2: '+',
|
12
|
+
una3: '.',
|
13
|
+
una4: '?',
|
14
|
+
una5: ' ',
|
15
|
+
una6: '\'',
|
16
|
+
**kwargs
|
17
|
+
)
|
18
|
+
@tag = tag
|
19
|
+
@una1 = una1
|
20
|
+
@una2 = una2
|
21
|
+
@una3 = una3
|
22
|
+
@una4 = una4
|
23
|
+
@una5 = una5
|
24
|
+
@una6 = una6
|
25
|
+
|
26
|
+
super(tag: (tag || TAG))
|
27
|
+
end
|
28
|
+
|
29
|
+
|
30
|
+
def to_s
|
31
|
+
stream = ""
|
32
|
+
stream << tag
|
33
|
+
stream << una1
|
34
|
+
stream << una2
|
35
|
+
stream << una3
|
36
|
+
stream << una4
|
37
|
+
stream << una5
|
38
|
+
stream << una6
|
39
|
+
stream
|
40
|
+
end
|
41
|
+
|
42
|
+
def to_json_hash
|
43
|
+
{}
|
44
|
+
end
|
45
|
+
|
46
|
+
def segment_type
|
47
|
+
TYPE
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
module Eancom
|
2
|
+
module Edifact
|
3
|
+
class UNB < Segment
|
4
|
+
TAG = 'UNB'.freeze
|
5
|
+
TYPE = :header.freeze
|
6
|
+
|
7
|
+
def initialize(tag: nil,
|
8
|
+
syntax_identifier:,
|
9
|
+
syntax_version_number:,
|
10
|
+
interchange_sender_identification:,
|
11
|
+
sender_identifiction_code_qualifier:,
|
12
|
+
interchange_sender_internal_identification: nil,
|
13
|
+
interchange_recipient_identification:,
|
14
|
+
recipient_identifiction_code_qualifier:,
|
15
|
+
interchange_recipient_internal_identification: nil,
|
16
|
+
date:,
|
17
|
+
time:,
|
18
|
+
interchange_control_reference:,
|
19
|
+
recipient_reference: nil,
|
20
|
+
recipient_reference_qualifier: nil,
|
21
|
+
application_reference: nil,
|
22
|
+
processing_priority_code: nil,
|
23
|
+
acknowledgement_request: nil,
|
24
|
+
interchange_agreement_identifier: nil,
|
25
|
+
test_indicator: nil
|
26
|
+
)
|
27
|
+
@tag = tag
|
28
|
+
@syntax_identifier = syntax_identifier
|
29
|
+
@syntax_version_number = syntax_version_number
|
30
|
+
@interchange_sender_identification = interchange_sender_identification
|
31
|
+
@sender_identifiction_code_qualifier = sender_identifiction_code_qualifier
|
32
|
+
@interchange_sender_internal_identification = interchange_sender_internal_identification
|
33
|
+
@interchange_recipient_identification = interchange_recipient_identification
|
34
|
+
@recipient_identifiction_code_qualifier = recipient_identifiction_code_qualifier
|
35
|
+
@interchange_recipient_internal_identification = interchange_recipient_internal_identification
|
36
|
+
@date = date
|
37
|
+
@time = time
|
38
|
+
@interchange_control_reference = interchange_control_reference
|
39
|
+
@recipient_reference = recipient_reference
|
40
|
+
@recipient_reference_qualifier = recipient_reference_qualifier
|
41
|
+
@application_reference = application_reference
|
42
|
+
@processing_priority_code = processing_priority_code
|
43
|
+
@acknowledgement_request = acknowledgement_request
|
44
|
+
@interchange_agreement_identifier = interchange_agreement_identifier
|
45
|
+
@test_indicator = test_indicator
|
46
|
+
super(tag: tag || TAG)
|
47
|
+
end
|
48
|
+
|
49
|
+
def to_json_hash
|
50
|
+
{
|
51
|
+
interchange_sender_identification: @interchange_sender_identification,
|
52
|
+
interchange_recipient_identification: @interchange_recipient_identification,
|
53
|
+
date: @date,
|
54
|
+
time: @time,
|
55
|
+
interchange_control_reference: @interchange_control_reference,
|
56
|
+
application_reference: @application_reference,
|
57
|
+
interchange_agreement_identifier: @interchange_agreement_identifier
|
58
|
+
}
|
59
|
+
end
|
60
|
+
|
61
|
+
def segment_type
|
62
|
+
TYPE
|
63
|
+
end
|
64
|
+
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
|