singapore_cpf_calculator 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/singapore_cpf_calculator.rb +2 -0
- data/lib/singapore_cpf_calculator/age_group.rb +34 -11
- data/lib/singapore_cpf_calculator/base_calculator.rb +1 -0
- data/lib/singapore_cpf_calculator/requirements.rb +1 -0
- data/lib/singapore_cpf_calculator/requirements/group_55_years_and_below.rb +13 -0
- data/lib/singapore_cpf_calculator/version.rb +1 -1
- data/lib/singapore_cpf_calculator/year_2015.rb +1 -1
- data/lib/singapore_cpf_calculator/year_2016.rb +38 -0
- data/lib/singapore_cpf_calculator/year_2016/base.rb +17 -0
- data/lib/singapore_cpf_calculator/year_2016/citizen_or_spr_3.rb +33 -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/spr_1_fg.rb +35 -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_gg.rb +34 -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_2_fg.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_gg.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/spec/singapore_cpf_calculator/year_2015/citizen_or_spr_3_spec.rb +10 -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_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 +158 -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/spec_helper.rb +3 -3
- metadata +82 -3
@@ -0,0 +1,32 @@
|
|
1
|
+
module SingaporeCPFCalculator
|
2
|
+
module Year2016
|
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.13"
|
14
|
+
end
|
15
|
+
|
16
|
+
def tc_rate_2
|
17
|
+
"0.18"
|
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 Year2016
|
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.09"
|
14
|
+
end
|
15
|
+
|
16
|
+
def tc_rate_2
|
17
|
+
"0.14"
|
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 Year2016
|
3
|
+
module SPR1FG
|
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.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,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 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 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,32 @@
|
|
1
|
+
module SingaporeCPFCalculator
|
2
|
+
module Year2016
|
3
|
+
module SPR1GG
|
4
|
+
|
5
|
+
# Payment calculator for Singapore's Central Provident Fund for employee's age 50 and below.
|
6
|
+
class Age55BelowContributionCalculator < Year2016::Base
|
7
|
+
|
8
|
+
extend Requirements::Group55YearsAndBelow
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def tc_rate_1
|
13
|
+
"0.04"
|
14
|
+
end
|
15
|
+
|
16
|
+
def tc_rate_2
|
17
|
+
"0.09"
|
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,14 @@
|
|
1
|
+
module SingaporeCPFCalculator
|
2
|
+
module Year2016
|
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
|
+
|
8
|
+
extend Requirements::GroupAbove55To60Years
|
9
|
+
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module SingaporeCPFCalculator
|
2
|
+
module Year2016
|
3
|
+
module SPR1GG
|
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.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,14 @@
|
|
1
|
+
module SingaporeCPFCalculator
|
2
|
+
module Year2016
|
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_2_fg/age_55_below_contribution_calculator"
|
2
|
+
require_relative "spr_2_fg/age_55_to_60_contribution_calculator"
|
3
|
+
require_relative "spr_2_fg/age_60_to_65_contribution_calculator"
|
4
|
+
require_relative "spr_2_fg/age_65_up_contribution_calculator"
|
5
|
+
|
6
|
+
module SingaporeCPFCalculator
|
7
|
+
module Year2016
|
8
|
+
|
9
|
+
# For Singapore Permanent Resident (SPR) on their second year with graduated (G, partial)
|
10
|
+
# employee contribution and full (F) employer contribution
|
11
|
+
module SPR2FG
|
12
|
+
|
13
|
+
extend ResidencyModuleCommon
|
14
|
+
extend SPR2FGCommon
|
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,32 @@
|
|
1
|
+
module SingaporeCPFCalculator
|
2
|
+
module Year2016
|
3
|
+
module SPR2FG
|
4
|
+
|
5
|
+
# Payment calculator for Singapore's Central Provident Fund for employee's age 50 and below.
|
6
|
+
class Age55BelowContributionCalculator < Year2016::Base
|
7
|
+
|
8
|
+
extend Requirements::Group55YearsAndBelow
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def tc_rate_1
|
13
|
+
"0.17"
|
14
|
+
end
|
15
|
+
|
16
|
+
def tc_rate_2
|
17
|
+
"0.32"
|
18
|
+
end
|
19
|
+
|
20
|
+
def ec_rate
|
21
|
+
"0.15"
|
22
|
+
end
|
23
|
+
|
24
|
+
def adjustment_rate
|
25
|
+
"0.45"
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
module SingaporeCPFCalculator
|
2
|
+
module Year2016
|
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.13"
|
14
|
+
end
|
15
|
+
|
16
|
+
def tc_rate_2
|
17
|
+
"0.255"
|
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 SPR2FG
|
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.09"
|
14
|
+
end
|
15
|
+
|
16
|
+
def tc_rate_2
|
17
|
+
"0.165"
|
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 SPR2FG
|
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.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,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,32 @@
|
|
1
|
+
module SingaporeCPFCalculator
|
2
|
+
module Year2016
|
3
|
+
module SPR2GG
|
4
|
+
|
5
|
+
# Payment calculator for Singapore's Central Provident Fund for employee's age 50 and below.
|
6
|
+
class Age55BelowContributionCalculator < Year2016::Base
|
7
|
+
|
8
|
+
extend Requirements::Group55YearsAndBelow
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def tc_rate_1
|
13
|
+
"0.09"
|
14
|
+
end
|
15
|
+
|
16
|
+
def tc_rate_2
|
17
|
+
"0.24"
|
18
|
+
end
|
19
|
+
|
20
|
+
def ec_rate
|
21
|
+
"0.15"
|
22
|
+
end
|
23
|
+
|
24
|
+
def adjustment_rate
|
25
|
+
"0.45"
|
26
|
+
end
|
27
|
+
|
28
|
+
end
|
29
|
+
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|