Skip to content

Commit

Permalink
Merge pull request #886 from PolicyEngine/fix/income_tax_improvements…
Browse files Browse the repository at this point in the history
…_new

Improvements to income-related variables
  • Loading branch information
nikhilwoodruff authored Jul 10, 2024
2 parents 102e3bd + 4f45aa6 commit 2542219
Show file tree
Hide file tree
Showing 13 changed files with 891 additions and 141 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: patch
changes:
added:
- Tests to income-related variables
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
description: Pensions programs
values:
0000-01-01:
- private_pension_contributions
- occupational_pension_contributions

metadata:
unit: program
label: Refundable tax credits
period: year
File renamed without changes.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
- name: No capital gains
period: 2024
input:
adjusted_net_income: 0
capital_gains: 0
output:
capital_gains_tax: 0

- name: Capital gains below annual exempt amount
period: 2024
input:
adjusted_net_income: 0
capital_gains: 2_000
output:
capital_gains_tax: 0

- name: Capital gains just above annual exempt amount
period: 2024
input:
adjusted_net_income: 0
capital_gains: 3_500
output:
capital_gains_tax: 50

- name: Basic rate capital gains tax
period: 2024
input:
adjusted_net_income: 20_000
capital_gains: 23_000
output:
capital_gains_tax: 2_230

- name: Higher rate capital gains tax
period: 2024
input:
adjusted_net_income: 50_000
capital_gains: 50_000
output:
capital_gains_tax: 9_400

- name: Additional rate capital gains tax
period: 2024
input:
adjusted_net_income: 150_000
capital_gains: 100_000
output:
capital_gains_tax: 19_400

- name: Mixed rates capital gains tax
period: 2024
input:
adjusted_net_income: 35_000
capital_gains: 40_000
output:
capital_gains_tax: 7_130

- name: High capital gains, low income
period: 2024
input:
adjusted_net_income: 10_000
capital_gains: 200_000
output:
capital_gains_tax: 36_630

- name: Very high capital gains and income
period: 2024
input:
adjusted_net_income: 500_000
capital_gains: 1_000_000
output:
capital_gains_tax: 199_400

- name: Edge case, capital gains exactly equal to annual exempt amount
period: 2024
input:
adjusted_net_income: 0
capital_gains: 3_000
output:
capital_gains_tax: 0
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
- name: Allowances are deducted to zero
period: 2020
absolute_error_margin: 0
input:
employment_income: 10000
pension_income: 10000
allowances: 20000
output:
earned_taxable_income: 0
- name: Earned income is split correctly
period: 2020
absolute_error_margin: 0
input:
earned_taxable_income: 100000
output:
basic_rate_earned_income: 37500
higher_rate_earned_income: 62500
add_rate_earned_income: 0
- name: Earned income is taxed correctly
period: 2020
absolute_error_margin: 0
input:
employment_income: 100000
output:
allowances: 12500
earned_taxable_income: 87500
basic_rate_earned_income_tax: 7500
higher_rate_earned_income_tax: 20000
add_rate_earned_income_tax: 0
earned_income_tax: 27500
tax_band: "HIGHER"
taxed_income: 87500
- name: Savings slice of basic rate band
period: 2020
absolute_error_margin: 0
input:
employment_income: 40000
savings_interest_income: 15000
output:
basic_rate_savings_income_pre_starter: 10000
savings_starter_rate_income: 0
basic_rate_savings_income: 10000
savings_allowance: 500
higher_rate_savings_income: 4500
taxed_savings_income: 14500
- name: Dividends taxed at the marginal rates
period: 2020
absolute_error_margin: 0
input:
dividend_income: 50000
output:
dividend_income_tax: 6225

# taxed_dividend_income
- name: No dividend income
period: 2024
input:
taxable_dividend_income: 0
dividend_allowance: 1000
output:
taxed_dividend_income: 0

- name: Dividend income below allowance
period: 2024
input:
taxable_dividend_income: 500
dividend_allowance: 1000
output:
taxed_dividend_income: 0

- name: Dividend income equal to allowance
period: 2024
input:
taxable_dividend_income: 1000
dividend_allowance: 1000
output:
taxed_dividend_income: 0

- name: Dividend income slightly above allowance
period: 2024
input:
taxable_dividend_income: 1100
dividend_allowance: 1000
output:
taxed_dividend_income: 100

- name: High dividend income
period: 2024
input:
taxable_dividend_income: 50000
dividend_allowance: 2000
output:
taxed_dividend_income: 48000

- name: Very high dividend income
period: 2024
input:
taxable_dividend_income: 1000000
dividend_allowance: 2000
output:
taxed_dividend_income: 998000

- name: Dividend income with zero allowance
period: 2024
input:
taxable_dividend_income: 5000
dividend_allowance: 0
output:
taxed_dividend_income: 5000

- name: Decimal values
period: 2024
input:
taxable_dividend_income: 2500.50
dividend_allowance: 2000.00
output:
taxed_dividend_income: 500.50

- name: Allowance higher than income
period: 2024
input:
taxable_dividend_income: 1000
dividend_allowance: 2000
output:
taxed_dividend_income: 0

- name: Very small positive difference
period: 2024
input:
taxable_dividend_income: 1000.01
dividend_allowance: 1000
output:
taxed_dividend_income: 0.01

Loading

0 comments on commit 2542219

Please sign in to comment.