lib/eancom/edifact/segments/tax.rb in eancom-1.6.3 vs lib/eancom/edifact/segments/tax.rb in eancom-2.0.0
- old
+ new
@@ -7,11 +7,11 @@
attr_reader :segment_type
def initialize(
tag: nil,
duty_or_tax_or_fee_function_code_qualifier:,
- duty_or_tax_or_fee_name_code:,
+ duty_or_tax_or_fee_name_code: nil,
code_list_identification_code_1: nil,
code_list_responsibility_agency_code_1: nil,
duty_or_tax_or_fee_type_name: nil,
duty_or_tax_or_fee_account_code: nil,
code_list_identification_code_2: nil,
@@ -48,11 +48,17 @@
super(tag: tag || TAG)
end
def to_json_hash
hash = {}
+ 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
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
+ hash.merge!(duty_or_tax_or_fee_account_code: @duty_or_tax_or_fee_account_code) if @duty_or_tax_or_fee_account_code
+ hash.merge!(duty_tax_fee_rate_code: @duty_tax_fee_rate_code) if @duty_tax_fee_rate_code
hash.merge!(duty_or_tax_or_fee_rate: @duty_or_tax_or_fee_rate) if @duty_or_tax_or_fee_rate
+ hash.merge!(code_list_identification_code_3: @code_list_identification_code_3) if @code_list_identification_code_3
+ hash.merge!(code_list_responsibility_agency_code_3: @code_list_responsibility_agency_code_3) if @code_list_responsibility_agency_code_3
+ hash.merge!(code_list_responsibility_agency_code_4: @code_list_responsibility_agency_code_4) if @code_list_responsibility_agency_code_4
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
outer_hash = {}
identifier = find_identifier(:duty_or_tax_or_fee_function_code_qualifier)
outer_hash[identifier] = hash
outer_hash