singapore_cpf_calculator 1.1.1 → 1.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/build.yml +33 -0
- data/Gemfile +1 -0
- data/README.md +17 -5
- data/lib/singapore_cpf_calculator/age_group.rb +60 -15
- data/lib/singapore_cpf_calculator/base_calculator.rb +60 -8
- data/lib/singapore_cpf_calculator/cpf_contribution.rb +14 -3
- data/lib/singapore_cpf_calculator/null_contribution_calculator.rb +4 -2
- data/lib/singapore_cpf_calculator/requirements/group_55_years_and_below.rb +13 -0
- data/lib/singapore_cpf_calculator/requirements/group_above_65_to_70_years.rb +13 -0
- data/lib/singapore_cpf_calculator/requirements/group_above_70_years.rb +13 -0
- data/lib/singapore_cpf_calculator/requirements.rb +4 -0
- data/lib/singapore_cpf_calculator/residency_module_common.rb +5 -1
- data/lib/singapore_cpf_calculator/version.rb +1 -1
- data/lib/singapore_cpf_calculator/year_2012_to_2015_aw_ceiling_module.rb +7 -0
- data/lib/singapore_cpf_calculator/year_2014/base.rb +1 -0
- data/lib/singapore_cpf_calculator/year_2014/citizen_or_spr_3/citzen_or_spr3_base.rb +8 -0
- data/lib/singapore_cpf_calculator/year_2015/base.rb +1 -0
- data/lib/singapore_cpf_calculator/year_2015/citizen_or_spr_3/age_50_below_contribution_calculator.rb +1 -1
- data/lib/singapore_cpf_calculator/year_2015/citizen_or_spr_3/age_50_to_55_contribution_calculator.rb +1 -1
- data/lib/singapore_cpf_calculator/year_2015/citizen_or_spr_3/age_55_to_60_contribution_calculator.rb +1 -1
- data/lib/singapore_cpf_calculator/year_2015/citizen_or_spr_3/age_60_to_65_contribution_calculator.rb +1 -1
- data/lib/singapore_cpf_calculator/year_2015/citizen_or_spr_3/age_65_up_contribution_calculator.rb +1 -1
- data/lib/singapore_cpf_calculator/year_2015/citizen_or_spr_3/citizen_or_spr3_base.rb +9 -0
- data/lib/singapore_cpf_calculator/year_2015/citizen_or_spr_3.rb +1 -0
- data/lib/singapore_cpf_calculator/year_2015.rb +1 -1
- data/lib/singapore_cpf_calculator/year_2016/base.rb +21 -0
- data/lib/singapore_cpf_calculator/year_2016/citizen_or_spr_3/age_55_below_contribution_calculator.rb +32 -0
- data/lib/singapore_cpf_calculator/year_2016/citizen_or_spr_3/age_55_to_60_contribution_calculator.rb +32 -0
- data/lib/singapore_cpf_calculator/year_2016/citizen_or_spr_3/age_60_to_65_contribution_calculator.rb +32 -0
- data/lib/singapore_cpf_calculator/year_2016/citizen_or_spr_3/age_65_up_contribution_calculator.rb +32 -0
- data/lib/singapore_cpf_calculator/year_2016/citizen_or_spr_3/citizen_or_spr3_base.rb +9 -0
- data/lib/singapore_cpf_calculator/year_2016/citizen_or_spr_3.rb +34 -0
- data/lib/singapore_cpf_calculator/year_2016/spr_1_fg/age_55_below_contribution_calculator.rb +32 -0
- data/lib/singapore_cpf_calculator/year_2016/spr_1_fg/age_55_to_60_contribution_calculator.rb +32 -0
- data/lib/singapore_cpf_calculator/year_2016/spr_1_fg/age_60_to_65_contribution_calculator.rb +32 -0
- data/lib/singapore_cpf_calculator/year_2016/spr_1_fg/age_65_up_contribution_calculator.rb +32 -0
- data/lib/singapore_cpf_calculator/year_2016/spr_1_fg.rb +35 -0
- data/lib/singapore_cpf_calculator/year_2016/spr_1_gg/age_55_below_contribution_calculator.rb +32 -0
- data/lib/singapore_cpf_calculator/year_2016/spr_1_gg/age_55_to_60_contribution_calculator.rb +14 -0
- data/lib/singapore_cpf_calculator/year_2016/spr_1_gg/age_60_to_65_contribution_calculator.rb +32 -0
- data/lib/singapore_cpf_calculator/year_2016/spr_1_gg/age_65_up_contribution_calculator.rb +14 -0
- data/lib/singapore_cpf_calculator/year_2016/spr_1_gg.rb +34 -0
- data/lib/singapore_cpf_calculator/year_2016/spr_2_fg/age_55_below_contribution_calculator.rb +32 -0
- data/lib/singapore_cpf_calculator/year_2016/spr_2_fg/age_55_to_60_contribution_calculator.rb +32 -0
- data/lib/singapore_cpf_calculator/year_2016/spr_2_fg/age_60_to_65_contribution_calculator.rb +32 -0
- data/lib/singapore_cpf_calculator/year_2016/spr_2_fg/age_65_up_contribution_calculator.rb +32 -0
- data/lib/singapore_cpf_calculator/year_2016/spr_2_fg.rb +34 -0
- data/lib/singapore_cpf_calculator/year_2016/spr_2_gg/age_55_below_contribution_calculator.rb +32 -0
- data/lib/singapore_cpf_calculator/year_2016/spr_2_gg/age_55_to_60_contribution_calculator.rb +32 -0
- data/lib/singapore_cpf_calculator/year_2016/spr_2_gg/age_60_to_65_contribution_calculator.rb +32 -0
- data/lib/singapore_cpf_calculator/year_2016/spr_2_gg/age_65_up_contribution_calculator.rb +32 -0
- data/lib/singapore_cpf_calculator/year_2016/spr_2_gg.rb +34 -0
- data/lib/singapore_cpf_calculator/year_2016.rb +38 -0
- data/lib/singapore_cpf_calculator/year_2022/citizen_or_spr_3/age_55_below_contribution_calculator.rb +8 -0
- data/lib/singapore_cpf_calculator/year_2022/citizen_or_spr_3/age_55_to_60_contribution_calculator.rb +32 -0
- data/lib/singapore_cpf_calculator/year_2022/citizen_or_spr_3/age_60_to_65_contribution_calculator.rb +32 -0
- data/lib/singapore_cpf_calculator/year_2022/citizen_or_spr_3/age_65_to_70_contribution_calculator.rb +32 -0
- data/lib/singapore_cpf_calculator/year_2022/citizen_or_spr_3/age_70_up_contribution_calculator.rb +32 -0
- data/lib/singapore_cpf_calculator/year_2022/citizen_or_spr_3/citizen_or_spr3_base.rb +9 -0
- data/lib/singapore_cpf_calculator/year_2022/citizen_or_spr_3.rb +40 -0
- data/lib/singapore_cpf_calculator/year_2022/spr_1_fg/age_55_below_contribution_calculator.rb +11 -0
- data/lib/singapore_cpf_calculator/year_2022/spr_1_fg/age_55_to_60_contribution_calculator.rb +32 -0
- data/lib/singapore_cpf_calculator/year_2022/spr_1_fg/age_60_to_65_contribution_calculator.rb +32 -0
- data/lib/singapore_cpf_calculator/year_2022/spr_1_fg/age_65_to_70_contribution_calculator.rb +32 -0
- data/lib/singapore_cpf_calculator/year_2022/spr_1_fg/age_70_up_contribution_calculator.rb +32 -0
- data/lib/singapore_cpf_calculator/year_2022/spr_1_fg.rb +40 -0
- data/lib/singapore_cpf_calculator/year_2022/spr_1_gg/age_55_below_contribution_calculator.rb +11 -0
- data/lib/singapore_cpf_calculator/year_2022/spr_1_gg/age_55_to_60_contribution_calculator.rb +12 -0
- data/lib/singapore_cpf_calculator/year_2022/spr_1_gg/age_60_to_65_contribution_calculator.rb +11 -0
- data/lib/singapore_cpf_calculator/year_2022/spr_1_gg/age_65_up_contribution_calculator.rb +14 -0
- data/lib/singapore_cpf_calculator/year_2022/spr_1_gg.rb +34 -0
- data/lib/singapore_cpf_calculator/year_2022/spr_2_fg/age_55_below_contribution_calculator.rb +11 -0
- data/lib/singapore_cpf_calculator/year_2022/spr_2_fg/age_55_to_60_contribution_calculator.rb +32 -0
- data/lib/singapore_cpf_calculator/year_2022/spr_2_fg/age_60_to_65_contribution_calculator.rb +32 -0
- data/lib/singapore_cpf_calculator/year_2022/spr_2_fg/age_65_to_70_contribution_calculator.rb +32 -0
- data/lib/singapore_cpf_calculator/year_2022/spr_2_fg/age_70_up_contribution_calculator.rb +32 -0
- data/lib/singapore_cpf_calculator/year_2022/spr_2_fg.rb +40 -0
- data/lib/singapore_cpf_calculator/year_2022/spr_2_gg/age_55_below_contribution_calculator.rb +11 -0
- data/lib/singapore_cpf_calculator/year_2022/spr_2_gg/age_55_to_60_contribution_calculator.rb +11 -0
- data/lib/singapore_cpf_calculator/year_2022/spr_2_gg/age_60_to_65_contribution_calculator.rb +11 -0
- data/lib/singapore_cpf_calculator/year_2022/spr_2_gg/age_65_up_contribution_calculator.rb +11 -0
- data/lib/singapore_cpf_calculator/year_2022/spr_2_gg.rb +34 -0
- data/lib/singapore_cpf_calculator/year_2022.rb +35 -0
- data/lib/singapore_cpf_calculator.rb +36 -15
- data/singapore_cpf_calculator.gemspec +3 -4
- data/spec/acceptance/company_a.csv +1367 -1365
- data/spec/acceptance/company_a_spec.rb +6 -4
- data/spec/singapore_cpf_calculator/age_group_spec.rb +15 -3
- data/spec/singapore_cpf_calculator/year_2014/citizen_or_spr_3/age_50_below_contribution_calculator_spec.rb +10 -10
- data/spec/singapore_cpf_calculator/year_2015/citizen_or_spr_3_spec.rb +45 -10
- data/spec/singapore_cpf_calculator/year_2015/spr_1_fg_spec.rb +10 -10
- data/spec/singapore_cpf_calculator/year_2015/spr_1_gg_spec.rb +11 -11
- data/spec/singapore_cpf_calculator/year_2015/spr_2_fg_spec.rb +11 -11
- data/spec/singapore_cpf_calculator/year_2015/spr_2_gg/age_55_to_60_contribution_calculator_spec.rb +8 -8
- data/spec/singapore_cpf_calculator/year_2015/spr_2_gg_spec.rb +11 -11
- data/spec/singapore_cpf_calculator/year_2015_spec.rb +3 -3
- data/spec/singapore_cpf_calculator/year_2016/citizen_or_spr_3/age_55_below_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2016/citizen_or_spr_3/age_55_to_60_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2016/citizen_or_spr_3/age_60_to_65_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2016/citizen_or_spr_3/age_65_up_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2016/citizen_or_spr_3_spec.rb +224 -0
- data/spec/singapore_cpf_calculator/year_2016/spr_1_fg/age_55_below_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2016/spr_1_fg/age_55_to_60_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2016/spr_1_fg/age_60_to_65_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2016/spr_1_fg/age_65_up_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2016/spr_1_fg_spec.rb +158 -0
- data/spec/singapore_cpf_calculator/year_2016/spr_1_gg/age_55_below_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2016/spr_1_gg/age_55_to_60_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2016/spr_1_gg/age_60_to_65_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2016/spr_1_gg/age_65_up_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2016/spr_1_gg_spec.rb +158 -0
- data/spec/singapore_cpf_calculator/year_2016/spr_2_fg/age_55_below_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2016/spr_2_fg/age_55_to_60_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2016/spr_2_fg/age_60_to_65_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2016/spr_2_fg/age_65_up_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2016/spr_2_fg_spec.rb +158 -0
- data/spec/singapore_cpf_calculator/year_2016/spr_2_gg/age_55_below_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2016/spr_2_gg/age_55_to_60_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2016/spr_2_gg/age_60_to_65_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2016/spr_2_gg/age_65_up_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2016/spr_2_gg_spec.rb +158 -0
- data/spec/singapore_cpf_calculator/year_2016_spec.rb +187 -0
- data/spec/singapore_cpf_calculator/year_2022/citizen_or_spr_3/age_55_below_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2022/citizen_or_spr_3/age_55_to_60_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2022/citizen_or_spr_3/age_60_to_65_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2022/citizen_or_spr_3/age_65_to_70_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2022/citizen_or_spr_3/age_70_up_contribution_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2022/citizen_or_spr_3_spec.rb +242 -0
- data/spec/singapore_cpf_calculator/year_2022/spr_1_fg/age_55_below_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2022/spr_1_fg/age_55_to_60_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2022/spr_1_fg/age_60_to_65_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2022/spr_1_fg/age_65_to_70_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2022/spr_1_fg/age_70_up_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2022/spr_1_fg_spec.rb +176 -0
- data/spec/singapore_cpf_calculator/year_2022/spr_1_gg/age_55_below_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2022/spr_1_gg/age_55_to_60_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2022/spr_1_gg/age_60_to_65_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2022/spr_1_gg/age_65_up_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2022/spr_1_gg_spec.rb +158 -0
- data/spec/singapore_cpf_calculator/year_2022/spr_2_fg/age_55_below_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2022/spr_2_fg/age_55_to_60_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2022/spr_2_fg/age_60_to_65_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2022/spr_2_fg/age_65_to_70_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2022/spr_2_fg/age_70_up_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2022/spr_2_fg_spec.rb +176 -0
- data/spec/singapore_cpf_calculator/year_2022/spr_2_gg/age_55_below_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2022/spr_2_gg/age_55_to_60_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2022/spr_2_gg/age_60_to_65_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2022/spr_2_gg/age_65_up_contribution_calculator_spec.rb +63 -0
- data/spec/singapore_cpf_calculator/year_2022/spr_2_gg_spec.rb +158 -0
- data/spec/singapore_cpf_calculator/year_2022_spec.rb +192 -0
- data/spec/singapore_cpf_calculator_spec.rb +87 -2
- data/spec/spec_helper.rb +17 -10
- metadata +183 -23
- data/circle.yml +0 -3
@@ -0,0 +1,32 @@
|
|
1
|
+
module SingaporeCPFCalculator
|
2
|
+
module Year2016
|
3
|
+
module SPR2GG
|
4
|
+
|
5
|
+
# Payment calculator for Singapore's Central Provident Fund for employee's age 55 to 60.
|
6
|
+
class Age55To60ContributionCalculator < Year2016::Base
|
7
|
+
|
8
|
+
extend Requirements::GroupAbove55To60Years
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def tc_rate_1
|
13
|
+
"0.06"
|
14
|
+
end
|
15
|
+
|
16
|
+
def tc_rate_2
|
17
|
+
"0.185"
|
18
|
+
end
|
19
|
+
|
20
|
+
def ec_rate
|
21
|
+
"0.125"
|
22
|
+
end
|
23
|
+
|
24
|
+
def adjustment_rate
|
25
|
+
"0.375"
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module SingaporeCPFCalculator
|
2
|
+
module Year2016
|
3
|
+
module SPR2GG
|
4
|
+
|
5
|
+
# Payment calculator for Singapore's Central Provident Fund for employee's age 60 to 65.
|
6
|
+
class Age60To65ContributionCalculator < Year2016::Base
|
7
|
+
|
8
|
+
extend Requirements::GroupAbove60To65Years
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def tc_rate_1
|
13
|
+
"0.035"
|
14
|
+
end
|
15
|
+
|
16
|
+
def tc_rate_2
|
17
|
+
"0.11"
|
18
|
+
end
|
19
|
+
|
20
|
+
def ec_rate
|
21
|
+
"0.075"
|
22
|
+
end
|
23
|
+
|
24
|
+
def adjustment_rate
|
25
|
+
"0.225"
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module SingaporeCPFCalculator
|
2
|
+
module Year2016
|
3
|
+
module SPR2GG
|
4
|
+
|
5
|
+
# Payment calculator for Singapore's Central Provident Fund for employee's age 65 and above.
|
6
|
+
class Age65UpContributionCalculator < Year2016::Base
|
7
|
+
|
8
|
+
extend Requirements::GroupAbove65Years
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def tc_rate_1
|
13
|
+
"0.035"
|
14
|
+
end
|
15
|
+
|
16
|
+
def tc_rate_2
|
17
|
+
"0.085"
|
18
|
+
end
|
19
|
+
|
20
|
+
def ec_rate
|
21
|
+
"0.05"
|
22
|
+
end
|
23
|
+
|
24
|
+
def adjustment_rate
|
25
|
+
"0.15"
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require_relative "spr_2_gg/age_55_below_contribution_calculator"
|
2
|
+
require_relative "spr_2_gg/age_55_to_60_contribution_calculator"
|
3
|
+
require_relative "spr_2_gg/age_60_to_65_contribution_calculator"
|
4
|
+
require_relative "spr_2_gg/age_65_up_contribution_calculator"
|
5
|
+
|
6
|
+
module SingaporeCPFCalculator
|
7
|
+
module Year2016
|
8
|
+
|
9
|
+
# For Singapore Permanent Resident (SPR) on their first year with graduated (G, partial)
|
10
|
+
# employer contribution and graduated (G, partial) employee contribution
|
11
|
+
module SPR2GG
|
12
|
+
|
13
|
+
extend ResidencyModuleCommon
|
14
|
+
extend SPR2GGCommon
|
15
|
+
|
16
|
+
class << self
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def calculators
|
21
|
+
[
|
22
|
+
Age55BelowContributionCalculator,
|
23
|
+
Age55To60ContributionCalculator,
|
24
|
+
Age60To65ContributionCalculator,
|
25
|
+
Age65UpContributionCalculator,
|
26
|
+
]
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require_relative "year_2016/base"
|
2
|
+
require_relative "year_2016/citizen_or_spr_3"
|
3
|
+
require_relative "year_2016/spr_2_gg"
|
4
|
+
require_relative "year_2016/spr_2_fg"
|
5
|
+
require_relative "year_2016/spr_1_gg"
|
6
|
+
require_relative "year_2016/spr_1_fg"
|
7
|
+
|
8
|
+
module SingaporeCPFCalculator
|
9
|
+
# Contains the calculators that are used for determining CPF contribution for 2014.
|
10
|
+
module Year2016
|
11
|
+
|
12
|
+
class << self
|
13
|
+
|
14
|
+
include YearCommon
|
15
|
+
|
16
|
+
# @param [Date] date when the CPF contribution is to be calculated for.
|
17
|
+
# @return [true, false] true when the date's year is within 2016~2022
|
18
|
+
def applies_to?(date)
|
19
|
+
date.year >= 2016 && date.year < 2022
|
20
|
+
end
|
21
|
+
|
22
|
+
private
|
23
|
+
|
24
|
+
def residency_modules
|
25
|
+
[
|
26
|
+
CitizenOrSPR3,
|
27
|
+
SPR2GG,
|
28
|
+
SPR2FG,
|
29
|
+
SPR1GG,
|
30
|
+
SPR1FG,
|
31
|
+
BeforeSPR,
|
32
|
+
]
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
data/lib/singapore_cpf_calculator/year_2022/citizen_or_spr_3/age_55_to_60_contribution_calculator.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
module SingaporeCPFCalculator
|
2
|
+
module Year2022
|
3
|
+
module CitizenOrSPR3
|
4
|
+
|
5
|
+
# Payment calculator for Singapore's Central Provident Fund for employee's age 55 to 60.
|
6
|
+
class Age55To60ContributionCalculator < CitizenOrSpr3Base
|
7
|
+
|
8
|
+
extend Requirements::GroupAbove55To60Years
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def tc_rate_1
|
13
|
+
"0.14"
|
14
|
+
end
|
15
|
+
|
16
|
+
def tc_rate_2
|
17
|
+
"0.28"
|
18
|
+
end
|
19
|
+
|
20
|
+
def ec_rate
|
21
|
+
"0.14"
|
22
|
+
end
|
23
|
+
|
24
|
+
def adjustment_rate
|
25
|
+
"0.42"
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/lib/singapore_cpf_calculator/year_2022/citizen_or_spr_3/age_60_to_65_contribution_calculator.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
module SingaporeCPFCalculator
|
2
|
+
module Year2022
|
3
|
+
module CitizenOrSPR3
|
4
|
+
|
5
|
+
# Payment calculator for Singapore's Central Provident Fund for employee's age 60 to 65.
|
6
|
+
class Age60To65ContributionCalculator < CitizenOrSpr3Base
|
7
|
+
|
8
|
+
extend Requirements::GroupAbove60To65Years
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def tc_rate_1
|
13
|
+
"0.1"
|
14
|
+
end
|
15
|
+
|
16
|
+
def tc_rate_2
|
17
|
+
"0.185"
|
18
|
+
end
|
19
|
+
|
20
|
+
def ec_rate
|
21
|
+
"0.085"
|
22
|
+
end
|
23
|
+
|
24
|
+
def adjustment_rate
|
25
|
+
"0.255"
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/lib/singapore_cpf_calculator/year_2022/citizen_or_spr_3/age_65_to_70_contribution_calculator.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
module SingaporeCPFCalculator
|
2
|
+
module Year2022
|
3
|
+
module CitizenOrSPR3
|
4
|
+
|
5
|
+
# Payment calculator for Singapore's Central Provident Fund for employee's age 65 and above.
|
6
|
+
class Age65To70ContributionCalculator < CitizenOrSpr3Base
|
7
|
+
|
8
|
+
extend Requirements::GroupAbove65To70Years
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def tc_rate_1
|
13
|
+
"0.08"
|
14
|
+
end
|
15
|
+
|
16
|
+
def tc_rate_2
|
17
|
+
"0.14"
|
18
|
+
end
|
19
|
+
|
20
|
+
def ec_rate
|
21
|
+
"0.06"
|
22
|
+
end
|
23
|
+
|
24
|
+
def adjustment_rate
|
25
|
+
"0.18"
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
data/lib/singapore_cpf_calculator/year_2022/citizen_or_spr_3/age_70_up_contribution_calculator.rb
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
module SingaporeCPFCalculator
|
2
|
+
module Year2022
|
3
|
+
module CitizenOrSPR3
|
4
|
+
|
5
|
+
# Payment calculator for Singapore's Central Provident Fund for employee's age 65 and above.
|
6
|
+
class Age70UpContributionCalculator < CitizenOrSpr3Base
|
7
|
+
|
8
|
+
extend Requirements::GroupAbove70Years
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def tc_rate_1
|
13
|
+
"0.075"
|
14
|
+
end
|
15
|
+
|
16
|
+
def tc_rate_2
|
17
|
+
"0.125"
|
18
|
+
end
|
19
|
+
|
20
|
+
def ec_rate
|
21
|
+
"0.05"
|
22
|
+
end
|
23
|
+
|
24
|
+
def adjustment_rate
|
25
|
+
"0.15"
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require_relative 'citizen_or_spr_3/citizen_or_spr3_base'
|
2
|
+
require_relative "citizen_or_spr_3/age_55_below_contribution_calculator"
|
3
|
+
require_relative "citizen_or_spr_3/age_55_to_60_contribution_calculator"
|
4
|
+
require_relative "citizen_or_spr_3/age_60_to_65_contribution_calculator"
|
5
|
+
require_relative "citizen_or_spr_3/age_65_to_70_contribution_calculator"
|
6
|
+
require_relative "citizen_or_spr_3/age_70_up_contribution_calculator"
|
7
|
+
|
8
|
+
module SingaporeCPFCalculator
|
9
|
+
module Year2022
|
10
|
+
|
11
|
+
# Residency module for Singaporean Citizen and Permanent Residents on their 3rd year.
|
12
|
+
module CitizenOrSPR3
|
13
|
+
|
14
|
+
extend ResidencyModuleCommon
|
15
|
+
extend CitizenOrSPR3Common
|
16
|
+
|
17
|
+
class << self
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def has_70_up
|
22
|
+
true
|
23
|
+
end
|
24
|
+
|
25
|
+
def calculators
|
26
|
+
[
|
27
|
+
Age55BelowContributionCalculator,
|
28
|
+
Age55To60ContributionCalculator,
|
29
|
+
Age60To65ContributionCalculator,
|
30
|
+
Age65To70ContributionCalculator,
|
31
|
+
Age70UpContributionCalculator,
|
32
|
+
]
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module SingaporeCPFCalculator
|
2
|
+
module Year2022
|
3
|
+
module SPR1FG
|
4
|
+
|
5
|
+
# Payment calculator for Singapore's Central Provident Fund for employee's age 50 and below.
|
6
|
+
class Age55BelowContributionCalculator < Year2016::SPR1FG::Age55BelowContributionCalculator
|
7
|
+
end
|
8
|
+
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module SingaporeCPFCalculator
|
2
|
+
module Year2022
|
3
|
+
module SPR1FG
|
4
|
+
|
5
|
+
# Payment calculator for Singapore's Central Provident Fund for employee's age 55 to 60.
|
6
|
+
class Age55To60ContributionCalculator < Year2016::Base
|
7
|
+
|
8
|
+
extend Requirements::GroupAbove55To60Years
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def tc_rate_1
|
13
|
+
"0.14"
|
14
|
+
end
|
15
|
+
|
16
|
+
def tc_rate_2
|
17
|
+
"0.19"
|
18
|
+
end
|
19
|
+
|
20
|
+
def ec_rate
|
21
|
+
"0.05"
|
22
|
+
end
|
23
|
+
|
24
|
+
def adjustment_rate
|
25
|
+
"0.15"
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module SingaporeCPFCalculator
|
2
|
+
module Year2022
|
3
|
+
module SPR1FG
|
4
|
+
|
5
|
+
# Payment calculator for Singapore's Central Provident Fund for employee's age 60 to 65.
|
6
|
+
class Age60To65ContributionCalculator < Year2016::Base
|
7
|
+
|
8
|
+
extend Requirements::GroupAbove60To65Years
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def tc_rate_1
|
13
|
+
"0.1"
|
14
|
+
end
|
15
|
+
|
16
|
+
def tc_rate_2
|
17
|
+
"0.15"
|
18
|
+
end
|
19
|
+
|
20
|
+
def ec_rate
|
21
|
+
"0.05"
|
22
|
+
end
|
23
|
+
|
24
|
+
def adjustment_rate
|
25
|
+
"0.15"
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module SingaporeCPFCalculator
|
2
|
+
module Year2022
|
3
|
+
module SPR1FG
|
4
|
+
|
5
|
+
# Payment calculator for Singapore's Central Provident Fund for employee's age 65 and above.
|
6
|
+
class Age65To70ContributionCalculator < Year2016::Base
|
7
|
+
|
8
|
+
extend Requirements::GroupAbove65To70Years
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def tc_rate_1
|
13
|
+
"0.08"
|
14
|
+
end
|
15
|
+
|
16
|
+
def tc_rate_2
|
17
|
+
"0.13"
|
18
|
+
end
|
19
|
+
|
20
|
+
def ec_rate
|
21
|
+
"0.05"
|
22
|
+
end
|
23
|
+
|
24
|
+
def adjustment_rate
|
25
|
+
"0.15"
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module SingaporeCPFCalculator
|
2
|
+
module Year2022
|
3
|
+
module SPR1FG
|
4
|
+
|
5
|
+
# Payment calculator for Singapore's Central Provident Fund for employee's age 65 and above.
|
6
|
+
class Age70UpContributionCalculator < Year2016::Base
|
7
|
+
|
8
|
+
extend Requirements::GroupAbove70Years
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def tc_rate_1
|
13
|
+
"0.075"
|
14
|
+
end
|
15
|
+
|
16
|
+
def tc_rate_2
|
17
|
+
"0.125"
|
18
|
+
end
|
19
|
+
|
20
|
+
def ec_rate
|
21
|
+
"0.05"
|
22
|
+
end
|
23
|
+
|
24
|
+
def adjustment_rate
|
25
|
+
"0.15"
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
require_relative "spr_1_fg/age_55_below_contribution_calculator"
|
2
|
+
require_relative "spr_1_fg/age_55_to_60_contribution_calculator"
|
3
|
+
require_relative "spr_1_fg/age_60_to_65_contribution_calculator"
|
4
|
+
require_relative "spr_1_fg/age_65_to_70_contribution_calculator"
|
5
|
+
require_relative "spr_1_fg/age_70_up_contribution_calculator"
|
6
|
+
|
7
|
+
module SingaporeCPFCalculator
|
8
|
+
module Year2022
|
9
|
+
|
10
|
+
# For Singapore Permanent Resident (SPR) on their first year with graduated (G, partial)
|
11
|
+
# employer contribution and graduated (G, partial) employee contribution
|
12
|
+
module SPR1FG
|
13
|
+
|
14
|
+
extend ResidencyModuleCommon
|
15
|
+
extend SPR1FGCommon
|
16
|
+
|
17
|
+
class << self
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def has_70_up
|
22
|
+
true
|
23
|
+
end
|
24
|
+
|
25
|
+
def calculators
|
26
|
+
[
|
27
|
+
Age55BelowContributionCalculator,
|
28
|
+
Age55To60ContributionCalculator,
|
29
|
+
Age60To65ContributionCalculator,
|
30
|
+
Age65To70ContributionCalculator,
|
31
|
+
Age70UpContributionCalculator,
|
32
|
+
]
|
33
|
+
end
|
34
|
+
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module SingaporeCPFCalculator
|
2
|
+
module Year2022
|
3
|
+
module SPR1GG
|
4
|
+
|
5
|
+
# Payment calculator for Singapore's Central Provident Fund for employee's age 50 and below.
|
6
|
+
class Age55BelowContributionCalculator < Year2016::SPR1GG::Age55BelowContributionCalculator
|
7
|
+
end
|
8
|
+
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
module SingaporeCPFCalculator
|
2
|
+
module Year2022
|
3
|
+
module SPR1GG
|
4
|
+
|
5
|
+
# Payment calculator for Singapore's Central Provident Fund for employee's age 55 to 60.
|
6
|
+
class Age55To60ContributionCalculator < Age55BelowContributionCalculator
|
7
|
+
extend Requirements::GroupAbove55To60Years
|
8
|
+
end
|
9
|
+
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module SingaporeCPFCalculator
|
2
|
+
module Year2022
|
3
|
+
module SPR1GG
|
4
|
+
|
5
|
+
# Payment calculator for Singapore's Central Provident Fund for employee's age 60 to 65.
|
6
|
+
class Age60To65ContributionCalculator < Year2016::SPR1GG::Age60To65ContributionCalculator
|
7
|
+
end
|
8
|
+
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
module SingaporeCPFCalculator
|
2
|
+
module Year2022
|
3
|
+
module SPR1GG
|
4
|
+
|
5
|
+
# Payment calculator for Singapore's Central Provident Fund for employee's age 65 and above.
|
6
|
+
class Age65UpContributionCalculator < Age60To65ContributionCalculator
|
7
|
+
|
8
|
+
extend Requirements::GroupAbove65Years
|
9
|
+
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
require_relative "spr_1_gg/age_55_below_contribution_calculator"
|
2
|
+
require_relative "spr_1_gg/age_55_to_60_contribution_calculator"
|
3
|
+
require_relative "spr_1_gg/age_60_to_65_contribution_calculator"
|
4
|
+
require_relative "spr_1_gg/age_65_up_contribution_calculator"
|
5
|
+
|
6
|
+
module SingaporeCPFCalculator
|
7
|
+
module Year2022
|
8
|
+
|
9
|
+
# For Singapore Permanent Resident (SPR) on their first year with graduated (G, partial)
|
10
|
+
# employer contribution and graduated (G, partial) employee contribution
|
11
|
+
module SPR1GG
|
12
|
+
|
13
|
+
extend ResidencyModuleCommon
|
14
|
+
extend SPR1GGCommon
|
15
|
+
|
16
|
+
class << self
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def calculators
|
21
|
+
[
|
22
|
+
Age55BelowContributionCalculator,
|
23
|
+
Age55To60ContributionCalculator,
|
24
|
+
Age60To65ContributionCalculator,
|
25
|
+
Age65UpContributionCalculator,
|
26
|
+
]
|
27
|
+
end
|
28
|
+
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
32
|
+
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module SingaporeCPFCalculator
|
2
|
+
module Year2022
|
3
|
+
module SPR2FG
|
4
|
+
|
5
|
+
# Payment calculator for Singapore's Central Provident Fund for employee's age 50 and below.
|
6
|
+
class Age55BelowContributionCalculator < Year2016::SPR2FG::Age55BelowContributionCalculator
|
7
|
+
end
|
8
|
+
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module SingaporeCPFCalculator
|
2
|
+
module Year2022
|
3
|
+
module SPR2FG
|
4
|
+
|
5
|
+
# Payment calculator for Singapore's Central Provident Fund for employee's age 55 to 60.
|
6
|
+
class Age55To60ContributionCalculator < Year2016::Base
|
7
|
+
|
8
|
+
extend Requirements::GroupAbove55To60Years
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def tc_rate_1
|
13
|
+
"0.14"
|
14
|
+
end
|
15
|
+
|
16
|
+
def tc_rate_2
|
17
|
+
"0.265"
|
18
|
+
end
|
19
|
+
|
20
|
+
def ec_rate
|
21
|
+
"0.125"
|
22
|
+
end
|
23
|
+
|
24
|
+
def adjustment_rate
|
25
|
+
"0.375"
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|