Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

South Carolina retirement deduction #2927

Merged
merged 33 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
f87cc59
Merge branch 'PolicyEngine:master' into master
hua7450 Aug 10, 2023
3e891c2
South Carolina retirement deduction & military retirement deduction
hua7450 Aug 31, 2023
14f4c1c
Merge branch 'master' of https://github.com/PolicyEngine/policyengine…
hua7450 Aug 31, 2023
05cb8cb
South Carolina retirement deduction & military retirement deduction,m…
hua7450 Sep 4, 2023
536626e
update version
hua7450 Sep 4, 2023
67c5ae4
add sc_retirement_deduction_survivors.py,
hua7450 Sep 7, 2023
9919028
update version
hua7450 Sep 7, 2023
252f684
format
hua7450 Sep 9, 2023
ee0f9e2
update version
hua7450 Sep 9, 2023
bf7c1c6
add sc_military_deduction, fix code
hua7450 Sep 11, 2023
0d30319
minor fix on code
hua7450 Sep 11, 2023
90ad80b
code fixes on python and test files
hua7450 Sep 13, 2023
d143818
update version
hua7450 Sep 13, 2023
15e267e
fix code
hua7450 Sep 13, 2023
cb29ae0
Update changelog_entry.yaml
PavelMakarchuk Sep 18, 2023
f91a93d
add comment about law reference,
hua7450 Sep 18, 2023
670f702
Merge branch 'master' of https://github.com/PolicyEngine/policyengine…
hua7450 Sep 18, 2023
c8acca6
Merge branch 'hua7450/issue2926' of https://github.com/hua7450/policy…
hua7450 Sep 18, 2023
2fcc9fe
minor change
hua7450 Sep 19, 2023
0ab15e4
Merge branch 'master' of https://github.com/PolicyEngine/policyengine…
hua7450 Sep 19, 2023
0f75628
South Carolina retirement deduction & military retirement deduction
hua7450 Sep 20, 2023
e310124
rename folder, add comment in code
hua7450 Oct 11, 2023
a8c9d2b
update verison
hua7450 Oct 11, 2023
3b5c3f3
make format
hua7450 Oct 11, 2023
7f4eef0
update version
hua7450 Nov 5, 2023
f2c8bd5
fix code, unify parameter files into one cap.yaml
hua7450 Nov 7, 2023
1232058
update version
hua7450 Nov 7, 2023
553b046
fix code on __indv.py
hua7450 Nov 7, 2023
1a70d9e
make format
hua7450 Nov 7, 2023
66e2bf3
make the __survivors.py to person level,
hua7450 Nov 7, 2023
53bfc53
add test yaml for cap parameter
hua7450 Nov 7, 2023
e0035e1
fix the parameter problem
hua7450 Nov 8, 2023
e83a274
update version
hua7450 Nov 8, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
hua7450 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
description: South Carolina allows filers above this age to be eligible for the retirement income deduction.
hua7450 marked this conversation as resolved.
Show resolved Hide resolved
metadata:
unit: year
label: South Carolina retirement income deduction age threshold
reference:
- title: South Carolina State SECTION 12-6-1170(B)
href: https://www.scstatehouse.gov/code/t12c006.php
- title: Instructions for Form SC-1040 (line 3p)
href: https://dor.sc.gov/forms-site/Forms/IITPacket_2021.pdf#page=18
values:
2021-01-01: 65
hua7450 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
description: South Carolina allows a retirement deduction that is capped at this amount.
hua7450 marked this conversation as resolved.
Show resolved Hide resolved
metadata:
unit: currency-USD
label: South Carolina capped retirement deduction amount
hua7450 marked this conversation as resolved.
Show resolved Hide resolved
reference:
- title: South Carolina State SECTION 12-6-1170(A)(1)
href: https://www.scstatehouse.gov/code/t12c006.php
- title: Instructions for Form SC-1040 (line 3p)
hua7450 marked this conversation as resolved.
Show resolved Hide resolved
href: https://dor.sc.gov/forms-site/Forms/IITPacket_2021.pdf#page=18
values:
2021-01-01: 10_000
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
description: South Carolina allows a retirement deduction that is capped at this amount.
metadata:
unit: currency-USD
label: South Carolina capped retirement deduction younger amount
reference:
- title: South Carolina State SECTION 12-6-1170(A)(1)
href: https://www.scstatehouse.gov/code/t12c006.php
- title: Instructions for Form SC-1040 (line 3p)
href: https://dor.sc.gov/forms-site/Forms/IITPacket_2021.pdf#page=18
values:
2021-01-01: 3_000
hua7450 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
- name: Case 1, both head and spouse age higher than 65.
period: 2022
input:
people:
person1:
taxable_pension_income: 2_000
military_retirement_pay: 11_000
age: 70
is_tax_unit_head: true
person2:
taxable_pension_income: 1_000
military_retirement_pay: 4_000
age: 66
is_tax_unit_spouse: true
tax_units:
tax_unit:
members: [person1, person2]
households:
household:
members: [person1, person2]
state_code: SC
output:
sc_retirement_deduction: 1_000

- name: Case 2, both head and spouse age less than 65.
period: 2022
input:
people:
person1:
taxable_pension_income: 2_000
military_retirement_pay: 11_000
age: 54
is_tax_unit_head: true
person2:
taxable_pension_income: 1_000
military_retirement_pay: 4_000
age: 50
is_tax_unit_spouse: true
tax_units:
tax_unit:
members: [person1, person2]
households:
household:
members: [person1, person2]
state_code: SC
output:
sc_retirement_deduction: 0

- name: Case 3, head age higher than 65, spouse age less than 65.
period: 2022
input:
people:
person1:
taxable_pension_income: 5_000
military_retirement_pay: 6_000
age: 70
is_tax_unit_head: true
person2:
taxable_pension_income: 1_000
military_retirement_pay: 4_000
age: 50
is_tax_unit_spouse: true
tax_units:
tax_unit:
members: [person1, person2]
households:
household:
members: [person1, person2]
state_code: SC
output:
sc_retirement_deduction: 4_000

hua7450 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from policyengine_us.model_api import *


class sc_military_retirement_income_deduction_survivor(Variable):
hua7450 marked this conversation as resolved.
Show resolved Hide resolved
value_type = float
entity = TaxUnit
label = "South Carolina military retirement income deduction for survivor"
hua7450 marked this conversation as resolved.
Show resolved Hide resolved
defined_for = StateCode.SC
hua7450 marked this conversation as resolved.
Show resolved Hide resolved
unit = USD
definition_period = YEAR
hua7450 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from policyengine_us.model_api import *

class sc_retirement_deduction(Variable):
value_type = float
entity = TaxUnit
label = "South Carolina retirement deduction"
defined_for = StateCode.SC
unit = USD
reference = ("https://www.scstatehouse.gov/code/t12c006.php", #SECTION 12-6-1170(A)(1)
"https://dor.sc.gov/forms-site/Forms/IITPacket_2021.pdf#page=18"
)
definition_period = YEAR

def formula(tax_unit, period, parameters):
p = parameters(period).gov.states.sc.tax.income.subtractions.retirement_deduction
person = tax_unit.members
age = person("age", period)
head = person("is_tax_unit_head", period)
spouse = person("is_tax_unit_spouse", period)
head_or_spouse = head | spouse
# line 1
max_deduction_allowed = where(age >= p.age_threshold, p.older_amount, p.younger_amount)
# line 2
military_retirement_pay = person("military_retirement_pay", period)
# line 3
retirement_deduction_available = max_(max_deduction_allowed - military_retirement_pay,0)
# line 4
retirement_income = person("taxable_pension_income", period)
# line 5
return tax_unit.sum(min_(retirement_deduction_available, retirement_income))