Skip to content

Commit

Permalink
South Carolina retirement deduction & military retirement deduction
Browse files Browse the repository at this point in the history
Fixes #2926

Co-authored-by: Pinyan <[email protected]>
  • Loading branch information
hua7450 and pxu12 committed Aug 31, 2023
1 parent f87cc59 commit 3e891c2
Show file tree
Hide file tree
Showing 6 changed files with 146 additions and 0 deletions.
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.
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
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 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: 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
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

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):
value_type = float
entity = TaxUnit
label = "South Carolina military retirement income deduction for survivor"
defined_for = StateCode.SC
unit = USD
definition_period = YEAR
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))

0 comments on commit 3e891c2

Please sign in to comment.