take_home 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/fy2020.rb +32 -4
- data/lib/take_home.rb +22 -22
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 128ab59dc8bfa47dccb9c0748878775e47c99ab2fa0fb4e857e45f3b2591c8a9
|
4
|
+
data.tar.gz: 127bf4bb406629a7049eb7b6e934d10b55648a9cc5b9decacf1a59b218748cd7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4be98428a21d300ffe94fdd9814c1bdcf67ec880f20c820afbed681519ddc158d70672aa911a7ace3c3e1e8342310d70dfed74c7fb88745575ffaf6f7125ba21
|
7
|
+
data.tar.gz: 23529cac0d9e6918266b8bb077067bcd28b79c27530c8c4ff16e3b7775194740ff8a28e9bd9d22c8ad77ce31c208ee8d9ae79de7536b2ccb037a78dcbd29ba95
|
data/lib/fy2020.rb
CHANGED
@@ -1,12 +1,24 @@
|
|
1
1
|
module TaxConstants
|
2
2
|
module FY2020
|
3
|
-
|
4
|
-
SOCIAL_SECURITY_TAX_RATE = 0.062
|
5
|
-
MEDICARE_TAX_RATE = 0.0145
|
6
|
-
|
3
|
+
NO_DEDUCTION = 0
|
7
4
|
FEDERAL_SINGLE_STD_DEDUCTION = 12_200
|
8
5
|
FEDERAL_MARRIED_STD_DEDUCTION = 24_400
|
9
6
|
|
7
|
+
SOCIAL_SECURITY_TAX_RATES = {
|
8
|
+
137_700 => 0.062,
|
9
|
+
Float::INFINITY => 0.0,
|
10
|
+
}
|
11
|
+
|
12
|
+
MEDICARE_SINGLE_TAX_RATES = {
|
13
|
+
200_000 => 0.0145,
|
14
|
+
Float::INFINITY => 0.0235,
|
15
|
+
}
|
16
|
+
|
17
|
+
MEDICARE_MARRIED_TAX_RATES = {
|
18
|
+
250_000 => 0.0145,
|
19
|
+
Float::INFINITY => 0.0235,
|
20
|
+
}
|
21
|
+
|
10
22
|
FEDERAL_SINGLE_INCOME_TAX_RATES = {
|
11
23
|
9700 => 0.10,
|
12
24
|
39_475 => 0.12,
|
@@ -54,6 +66,14 @@ module TaxConstants
|
|
54
66
|
deduction: FEDERAL_SINGLE_STD_DEDUCTION,
|
55
67
|
rates: FEDERAL_SINGLE_INCOME_TAX_RATES,
|
56
68
|
},
|
69
|
+
social_security: {
|
70
|
+
deduction: NO_DEDUCTION,
|
71
|
+
rates: SOCIAL_SECURITY_TAX_RATES,
|
72
|
+
},
|
73
|
+
medicare: {
|
74
|
+
deduction: NO_DEDUCTION,
|
75
|
+
rates: MEDICARE_SINGLE_TAX_RATES,
|
76
|
+
},
|
57
77
|
georgia: {
|
58
78
|
deduction: GEORGIA_SINGLE_STD_DEDUCTION,
|
59
79
|
rates: GEORGIA_SINGLE_INCOME_TAX_RATES,
|
@@ -64,6 +84,14 @@ module TaxConstants
|
|
64
84
|
deduction: FEDERAL_MARRIED_STD_DEDUCTION,
|
65
85
|
rates: FEDERAL_MARRIED_INCOME_TAX_RATES,
|
66
86
|
},
|
87
|
+
social_security: {
|
88
|
+
deduction: NO_DEDUCTION,
|
89
|
+
rates: SOCIAL_SECURITY_TAX_RATES,
|
90
|
+
},
|
91
|
+
medicare: {
|
92
|
+
deduction: NO_DEDUCTION,
|
93
|
+
rates: MEDICARE_MARRIED_TAX_RATES,
|
94
|
+
},
|
67
95
|
georgia: {
|
68
96
|
deduction: GEORGIA_MARRIED_STD_DEDUCTION,
|
69
97
|
rates: GEORGIA_MARRIED_INCOME_TAX_RATES,
|
data/lib/take_home.rb
CHANGED
@@ -18,11 +18,11 @@ class TaxablePerson
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def federal_income_taxes
|
21
|
-
marginal_taxes(income,
|
21
|
+
marginal_taxes(income, federal_deduction, federal_tax_rates)
|
22
22
|
end
|
23
23
|
|
24
24
|
def state_income_taxes
|
25
|
-
marginal_taxes(income,
|
25
|
+
marginal_taxes(income, state_deduction, state_tax_rates)
|
26
26
|
end
|
27
27
|
|
28
28
|
def payroll_taxes
|
@@ -30,15 +30,11 @@ class TaxablePerson
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def social_security_taxes
|
33
|
-
|
34
|
-
taxes = income * social_security_tax_rate
|
35
|
-
else
|
36
|
-
taxes = social_security_wage_base * social_security_tax_rate
|
37
|
-
end
|
33
|
+
marginal_taxes(income, social_security_deduction, social_security_tax_rates)
|
38
34
|
end
|
39
35
|
|
40
36
|
def medicare_taxes
|
41
|
-
|
37
|
+
marginal_taxes(income, medicare_deduction, medicare_tax_rates)
|
42
38
|
end
|
43
39
|
|
44
40
|
def effective_tax_rate
|
@@ -56,20 +52,24 @@ class TaxablePerson
|
|
56
52
|
attr_accessor :income
|
57
53
|
attr_accessor :state_tax_rates
|
58
54
|
attr_accessor :federal_tax_rates
|
59
|
-
attr_accessor :
|
60
|
-
attr_accessor :
|
61
|
-
attr_accessor :
|
62
|
-
attr_accessor :
|
63
|
-
attr_accessor :
|
55
|
+
attr_accessor :medicare_tax_rates
|
56
|
+
attr_accessor :social_security_tax_rates
|
57
|
+
attr_accessor :federal_deduction
|
58
|
+
attr_accessor :state_deduction
|
59
|
+
attr_accessor :social_security_deduction
|
60
|
+
attr_accessor :medicare_deduction
|
64
61
|
|
65
62
|
def configure(opts)
|
66
|
-
|
67
|
-
self.state_tax_rates = opts[:state_tax_rates] ||
|
68
|
-
self.
|
69
|
-
self.
|
70
|
-
self.
|
71
|
-
|
72
|
-
self.
|
63
|
+
constants = TaxConstants::FY2020::LOOKUP[tax_type]
|
64
|
+
self.state_tax_rates = opts[:state_tax_rates] || constants[state][:rates]
|
65
|
+
self.federal_tax_rates = opts[:federal_tax_rates] || constants[:federal][:rates]
|
66
|
+
self.social_security_tax_rates = opts[:social_security_tax_rate] || constants[:social_security][:rates]
|
67
|
+
self.medicare_tax_rates = opts[:medicare_tax_rate] || constants[:medicare][:rates]
|
68
|
+
|
69
|
+
self.federal_deduction = opts[:federal_deduction] || constants[:federal][:deduction]
|
70
|
+
self.state_deduction = opts[:state_deduction] || constants[state][:deduction]
|
71
|
+
self.social_security_deduction = opts[:social_security_deduction] || constants[:social_security][:deduction]
|
72
|
+
self.medicare_deduction = opts[:medicare_deduction] || constants[:medicare][:deduction]
|
73
73
|
nil
|
74
74
|
end
|
75
75
|
|
@@ -80,9 +80,9 @@ class TaxablePerson
|
|
80
80
|
configure(opts)
|
81
81
|
end
|
82
82
|
|
83
|
-
def marginal_taxes(income,
|
83
|
+
def marginal_taxes(income, deduction, rates)
|
84
84
|
#Calculate AGI
|
85
|
-
income = income -
|
85
|
+
income = income - deduction
|
86
86
|
#Calculate Income Taxes
|
87
87
|
taxes = 0
|
88
88
|
last_cap = 0
|