module Eancom module Edifact class TAX < Segment TAG = 'TAX'.freeze TYPE = :body.freeze attr_reader :segment_type def initialize( tag: nil, duty_or_tax_or_fee_function_code_qualifier:, 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, code_list_responsibility_agency_code_2: nil, duty_or_tax_of_fee_assessment_basis_value: nil, duty_tax_fee_rate_code: nil, code_list_identification_code_3: nil, code_list_responsibility_agency_code_3: nil, duty_or_tax_or_fee_rate: nil, duty_or_tax_or_fee_basis_code: nil, code_list_identification_code_4: nil, code_list_responsibility_agency_code_4: nil, duty_or_tax_or_fee_category_code: nil ) @tag = tag @duty_or_tax_or_fee_function_code_qualifier = duty_or_tax_or_fee_function_code_qualifier @duty_or_tax_or_fee_name_code = duty_or_tax_or_fee_name_code @code_list_identification_code_1 = code_list_identification_code_1 @code_list_responsibility_agency_code_1 = code_list_responsibility_agency_code_1 @duty_or_tax_or_fee_type_name = duty_or_tax_or_fee_type_name @duty_or_tax_or_fee_account_code = duty_or_tax_or_fee_account_code @code_list_identification_code_2 = code_list_identification_code_2 @code_list_responsibility_agency_code_2 = code_list_responsibility_agency_code_2 @duty_or_tax_of_fee_assessment_basis_value = duty_or_tax_of_fee_assessment_basis_value @duty_tax_fee_rate_code = duty_tax_fee_rate_code @code_list_identification_code_3 = code_list_identification_code_3 @code_list_responsibility_agency_code_3 = code_list_responsibility_agency_code_3 @duty_or_tax_or_fee_rate = duty_or_tax_or_fee_rate @duty_or_tax_or_fee_basis_code = duty_or_tax_or_fee_basis_code @code_list_identification_code_4 = code_list_identification_code_4 @code_list_responsibility_agency_code_4 = code_list_responsibility_agency_code_4 @duty_or_tax_or_fee_category_code = duty_or_tax_or_fee_category_code 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 end def group_name 'taxes' end def segment_type TYPE end end end end