Skip to content

Commit

Permalink
Flat tax on gross income
Browse files Browse the repository at this point in the history
Fixes #4830
  • Loading branch information
PavelMakarchuk committed Aug 13, 2024
1 parent 405aa71 commit d85d180
Show file tree
Hide file tree
Showing 4 changed files with 35 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: The flat tax rate is applied on gross income if this is true.
values:
0000-01-01: false
metadata:
unit: bool
label: Flat tax on gross income
period: year
19 changes: 19 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,19 @@
- name: Flat tax applies on AGI
period: 2023
input:
gov.contrib.ubi_center.flat_tax.flat_tax_on_gross_income: false
gov.contrib.ubi_center.flat_tax.rate: 0.1
positive_agi: 2_000
irs_gross_income: 5_000
output:
flat_tax: 200

- name: Flat tax applies on gross income
period: 2023
input:
gov.contrib.ubi_center.flat_tax.flat_tax_on_gross_income: true
gov.contrib.ubi_center.flat_tax.rate: 0.1
positive_agi: 2_000
irs_gross_income: 5_000
output:
flat_tax: 500
8 changes: 5 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,12 @@ 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):
agi = tax_unit("positive_agi", period)
income = tax_unit("positive_agi", period)
p = parameters(period).gov.contrib.ubi_center.flat_tax
return p.rate * agi
if p.flat_tax_on_gross_income:
income = add(tax_unit, period, ["irs_gross_income"])
return p.rate * income

0 comments on commit d85d180

Please sign in to comment.