Skip to content

Commit

Permalink
Flat tax on gross income (#4867)
Browse files Browse the repository at this point in the history
* Flat tax on gross income
Fixes #4830

* add positive gross income and neew param

* remove gross income bool

---------

Co-authored-by: Max Ghenis <mghenis@gmail.com>
  • Loading branch information
PavelMakarchuk and MaxGhenis authored Aug 13, 2024
1 parent d2bc10a commit aa41264
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 3 deletions.
4 changes: 4 additions & 0 deletions changelog_entry.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- bump: minor
changes:
added:
- Flat tax on gross income.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
description: Flat tax rate applied to federal gross income.
values:
2010-01-01: 0
metadata:
label: Flat tax rate on gross income
unit: /1
period: year
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- name: Positive gross income
period: 2022
input:
irs_gross_income: 1_000
output:
positive_gross_income: 1_000

- name: Negative gross income
period: 2022
input:
irs_gross_income: -1_000
output:
positive_gross_income: 0
9 changes: 9 additions & 0 deletions policyengine_us/tests/policy/contrib/ubi_center/flat_tax.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- name: 10% flat tax on AGI and 20% flat tax on gross income
period: 2023
input:
gov.contrib.ubi_center.flat_tax.rate.agi: 0.1
gov.contrib.ubi_center.flat_tax.rate.gross_income: 0.2
positive_agi: 2_000
positive_gross_income: 5_000
output:
flat_tax: 1_200
11 changes: 8 additions & 3 deletions policyengine_us/variables/contrib/ubi_center/flat_tax.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ class flat_tax(Variable):
entity = TaxUnit
label = "Flat tax"
unit = USD
documentation = "Flat income tax on federal AGI."
documentation = "Flat income tax on federal AGI or gross income."
definition_period = YEAR

def formula(tax_unit, period, parameters):
p = parameters(period).gov.contrib.ubi_center.flat_tax.rate
# Gross income flat tax.
gross_income = add(tax_unit, period, ["positive_gross_income"])
gross_income_flat_tax = gross_income * p.gross_income
# AGI flat tax.
agi = tax_unit("positive_agi", period)
p = parameters(period).gov.contrib.ubi_center.flat_tax
return p.rate * agi
agi_flat_tax = agi * p.agi
return gross_income_flat_tax + agi_flat_tax
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from policyengine_us.model_api import *


class positive_gross_income(Variable):
value_type = float
entity = TaxUnit
label = "Positive Gross Income"
unit = USD
documentation = "Negative gross income values capped at zero"
definition_period = YEAR

def formula(tax_unit, period, parameters):
gross_income = add(tax_unit, period, ["irs_gross_income"])
return max_(gross_income, 0)

0 comments on commit aa41264

Please sign in to comment.