class PayrolleeCz::TaxWithholdBaseConcept
Constants
- TAG_AMOUNT_BASE
- TAG_HEALTH_BASE
- TAG_SOCIAL_BASE
Public Class Methods
new(tag_code, values)
click to toggle source
Calls superclass method
# File lib/payrollee_cz/concepts/tax_withhold_base_concept.rb, line 9 def initialize(tag_code, values) super(PayConceptGateway::REFCON_TAX_WITHHOLD_BASE, tag_code) init_values(values) end
Public Instance Methods
calc_category()
click to toggle source
# File lib/payrollee_cz/concepts/tax_withhold_base_concept.rb, line 32 def calc_category PayrollConcept::CALC_CATEGORY_NETTO end
compute_result_value(period, is_tax_interest, is_tax_declared, taxable_health, taxable_social, taxable_base)
click to toggle source
# File lib/payrollee_cz/concepts/tax_withhold_base_concept.rb, line 36 def compute_result_value(period, is_tax_interest, is_tax_declared, taxable_health, taxable_social, taxable_base) if !is_tax_interest taxable_super = 0 else taxable_super = taxable_base+taxable_health+taxable_social end tax_rounded_base(period, is_tax_declared, taxable_base, taxable_super) end
dup_with_value(code, values)
click to toggle source
# File lib/payrollee_cz/concepts/tax_withhold_base_concept.rb, line 17 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_withhold_base_concept.rb, line 45 def evaluate(period, tag_config, results) is_tax_interest = interest_result(results, TAG_AMOUNT_BASE) is_tax_declared = declared_result(results, TAG_AMOUNT_BASE) taxable_health = payment_result(results, TAG_HEALTH_BASE) taxable_social = payment_result(results, TAG_SOCIAL_BASE) taxable_base = income_base_result(results, TAG_AMOUNT_BASE) payment_value = compute_result_value(period, is_tax_interest, is_tax_declared, taxable_health, taxable_social, taxable_base) result_values = {income_base: payment_value} IncomeBaseResult.new(@tag_code, @code, self, result_values) end
init_values(values)
click to toggle source
# File lib/payrollee_cz/concepts/tax_withhold_base_concept.rb, line 14 def init_values(values) end
pending_codes()
click to toggle source
# File lib/payrollee_cz/concepts/tax_withhold_base_concept.rb, line 24 def pending_codes [ TaxIncomeBaseTag.new, TaxEmployersHealthTag.new, TaxEmployersSocialTag.new ] end
tax_rounded_base(period, tax_decl, tax_income, tax_base)
click to toggle source
# File lib/payrollee_cz/concepts/tax_withhold_base_concept.rb, line 61 def tax_rounded_base(period, tax_decl, tax_income, tax_base) if tax_decl 0 else if tax_income > tax_withhold_max(period.year) 0 else withhold_rounded_base(period, tax_decl, tax_base) end end end
tax_withhold_max(year)
click to toggle source
# File lib/payrollee_cz/concepts/tax_withhold_base_concept.rb, line 78 def tax_withhold_max(year) if year>=2004 5000 elsif year>=2001 3000 else 2000 end end
withhold_rounded_base(period, tax_decl, tax_base)
click to toggle source
# File lib/payrollee_cz/concepts/tax_withhold_base_concept.rb, line 73 def withhold_rounded_base(period, tax_decl, tax_base) amount_for_calc = [0, tax_base].max big_tax_round_down(amount_for_calc) end