class PayrolleeCz::TaxClaimDisabilityConcept

Attributes

relief_code_1[R]
relief_code_2[R]
relief_code_3[R]

Public Class Methods

new(tag_code, values) click to toggle source
Calls superclass method
# File lib/payrollee_cz/concepts/tax_claim_disability_concept.rb, line 9
def initialize(tag_code, values)
  super(PayConceptGateway::REFCON_TAX_CLAIM_DISABILITY, tag_code)
  init_values(values)
end

Public Instance Methods

compute_result_value(year, code_1, code_2, code_3) click to toggle source
# File lib/payrollee_cz/concepts/tax_claim_disability_concept.rb, line 27
def compute_result_value(year, code_1, code_2, code_3)
  relief_value_1 = relief1_claim_amount(year, code_1)
  relief_value_2 = relief2_claim_amount(year, code_2)
  relief_value_3 = relief3_claim_amount(year, code_3)

  relief_value_1 + relief_value_2 + relief_value_3
end
disability1_relief(year) click to toggle source
# File lib/payrollee_cz/concepts/tax_claim_disability_concept.rb, line 61
def disability1_relief(year)
  if year >= 2009
    relief_amount = 210
  elsif year == 2008
    relief_amount = 210
  elsif year >= 2006
    relief_amount = 125
  else
    relief_amount = 0
  end
  relief_amount
end
disability2_relief(year) click to toggle source
# File lib/payrollee_cz/concepts/tax_claim_disability_concept.rb, line 74
def disability2_relief(year)
  if year >= 2009
    relief_amount = 420
  elsif year == 2008
    relief_amount = 420
  elsif year >= 2006
    relief_amount = 250
  else
    relief_amount = 0
  end
  relief_amount
end
disability3_relief(year) click to toggle source
# File lib/payrollee_cz/concepts/tax_claim_disability_concept.rb, line 87
def disability3_relief(year)
  if year >= 2009
    relief_amount = 1345
  elsif year == 2008
    relief_amount = 1345
  elsif year >= 2006
    relief_amount = 800
  else
    relief_amount = 0
  end
  relief_amount
end
dup_with_value(code, values) click to toggle source
# File lib/payrollee_cz/concepts/tax_claim_disability_concept.rb, line 20
def dup_with_value(code, values)
  new_concept = self.dup
  new_concept.init_code(code)
  new_concept.init_values(values)
  return new_concept
end
evaluate(period, tag_config, results) click to toggle source
# File lib/payrollee_cz/concepts/tax_claim_disability_concept.rb, line 35
def evaluate(period, tag_config, results)
  relief_value = compute_result_value(period.year, relief_code_1, relief_code_2, relief_code_3)

  result_values = {tax_relief: relief_value}

  TaxClaimResult.new(@tag_code, @code, self, result_values)
end
export_xml(xml_builder) click to toggle source
# File lib/payrollee_cz/concepts/tax_claim_disability_concept.rb, line 100
def export_xml(xml_builder)
  attributes = {}
  attributes[:relief_code_1] = @relief_code_1
  attributes[:relief_code_2] = @relief_code_2
  attributes[:relief_code_3] = @relief_code_3
  xml_builder.spec_value(attributes)
end
init_values(values) click to toggle source
# File lib/payrollee_cz/concepts/tax_claim_disability_concept.rb, line 14
def init_values(values)
  @relief_code_1 = values[:relief_code_1] || 0
  @relief_code_2 = values[:relief_code_2] || 0
  @relief_code_3 = values[:relief_code_3] || 0
end
relief1_claim_amount(year, code) click to toggle source
# File lib/payrollee_cz/concepts/tax_claim_disability_concept.rb, line 43
def relief1_claim_amount(year, code)
  relief_amount = 0
  return relief_amount if code == 0
  relief_amount = disability1_relief(year)
end
relief2_claim_amount(year, code) click to toggle source
# File lib/payrollee_cz/concepts/tax_claim_disability_concept.rb, line 49
def relief2_claim_amount(year, code)
  relief_amount = 0
  return relief_amount if code == 0
  relief_amount = disability2_relief(year)
end
relief3_claim_amount(year, code) click to toggle source
# File lib/payrollee_cz/concepts/tax_claim_disability_concept.rb, line 55
def relief3_claim_amount(year, code)
  relief_amount = 0
  return relief_amount if code == 0
  relief_amount = disability3_relief(year)
end