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

Updates Michigan Tax Logic #71

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from fiscalsim_us.model_api import *


class mi_additions(Variable):
"""
Line 11 on Michigan 2022 Individual Income Tax return form MI-1040.
These additions to income include the categories that are listed
in Michigan Line 9 of Schedule 1 found in the instructions
"""

value_type = float
entity = TaxUnit
label = "MI additions to income"
unit = USD
definition_period = YEAR
defined_for = StateCode.MI
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from fiscalsim_us.model_api import *


class mi_subtractions(Variable):
"""
Line 13 on Michigan 2022 Individual Income Tax return form MI-1040.
These subtractions to income include the categories that are listed
in Michigan Line 30 of Schedule 1 found in the instructions
"""

value_type = float
entity = TaxUnit
label = "MI subtractions to income"
unit = USD
definition_period = YEAR
defined_for = StateCode.MI
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from fiscalsim_us.model_api import *


class mi_historic_preservation_amount(Variable):
"""
Line 19a on Michigan 2022 Individual Income Tax return form MI-1040.
If you are including Form 3581, enter the amount
from line 9. If you are including Form 5803, enter the amount from line 7.
"""

value_type = float
entity = TaxUnit
label = "MI amount of Historic Preservation Tax Credit"
unit = USD
definition_period = YEAR
defined_for = StateCode.MI
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from fiscalsim_us.model_api import *


class mi_historic_preservation_credit(Variable):
"""
Line 19b on Michigan 2022 Individual Income Tax return form MI-1040.
If you are including Form 3581, enter the amount
from line 14. If you are including Form 5803, enter the amount from line 12.
"""

value_type = float
entity = TaxUnit
label = "MI Credit of Historic Preservation Tax Credit"
unit = USD
definition_period = YEAR
defined_for = StateCode.MI
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from fiscalsim_us.model_api import *


class mi_income_tax(Variable):
"""
Line 20 on Michigan individual income tax form MI-1040
"""

value_type = float
entity = TaxUnit
label = "MI income tax"
unit = USD
definition_period = YEAR
defined_for = StateCode.MI

def formula(tax_unit, period, parameters):
imposed = tax_unit("mi_income_tax_imposed_by_other_gov_credit")
historic = tax_unit("mi_historic_preservation_amount")
tax = tax_unit("mi_income_tax_before_credits")
credit = imposed + historic
return max(0, credit - tax)

Check warning on line 21 in fiscalsim_us/variables/gov/states/mi/tax/income/credits/non_refundable_credits/mi_income_tax.py

View check run for this annotation

Codecov / codecov/patch

fiscalsim_us/variables/gov/states/mi/tax/income/credits/non_refundable_credits/mi_income_tax.py#L17-L21

Added lines #L17 - L21 were not covered by tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
from fiscalsim_us.model_api import *


class mi_income_tax_imposed_by_other_gov_amount(Variable):
"""
Line 18a on Michigan 2022 Individual Income Tax return form MI-1040.
This non-refundable credit includes the amount of income tax paid to:
- A nonreciprocal state
- A local government unit outside Michigan, including tax
paid to local units located in reciprocal states
- The District of Columbia
-A Canadian province.
"""

value_type = float
entity = TaxUnit
label = (
"MI income tax amount imposed by goverment units outside of michigan"
)
unit = USD
definition_period = YEAR
defined_for = StateCode.MI
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from fiscalsim_us.model_api import *


class mi_income_tax_imposed_by_other_gov_credit(Variable):
"""
Line 18b on Michigan 2022 Individual Income Tax return form MI-1040.
"""

value_type = float
entity = TaxUnit
label = (
"MI income tax credit imposed by goverment units outside of michigan"
)
unit = USD
definition_period = YEAR
defined_for = StateCode.MI
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from fiscalsim_us.model_api import *


class mi_total_tax_liability(Variable):
"""
Line 24 on Michigan individual income tax form MI-1040
"""

value_type = float
entity = TaxUnit
label = "MT total tax liability"
unit = USD
definition_period = YEAR
defined_for = StateCode.MI

adds = ["mi_income_tax", "mi_voluntary_contributions", "mi_use_tax"]
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
from fiscalsim_us.model_api import *


class mi_taxable_income(Variable):
class mi_use_tax(Variable):
"""
Line 23 on Michigan individual income tax form MI-1040
"""

value_type = float
entity = TaxUnit
label = "Michigan taxable income"
defined_for = StateCode.MI
label = "MI use tax"
unit = USD
definition_period = YEAR
defined_for = StateCode.MI
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from fiscalsim_us.model_api import *


class mi_voluntary_contributions(Variable):
"""
Line 22 on Michigan individual income tax form MI-1040
"""

value_type = float
entity = TaxUnit
label = "MI volentary contributions"
unit = USD
definition_period = YEAR
defined_for = StateCode.MI
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from fiscalsim_us.model_api import *


class mi_electing_flow_through_credit(Variable):
"""
Line 29 on Michigan individual income tax form MI-1040
"""

value_type = float
entity = TaxUnit
label = "MI allocated share of tax paid by an electing flow-through entity credit"
unit = USD
definition_period = YEAR
defined_for = StateCode.MI
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from fiscalsim_us.model_api import *


class mi_estimated_tax(Variable):
"""
Line 31 on Michigan individual income tax form MI-1040
"""

value_type = float
entity = TaxUnit
label = "MI Estimated Tax, Extension Payments, and Credit Forward"
unit = USD
definition_period = YEAR
defined_for = StateCode.MI
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from fiscalsim_us.model_api import *


class mi_farmland_preservation_tax_credit(Variable):
"""
Line 26 on Michigan individual income tax form MI-1040
"""

value_type = float
entity = TaxUnit
label = "MI Farmland Preservation Tax Credit"
unit = USD
definition_period = YEAR
defined_for = StateCode.MI
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from fiscalsim_us.model_api import *


class mi_historic_preservation_refundable(Variable):
"""
Line 28 on Michigan individual income tax form MI-1040
"""

value_type = float
entity = TaxUnit
label = "MI Historic Preservation Tax Credit Refundable"
unit = USD
definition_period = YEAR
defined_for = StateCode.MI
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from fiscalsim_us.model_api import *


class mi_property_tax_credit(Variable):
"""
Line 25 on Michigan individual income tax form MI-1040
"""

value_type = float
entity = TaxUnit
label = "MI Property Tax Credit"
unit = USD
definition_period = YEAR
defined_for = StateCode.MI
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from fiscalsim_us.model_api import *


class mi_total_refundable_credits(Variable):
"""
Line 33 on Michigan individual income tax form MI-1040
"""

value_type = float
entity = TaxUnit
label = "MT total refundable credits"
unit = USD
definition_period = YEAR
defined_for = StateCode.MI

adds = [
"mi_property_tax_credit",
"mi_farmland_preservation_tax_credit",
"mi_eitc",
"mi_historic_preservation_refundable",
"mi_electing_flow_through_credit",
"mi_withheld",
"mi_estimated_tax",
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from fiscalsim_us.model_api import *


class mi_withheld(Variable):
"""
Line 30 on Michigan individual income tax form MI-1040
"""

value_type = float
entity = TaxUnit
label = "MI tax withheld"
unit = USD
definition_period = YEAR
defined_for = StateCode.MI
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from fiscalsim_us.model_api import *


class mi_income_subject_to_tax(Variable):
"""
Line 14 on Michigan individual income tax form MI-1040
"""

value_type = float
entity = TaxUnit
label = "MI income subject to tax"
unit = USD
definition_period = YEAR
defined_for = StateCode.MI

def formula(tax_unit, period, parameters):
total = tax_unit("mi_total_agi")
subtractions = tax_unit("mi_subtractions")

Check warning on line 18 in fiscalsim_us/variables/gov/states/mi/tax/income/main/mi_income_subject_to_tax.py

View check run for this annotation

Codecov / codecov/patch

fiscalsim_us/variables/gov/states/mi/tax/income/main/mi_income_subject_to_tax.py#L17-L18

Added lines #L17 - L18 were not covered by tests

return max(0, subtractions - total)

Check warning on line 20 in fiscalsim_us/variables/gov/states/mi/tax/income/main/mi_income_subject_to_tax.py

View check run for this annotation

Codecov / codecov/patch

fiscalsim_us/variables/gov/states/mi/tax/income/main/mi_income_subject_to_tax.py#L20

Added line #L20 was not covered by tests
21 changes: 21 additions & 0 deletions fiscalsim_us/variables/gov/states/mi/tax/income/main/mi_tax_due.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from fiscalsim_us.model_api import *


class mi_tax_due(Variable):
"""
Line 34 on Michigan tax form MI-1040
"""

value_type = float
entity = TaxUnit
label = "Michigan Tax Due"
unit = USD
definition_period = YEAR
defined_for = StateCode.MI


def formula(tax_unit, period, parameters):
line33 = tax_unit("mi_total_refundable_credits")
line24 = tax_unit("mi_total_tax_liability")

Check warning on line 19 in fiscalsim_us/variables/gov/states/mi/tax/income/main/mi_tax_due.py

View check run for this annotation

Codecov / codecov/patch

fiscalsim_us/variables/gov/states/mi/tax/income/main/mi_tax_due.py#L18-L19

Added lines #L18 - L19 were not covered by tests

return where(line33 < line24, line33 - line24, 0)

Check warning on line 21 in fiscalsim_us/variables/gov/states/mi/tax/income/main/mi_tax_due.py

View check run for this annotation

Codecov / codecov/patch

fiscalsim_us/variables/gov/states/mi/tax/income/main/mi_tax_due.py#L21

Added line #L21 was not covered by tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
from fiscalsim_us.model_api import *


class mi_tax_overpaid(Variable):
"""
Line 35 on Michigan tax form MI-1040
"""

value_type = float
entity = TaxUnit
label = "Michigan Tax Overpayed"
unit = USD
definition_period = YEAR
defined_for = StateCode.MI


def formula(tax_unit, period, parameters):
line33 = tax_unit("mi_total_refundable_credits")
line24 = tax_unit("mi_total_tax_liability")

Check warning on line 19 in fiscalsim_us/variables/gov/states/mi/tax/income/main/mi_tax_overpaid.py

View check run for this annotation

Codecov / codecov/patch

fiscalsim_us/variables/gov/states/mi/tax/income/main/mi_tax_overpaid.py#L18-L19

Added lines #L18 - L19 were not covered by tests

return where(line33 > line24, line24 - line33, 0)

Check warning on line 21 in fiscalsim_us/variables/gov/states/mi/tax/income/main/mi_tax_overpaid.py

View check run for this annotation

Codecov / codecov/patch

fiscalsim_us/variables/gov/states/mi/tax/income/main/mi_tax_overpaid.py#L21

Added line #L21 was not covered by tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
from fiscalsim_us.model_api import *


class mi_taxable_income(Variable):
value_type = float
entity = TaxUnit
label = "Michigan taxable income"
defined_for = StateCode.MI
unit = USD
definition_period = YEAR

def formula(tax_unit, period, parameters):
income = tax_unit("mi_income_subject_to_tax")
exemption = tax_unit("mi_exemptions")
return max(0, exemption - income)

Check warning on line 15 in fiscalsim_us/variables/gov/states/mi/tax/income/main/mi_taxable_income.py

View check run for this annotation

Codecov / codecov/patch

fiscalsim_us/variables/gov/states/mi/tax/income/main/mi_taxable_income.py#L13-L15

Added lines #L13 - L15 were not covered by tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
from fiscalsim_us.model_api import *


class mi_total_agi(Variable):
"""
Line 12 on Michigan individual income tax form MI-1040
"""

value_type = float
entity = TaxUnit
label = "MT total gross income"
unit = USD
definition_period = YEAR
defined_for = StateCode.MI

adds = ["adjusted_gross_income", "mi_additions"]