class PayrolleeCz::InsuranceSocialConcept
Constants
- TAG_AMOUNT_BASE
Public Class Methods
new(tag_code, values)
click to toggle source
Calls superclass method
# File lib/payrollee_cz/concepts/insurance_social_concept.rb, line 7 def initialize(tag_code, values) super(PayConceptGateway::REFCON_INSURANCE_SOCIAL, tag_code) init_values(values) end
Public Instance Methods
calc_category()
click to toggle source
# File lib/payrollee_cz/concepts/insurance_social_concept.rb, line 35 def calc_category PayrollConcept::CALC_CATEGORY_NETTO end
compute_result_value(period, employee_base)
click to toggle source
# File lib/payrollee_cz/concepts/insurance_social_concept.rb, line 39 def compute_result_value(period, employee_base) payment_income = 0 if !interest? payment_income = 0 else payment_income = [0,employee_base].max end insurance_contribution(period, payment_income) end
dup_with_value(code, values)
click to toggle source
# File lib/payrollee_cz/concepts/insurance_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/insurance_social_concept.rb, line 50 def evaluate(period, tag_config, results) result_employee_base = employee_income_result(results, TAG_AMOUNT_BASE) payment_value = compute_result_value(period, result_employee_base) result_values = {payment: payment_value} PaymentDeductionResult.new(@tag_code, @code, self, result_values) end
export_xml(xml_builder)
click to toggle source
# File lib/payrollee_cz/concepts/insurance_social_concept.rb, line 88 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/insurance_social_concept.rb, line 12 def init_values(values) @interest_code = values[:interest_code] || 0 end
insurance_contribution(period, income_base)
click to toggle source
# File lib/payrollee_cz/concepts/insurance_social_concept.rb, line 60 def insurance_contribution(period, income_base) payment_value = fix_insurance_round_up( big_multi(income_base, social_insurance_factor(period, false)) ) end
interest?()
click to toggle source
# File lib/payrollee_cz/concepts/insurance_social_concept.rb, line 66 def interest? @interest_code!=0 end
pending_codes()
click to toggle source
# File lib/payrollee_cz/concepts/insurance_social_concept.rb, line 23 def pending_codes [ InsuranceSocialBaseTag.new ] end
summary_codes()
click to toggle source
# File lib/payrollee_cz/concepts/insurance_social_concept.rb, line 29 def summary_codes [ IncomeNettoTag.new ] end