class PayrolleeCz::TaxReliefPayerConcept
Constants
- TAG_ADVANCE
- TAG_CLAIM_DISAB
- TAG_CLAIM_PAYER
- TAG_CLAIM_STUDY
Public Class Methods
new(tag_code, values)
click to toggle source
Calls superclass method
# File lib/payrollee_cz/concepts/tax_relief_payer_concept.rb, line 10 def initialize(tag_code, values) super(PayConceptGateway::REFCON_TAX_RELIEF_PAYER, tag_code) init_values(values) end
Public Instance Methods
calc_category()
click to toggle source
# File lib/payrollee_cz/concepts/tax_relief_payer_concept.rb, line 34 def calc_category PayrollConcept::CALC_CATEGORY_NETTO end
compute_result_value(advance_base, relief_value, claims_value)
click to toggle source
# File lib/payrollee_cz/concepts/tax_relief_payer_concept.rb, line 38 def compute_result_value(advance_base, relief_value, claims_value) relief_amount(advance_base, relief_value, claims_value) end
dup_with_value(code, values)
click to toggle source
# File lib/payrollee_cz/concepts/tax_relief_payer_concept.rb, line 18 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_relief_payer_concept.rb, line 42 def evaluate(period, tag_config, results) tax_advance_value = tax_payment_result(results, TAG_ADVANCE) relief_claim_payer = tax_claim_result(results, TAG_CLAIM_PAYER) relief_claim_disab = tax_claim_result(results, TAG_CLAIM_DISAB) relief_claim_study = tax_claim_result(results, TAG_CLAIM_STUDY) tax_relief_value = 0 tax_claims_value = relief_claim_payer + relief_claim_disab + relief_claim_study relief_value = compute_result_value(tax_advance_value, tax_relief_value, tax_claims_value) result_values = {tax_relief: relief_value} TaxReliefResult.new(@tag_code, @code, self, result_values) end
init_values(values)
click to toggle source
# File lib/payrollee_cz/concepts/tax_relief_payer_concept.rb, line 15 def init_values(values) end
pending_codes()
click to toggle source
# File lib/payrollee_cz/concepts/tax_relief_payer_concept.rb, line 25 def pending_codes [ TaxAdvanceTag.new, TaxClaimPayerTag.new, TaxClaimDisabilityTag.new, TaxClaimStudyingTag.new ] end
relief_amount(tax_advance, tax_relief, tax_claims)
click to toggle source
# File lib/payrollee_cz/concepts/tax_relief_payer_concept.rb, line 58 def relief_amount(tax_advance, tax_relief, tax_claims) tax_after_relief = tax_advance - tax_relief tax_claims - [0, tax_claims - tax_after_relief].max end