class PayrolleeCz::TaxEmployersSocialConcept

Constants

TAG_AMOUNT_BASE

Public Class Methods

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

Public Instance Methods

calc_category() click to toggle source
# File lib/payrollee_cz/concepts/tax_employers_social_concept.rb, line 35
def calc_category
  PayrollConcept::CALC_CATEGORY_NETTO
end
compute_result_value(period, employer_base) click to toggle source
# File lib/payrollee_cz/concepts/tax_employers_social_concept.rb, line 39
def compute_result_value(period, employer_base)
  payment_income = 0
  if !interest?
    payment_income = 0
  else
    payment_income = [0,employer_base].max
  end
  insurance_payment(period, payment_income)
end
dup_with_value(code, values) click to toggle source
# File lib/payrollee_cz/concepts/tax_employers_social_concept.rb, line 16
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_employers_social_concept.rb, line 49
def evaluate(period, tag_config, results)
  employer_base = employer_income_result(results, TAG_AMOUNT_BASE)

  payment_value = compute_result_value(period, employer_base)

  result_values = {payment: payment_value}

  PaymentResult.new(@tag_code, @code, self, result_values)
end
export_xml(xml_builder) click to toggle source
# File lib/payrollee_cz/concepts/tax_employers_social_concept.rb, line 81
def export_xml(xml_builder)
  attributes = {}
  attributes[:interest_code] = @interest_code
  xml_builder.spec_value(attributes)
end
init_values(values) click to toggle source
# File lib/payrollee_cz/concepts/tax_employers_social_concept.rb, line 12
def init_values(values)
  @interest_code = values[:interest_code] || 0
end
insurance_payment(period, payment_income) click to toggle source
# File lib/payrollee_cz/concepts/tax_employers_social_concept.rb, line 59
def insurance_payment(period, payment_income)
  social_factor = social_insurance_factor(period)

  payment_value = fix_insurance_round_up(
      big_multi(payment_income, social_factor)
  )
end
interest?() click to toggle source
# File lib/payrollee_cz/concepts/tax_employers_social_concept.rb, line 67
def interest?
  @interest_code!=0
end
pending_codes() click to toggle source
# File lib/payrollee_cz/concepts/tax_employers_social_concept.rb, line 23
def pending_codes
  [
      InsuranceSocialBaseTag.new
  ]
end
social_insurance_factor(period) click to toggle source
# File lib/payrollee_cz/concepts/tax_employers_social_concept.rb, line 71
def social_insurance_factor(period)
  factor = 0.0
  if (period.year < 2008)
    factor = 0
  else
    factor = 25
  end
  return BigDecimal.new(factor.fdiv(100), 15)
end
summary_codes() click to toggle source
# File lib/payrollee_cz/concepts/tax_employers_social_concept.rb, line 29
def summary_codes
  [
      IncomeNettoTag.new
  ]
end