Skip to content

Commit

Permalink
Merge pull request PSLmodels#2781 from martinholmer/fix-cares-charity…
Browse files Browse the repository at this point in the history
…-deduction

Fix CARES charity deduction for nonitemizers
  • Loading branch information
jdebacker authored Jul 26, 2024
2 parents 1d21162 + 51f3cb9 commit b41af53
Show file tree
Hide file tree
Showing 20 changed files with 203 additions and 149 deletions.
2 changes: 1 addition & 1 deletion extend_tcja.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"STD": {"indexed": True, "category": 4},
# category 5 ...
"ID_AllTaxes_c": {"indexed": False, "category": 5},
"ID_Charity_crt_all": {"indexed": False, "category": 5},
"ID_Charity_crt_cash": {"indexed": False, "category": 5},
"ID_Casualty_hc": {"indexed": False, "category": 5},
"ID_Miscellaneous_hc": {"indexed": False, "category": 5},
"ID_ps": {"indexed": True, "category": 5},
Expand Down
33 changes: 20 additions & 13 deletions taxcalc/calcfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ def ItemDedCap(e17500, e18400, e18500, e19200, e19800, e20100, e20400, g20500,
e19800: float
Itemizable charitable giving: cash/check contributions
e20100: float
Itemizable charitalb giving: other than cash/check contributions
Itemizable charitable giving: other than cash/check contributions
e20400: float
Itemizable gross (before 10% AGI disregard) casualty or theft loss
g20500: float
Expand Down Expand Up @@ -887,7 +887,7 @@ def ItemDed(e17500_capped, e18400_capped, e18500_capped, e19200_capped,
c17000, c18300, c19200, c19700, c20500, c20800,
ID_ps, ID_Medical_frt, ID_Medical_frt_add4aged, ID_Medical_hc,
ID_Casualty_frt, ID_Casualty_hc, ID_Miscellaneous_frt,
ID_Miscellaneous_hc, ID_Charity_crt_all, ID_Charity_crt_noncash,
ID_Miscellaneous_hc, ID_Charity_crt_cash, ID_Charity_crt_noncash,
ID_prt, ID_crt, ID_c, ID_StateLocalTax_hc, ID_Charity_frt,
ID_Charity_hc, ID_InterestPaid_hc, ID_RealEstate_hc,
ID_Medical_c, ID_StateLocalTax_c, ID_RealEstate_c,
Expand Down Expand Up @@ -957,8 +957,8 @@ def ItemDed(e17500_capped, e18400_capped, e18500_capped, e19200_capped,
Floor (as decimal fraction of AGI) for deductible miscellaneous expenses
ID_Miscellaneous_hc: float
Miscellaneous expense deduction haircut
ID_Charity_crt_all: float
Ceiling (as decimal fraction of AGI) for all charitable contribution deductions
ID_Charity_crt_cash: float
Ceiling (as decimal fraction of AGI) for cash charitable contribution deductions
ID_Charity_crt_noncash: float
Ceiling (as decimal fraction of AGI) for noncash charitable contribution deductions
ID_prt: float
Expand Down Expand Up @@ -1047,8 +1047,9 @@ def ItemDed(e17500_capped, e18400_capped, e18500_capped, e19200_capped,
c19200 = e19200_capped * (1. - ID_InterestPaid_hc)
c19200 = min(c19200, ID_InterestPaid_c[MARS - 1])
# Charity
lim30 = min(ID_Charity_crt_noncash * posagi, e20100_capped)
c19700 = min(ID_Charity_crt_all * posagi, lim30 + e19800_capped)
charity_ded_cash = min(ID_Charity_crt_cash * posagi, e19800_capped)
charity_ded_noncash = min(ID_Charity_crt_noncash * posagi, e20100_capped)
c19700 = charity_ded_cash + charity_ded_noncash
# charity floor is zero in present law
charity_floor = max(ID_Charity_frt * posagi, ID_Charity_f[MARS - 1])
c19700 = max(0., c19700 - charity_floor) * (1. - ID_Charity_hc)
Expand Down Expand Up @@ -1133,9 +1134,9 @@ def AdditionalMedicareTax(e00200, MARS,

@iterate_jit(nopython=True)
def StdDed(DSI, earned, STD, age_head, age_spouse, STD_Aged, STD_Dep,
MARS, MIDR, blind_head, blind_spouse, standard, c19700,
STD_allow_charity_ded_nonitemizers,
STD_charity_ded_nonitemizers_max):
MARS, MIDR, blind_head, blind_spouse, standard,
STD_allow_charity_ded_nonitemizers, e19800, ID_Charity_crt_cash,
c00100, STD_charity_ded_nonitemizers_max):
"""
Calculates standard deduction, including standard deduction for
dependents, aged and bind.
Expand Down Expand Up @@ -1166,12 +1167,16 @@ def StdDed(DSI, earned, STD, age_head, age_spouse, STD_Aged, STD_Dep,
1 if spouse is blind, 0 otherwise
standard: float
Standard deduction (zero for itemizers)
c19700: float
Schedule A: charity contributions deducted
STD_allow_charity_ded_nonitemizers: bool
Allow standard deduction filers to take the charitable contributions deduction
e19800: float
Schedule A: cash charitable contributions
ID_Charity_crt_cash: float
Fraction of AGI cap on cash charitable deductions
c00100: float
Federal AGI
STD_charity_ded_nonitemizers_max: float
Ceiling amount (in dollars) for charitable deductions for non-itemizers
Ceiling amount (in dollars) for charitable deductions for nonitemizers
Returns
-------
Expand Down Expand Up @@ -1199,8 +1204,10 @@ def StdDed(DSI, earned, STD, age_head, age_spouse, STD_Aged, STD_Dep,
standard = basic_stded + extra_stded
if MARS == 3 and MIDR == 1:
standard = 0.
# calculate CARES cash charity deduction for nonitemizers
if STD_allow_charity_ded_nonitemizers:
standard += min(c19700, STD_charity_ded_nonitemizers_max)
capped_ded = min(e19800, ID_Charity_crt_cash * c00100)
standard += min(capped_ded, STD_charity_ded_nonitemizers_max[MARS - 1])
return standard


Expand Down
107 changes: 75 additions & 32 deletions taxcalc/policy_current_law.json
Original file line number Diff line number Diff line change
Expand Up @@ -2505,7 +2505,7 @@
},
"STD_allow_charity_ded_nonitemizers": {
"title": "Allow standard deduction filers to take the charitable contributions deduction",
"description": "Extends the charitable contributions deduction to taxpayers who take the standard deduction. The same ceilings, floor, and haircuts applied to itemized deduction for charitable contributions also apply here as well as a max on the dollar amount for total charitable deductions for those taking the standard deduction.",
"description": "Extends the charitable contributions deduction to taxpayers who take the standard deduction and make cash donations. The same percent-of-AGI cap applied to itemized deduction for charitable contributions also apply here, as well as a max on the dollar amount for cash charitable deductions for those taking the standard deduction.",
"notes": "",
"section_1": "",
"section_2": "",
Expand All @@ -2517,13 +2517,13 @@
"year": 2013,
"value": false
},
{
"year": 2021,
"value": false
},
{
"year": 2020,
"value": true
},
{
"year": 2022,
"value": false
}
],
"validators": {
Expand All @@ -2538,8 +2538,8 @@
}
},
"STD_charity_ded_nonitemizers_max": {
"title": "Ceiling amount (in dollars) for charitable deductions for non-itemizers",
"description": "Puts a ceiling on the dollar of amount of charitable contributions deductions for taxpayers who take the standard deduction.",
"title": "Ceiling amount (in dollars) for cash charitable deductions for nonitemizers",
"description": "Puts a ceiling on the dollar of amount of cash charitable contributions deductions for taxpayers who take the standard deduction.",
"notes": "",
"section_1": "",
"section_2": "",
Expand All @@ -2549,15 +2549,78 @@
"value": [
{
"year": 2013,
"MARS": "single",
"value": 0.0
},
{
"year": 2021,
"year": 2013,
"MARS": "mjoint",
"value": 0.0
},
{
"year": 2013,
"MARS": "mseparate",
"value": 0.0
},
{
"year": 2013,
"MARS": "headhh",
"value": 0.0
},
{
"year": 2013,
"MARS": "widow",
"value": 0.0
},
{
"year": 2020,
"MARS": "single",
"value": 300.0
},
{
"year": 2020,
"MARS": "mjoint",
"value": 600.0
},
{
"year": 2020,
"MARS": "mseparate",
"value": 300.0
},
{
"year": 2020,
"MARS": "headhh",
"value": 300.0
},
{
"year": 2020,
"MARS": "widow",
"value": 300.0
},
{
"year": 2022,
"MARS": "single",
"value": 0.0
},
{
"year": 2022,
"MARS": "mjoint",
"value": 0.0
},
{
"year": 2022,
"MARS": "mseparate",
"value": 0.0
},
{
"year": 2022,
"MARS": "headhh",
"value": 0.0
},
{
"year": 2022,
"MARS": "widow",
"value": 0.0
}
],
"validators": {
Expand Down Expand Up @@ -5168,9 +5231,9 @@
"cps": true
}
},
"ID_Charity_crt_all": {
"title": "Ceiling (as a decimal fraction of AGI) for all charitable contribution deductions",
"description": "The total deduction for charity is capped at this fraction of AGI.",
"ID_Charity_crt_cash": {
"title": "Ceiling (as a decimal fraction of AGI) for cash charitable contribution deductions",
"description": "The cash deduction for charity is capped at this fraction of AGI.",
"notes": "When using PUF data, raising this parameter value may produce unexpected results because in PUF data the variables e19800 and e20100 are already capped.",
"section_1": "Itemized Deductions",
"section_2": "Charity",
Expand All @@ -5182,36 +5245,16 @@
"year": 2013,
"value": 0.5
},
{
"year": 2014,
"value": 0.5
},
{
"year": 2015,
"value": 0.5
},
{
"year": 2016,
"value": 0.5
},
{
"year": 2017,
"value": 0.5
},
{
"year": 2018,
"value": 0.6
},
{
"year": 2019,
"value": 0.6
},
{
"year": 2020,
"value": 1.0
},
{
"year": 2021,
"year": 2022,
"value": 0.6
},
{
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/reforms/2017_law.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"ALD_DomesticProduction_hc": {"2018": 0},
"ID_prt": {"2018": 0.03},
"ID_crt": {"2018": 0.80},
"ID_Charity_crt_all": {"2018": 0.5},
"ID_Charity_crt_cash": {"2018": 0.5},
"ID_Casualty_hc": {"2018": 0},
"ID_AllTaxes_c": {"2018": [9e99, 9e99, 9e99, 9e99, 9e99]},
"ID_Miscellaneous_hc": {"2018": 0},
Expand Down
11 changes: 7 additions & 4 deletions taxcalc/reforms/CARES.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@
// - Limit charitable deductions for non-itemizers to $300 (3)
// - Provide recovery rebate credits of $1200 per adult and $500 per child (4)
// Reform_Parameter_Map:
// - 1: ID_Charity_crt_all
// - 1: ID_Charity_crt_cash
// - 2: STD_allow_charity_ded_nonitemizers
// - 3: STD_charity_ded_nonitemizers_max
// - 4: RRC_*
{
"ID_Charity_crt_all": {"2020": 1.0, "2021": 0.6},
"STD_allow_charity_ded_nonitemizers": {"2020": true, "2021": false},
"STD_charity_ded_nonitemizers_max": {"2020": 300.0, "2021": 0.0},
"ID_Charity_crt_cash": {"2020": 1.0, "2022": 0.6},
"STD_allow_charity_ded_nonitemizers": {"2020": true, "2022": false},
"STD_charity_ded_nonitemizers_max": {
"2020": [300, 600, 300, 300, 300],
"2022": [ 0, 0, 0, 0, 0]
},
"RRC_ps": {"2020": [75000, 150000, 75000, 112500,150000],
"2021": [75000, 150000, 75000, 112500,150000]},
"RRC_prt": {"2020": 0.05, "2021": 0},
Expand Down
4 changes: 2 additions & 2 deletions taxcalc/reforms/TCJA.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@
"2026": 0.03},
"ID_crt": {"2018": 1.0,
"2026": 0.8},
"ID_Charity_crt_all": {"2018": 0.6,
"2026": 0.5},
"ID_Charity_crt_cash": {"2018": 0.6,
"2026": 0.5},
"ID_Casualty_hc": {"2018": 1,
"2026": 0},
"ID_AllTaxes_c": {"2018": [10000, 10000, 5000, 10000, 10000],
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/reforms/archive/TCJA_Reconciliation.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
"_ID_crt":
{"2018": [1],
"2026": [0.8]},
"_ID_Charity_crt_all":
"_ID_Charity_crt_cash":
{"2018": [0.6],
"2026": [0.5]},
"_ID_Casualty_hc":
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/reforms/archive/TCJA_Senate_111417.json
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@
"_ID_crt":
{"2018": [1],
"2026": [0.8]},
"_ID_Charity_crt_all":
"_ID_Charity_crt_cash":
{"2018": [0.6],
"2026": [0.5]},
"_ID_StateLocalTax_hc":
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/reforms/archive/TCJA_Senate_120117.json
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@
"_ID_crt":
{"2018": [1],
"2026": [0.8]},
"_ID_Charity_crt_all":
"_ID_Charity_crt_cash":
{"2018": [0.6],
"2026": [0.5]},
"_ID_Casualty_hc":
Expand Down
2 changes: 1 addition & 1 deletion taxcalc/reforms/ext.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"AMT_em_pe": {"2026": 939533.04},
"STD": {"2026": [15339.57, 30679.14, 15339.57, 22979.74, 30679.14]},
"ID_AllTaxes_c": {"2026": [10000.0, 10000.0, 5000.0, 10000.0, 10000.0]},
"ID_Charity_crt_all": {"2026": 0.60},
"ID_Charity_crt_cash": {"2026": 0.60},
"ID_Casualty_hc": {"2026": 1.00},
"ID_Miscellaneous_hc": {"2026": 1.00},
"ID_ps": {"2026": [9e+99, 9e+99, 9e+99, 9e+99, 9e+99]},
Expand Down
6 changes: 3 additions & 3 deletions taxcalc/tests/cmpi_cps_expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ ALL 6.179 22.043 -72.0
TABLE for ITAX
AGI category T-C SOI %diff
[-9e+99, 1) -0.020 0.242 -108.0
[1, 5000) -1.630 0.041 -4084.7
[5000, 10000) -7.181 0.368 -2051.4
[1, 5000) -1.630 0.041 -4085.6
[5000, 10000) -7.182 0.368 -2051.5
[10000, 15000) -10.397 1.381 -852.7
[15000, 20000) -8.674 3.524 -346.2
[20000, 25000) -6.331 6.191 -202.3
Expand All @@ -85,7 +85,7 @@ AGI category T-C SOI %diff
[2000000, 5000000) 7.754 101.489 -92.4
[5000000, 10000000) 7.473 56.334 -86.7
[10000000, 9e+99) 49.446 139.611 -64.6
ALL 918.983 1457.891 -37.0
ALL 918.982 1457.891 -37.0
TABLE for SETAX
AGI category T-C SOI %diff
[-9e+99, 1) 0.014 0.656 -97.9
Expand Down
18 changes: 9 additions & 9 deletions taxcalc/tests/cmpi_puf_expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,23 +69,23 @@ AGI category T-C SOI %diff
[-9e+99, 1) 3.729 0.242 +1437.7
[1, 5000) -2.402 0.041 -5973.3
[5000, 10000) -7.413 0.368 -2114.3
[10000, 15000) -22.410 1.381 -1722.4
[10000, 15000) -22.411 1.381 -1722.4
[15000, 20000) -19.575 3.524 -655.5
[20000, 25000) -10.028 6.191 -262.0
[25000, 30000) -3.804 8.753 -143.5
[30000, 40000) 11.438 25.168 -54.6
[40000, 50000) 26.142 32.530 -19.6
[50000, 75000) 97.223 99.792 -2.6
[75000, 100000) 105.121 105.901 -0.7
[75000, 100000) 105.118 105.901 -0.7
[100000, 200000) 329.752 316.350 +4.2
[200000, 500000) 331.839 299.832 +10.7
[500000, 1000000) 172.078 154.389 +11.5
[1000000, 1500000) 75.634 66.324 +14.0
[1500000, 2000000) 44.088 39.672 +11.1
[2000000, 5000000) 114.166 101.489 +12.5
[5000000, 10000000) 64.104 56.334 +13.8
[10000000, 9e+99) 96.819 139.611 -30.7
ALL 1406.499 1457.891 -3.5
[500000, 1000000) 172.070 154.389 +11.5
[1000000, 1500000) 75.630 66.324 +14.0
[1500000, 2000000) 44.087 39.672 +11.1
[2000000, 5000000) 114.164 101.489 +12.5
[5000000, 10000000) 64.082 56.334 +13.8
[10000000, 9e+99) 96.814 139.611 -30.7
ALL 1406.456 1457.891 -3.5
TABLE for SETAX
AGI category T-C SOI %diff
[-9e+99, 1) 0.761 0.656 +16.1
Expand Down
Loading

0 comments on commit b41af53

Please sign in to comment.