Module: HrLite::Calculators::Pf

Defined in:
app/services/hr_lite/calculators/pf.rb

Overview

Provident fund on earned basic. Employee 12%; employer 12% split into EPS (8.33%, wage-capped) and EPF (remainder); EDLI + admin charges are employer-cost lines. All contributions round to the nearest rupee.

Defined Under Namespace

Classes: Result

Class Method Summary collapse

Class Method Details

.call(basic_earned:, on_full_basic:, rates:) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'app/services/hr_lite/calculators/pf.rb', line 10

def self.call(basic_earned:, on_full_basic:, rates:)
  basic = Money.d(basic_earned)
  pf_wage = on_full_basic ? basic : [ basic, rates[:wage_ceiling] ].min

  employee = Money.round_rupee(pf_wage * rates[:employee_rate])
  employer_total = Money.round_rupee(pf_wage * rates[:employer_rate])
  eps_wage = [ pf_wage, rates[:eps_wage_ceiling] ].min
  eps = Money.round_rupee(eps_wage * rates[:eps_rate])
  eps = employer_total if eps > employer_total
  edli_wage = [ pf_wage, rates[:edli_ceiling] ].min

  Result.new(
    pf_wage: pf_wage,
    employee: employee,
    employer_eps: eps,
    employer_epf: employer_total - eps,
    edli: Money.round_rupee(edli_wage * rates[:edli_rate]),
    admin_charges: Money.round_rupee(pf_wage * rates[:admin_rate])
  )
end