Skip to content

Commit

Permalink
Merge pull request #2644 from MattHJensen/child_num
Browse files Browse the repository at this point in the history
Update calculation of childnum when CTC_include17
  • Loading branch information
jdebacker authored Mar 14, 2022
2 parents 3d691c3 + 663fc62 commit 36f75f2
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
10 changes: 6 additions & 4 deletions taxcalc/calcfunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -2383,16 +2383,16 @@ def RefundablePayrollTaxCredit(was_plus_sey_p, was_plus_sey_s,


@iterate_jit(nopython=True)
def ChildDepTaxCredit(n24, MARS, c00100, XTOT, num, c05800,
e07260, CR_ResidentialEnergy_hc,
def ChildDepTaxCredit(age_head, age_spouse, nu18, n24, MARS, c00100, XTOT, num,
c05800, e07260, CR_ResidentialEnergy_hc,
e07300, CR_ForeignTax_hc,
c07180,
c07230,
e07240, CR_RetirementSavings_hc,
c07200,
CTC_c, CTC_ps, CTC_prt, exact, ODC_c,
CTC_c_under6_bonus, nu06,
CTC_refundable, CTC_include17, n21, n1820,
CTC_refundable, CTC_include17,
c07220, odc, codtc_limited):
"""
Computes amounts on "Child Tax Credit and Credit for Other Dependents
Expand Down Expand Up @@ -2463,7 +2463,9 @@ def ChildDepTaxCredit(n24, MARS, c00100, XTOT, num, c05800,
"""
# Worksheet Part 1
if CTC_include17:
childnum = n24 + max(0, XTOT - n21 - n1820 - n24 - num)
tu18 = int(age_head < 18) # taxpayer is under age 18
su18 = int(MARS == 2 and age_spouse < 18) # spouse is under age 18
childnum = n24 + max(0, nu18 - tu18 - su18 - n24)
else:
childnum = n24
line1 = CTC_c * childnum + CTC_c_under6_bonus * nu06
Expand Down
12 changes: 6 additions & 6 deletions taxcalc/tests/cpscsv_agg_expect.csv
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ AMT Income ($b),8320.5,10279.2,10758.3,10790.2,11608.1,11932.3,12377.4,12890.2,1
AMT Liability ($b),8.2,0.8,1.0,0.9,1.2,1.1,1.0,1.0,1.0,15.8
AMT Filers (#m),2.6,0.2,0.4,0.4,0.5,0.4,0.4,0.4,0.4,4.4
Tax before Credits ($b),1116.1,1384.7,1461.0,1451.5,1588.4,1643.8,1718.5,1803.3,1894.5,2118.1
Refundable Credits ($b),70.7,102.4,102.4,657.5,824.3,102.7,102.9,102.9,103.7,88.3
Nonrefundable Credits ($b),32.6,97.2,99.2,98.7,4.0,104.2,106.1,108.1,110.0,33.4
Refundable Credits ($b),70.7,102.4,102.4,657.5,833.8,102.7,102.9,102.9,103.7,88.3
Nonrefundable Credits ($b),32.6,97.2,99.2,98.7,2.1,104.2,106.1,108.1,110.0,33.4
Reform Surtaxes ($b),0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
Other Taxes ($b),5.5,11.0,11.1,11.0,11.8,12.3,13.1,13.7,14.5,15.3
Ind Income Tax ($b),1018.2,1196.1,1270.5,706.3,771.9,1449.2,1522.6,1606.0,1695.3,2011.7
Ind Income Tax ($b),1018.2,1196.1,1270.5,706.3,764.2,1449.2,1522.6,1606.0,1695.3,2011.7
Payroll Taxes ($b),1041.0,1141.5,1195.6,1206.9,1261.9,1318.3,1375.2,1436.8,1501.1,1564.4
Combined Liability ($b),2059.2,2337.6,2466.1,1913.2,2033.8,2767.4,2897.7,3042.8,3196.4,3576.1
With Income Tax <= 0 (#m),88.0,96.2,96.7,136.2,130.5,99.0,99.8,100.2,100.7,97.8
With Combined Tax <= 0 (#m),62.7,65.3,66.2,98.6,99.8,69.2,70.2,71.0,71.8,71.1
Combined Liability ($b),2059.2,2337.6,2466.1,1913.2,2026.1,2767.4,2897.7,3042.8,3196.4,3576.1
With Income Tax <= 0 (#m),88.0,96.2,96.7,136.2,130.7,99.0,99.8,100.2,100.7,97.8
With Combined Tax <= 0 (#m),62.7,65.3,66.2,98.6,100.0,69.2,70.2,71.0,71.8,71.1
UBI Benefits ($b),0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
"Total Benefits, Consumption Value ($b)",2790.9,3225.5,3428.6,3617.9,4011.6,4064.2,4306.0,4560.9,4830.4,5105.8
Total Benefits Cost ($b),2790.9,3225.5,3428.6,3617.9,4011.6,4064.2,4306.0,4560.9,4830.4,5105.8
4 changes: 2 additions & 2 deletions taxcalc/tests/puf_var_wght_means_by_year.csv
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ c04600,Post-phase-out personal exemption, 7105, 7131, 7163, 7217,
c04800,Federal regular taxable income, 35754, 39298, 39664, 39592, 42556, 44439, 45949, 44282, 48197, 49000, 50012, 51438, 53007, 54454, 55773, 57172, 58577, 60037, 61691
c05200,Regular tax on taxable income, 7672, 8732, 8725, 8585, 9495, 9967, 10327, 9767, 10808, 11035, 11209, 11509, 11853, 12158, 12427, 12713, 12995, 13286, 13612
c07180,Child care credit, 17, 17, 17, 17, 17, 17, 17, 17, 0, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16
c07220,Child tax credit (adjusted), 158, 155, 147, 143, 139, 133, 129, 124, 303, 119, 115, 111, 108, 104, 100, 97, 94, 91, 88
c07220,Child tax credit (adjusted), 158, 155, 147, 143, 139, 133, 129, 124, 369, 119, 115, 111, 108, 104, 100, 97, 94, 91, 88
c09600,Federal AMT liability, 212, 227, 240, 251, 271, 284, 292, 312, 313, 311, 317, 326, 338, 351, 362, 376, 391, 405, 420
c11070,Extra child tax credit (refunded), 150, 144, 138, 133, 126, 123, 120, 122, 0, 114, 112, 110, 108, 106, 104, 103, 102, 101, 100
c21040,Itemized deduction that is phased out, 203, 242, 231, 219, 255, 270, 278, 258, 290, 295, 299, 306, 315, 323, 329, 335, 341, 346, 350
Expand Down Expand Up @@ -67,7 +67,7 @@ e87530,Adjusted qualified lifetime learning expenses for all students, 93,
eitc,Federal EITC, 376, 369, 364, 352, 342, 341, 344, 353, 341, 347, 348, 350, 352, 356, 361, 366, 372, 379, 385
elderly_dependents,number of dependents age 65+ in filing unit excluding taxpayer and spouse, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
g20500,Itemizable gross (before 10% AGI disregard) casualty or theft loss, 29, 30, 31, 32, 34, 35, 36, 38, 38, 38, 39, 41, 42, 43, 45, 47, 50, 52, 55
iitax,Federal income tax liability, 6550, 7474, 7521, 7477, 8279, 8719, 9042, 5959, 7170, 9701, 9946, 10290, 10664, 10992, 11274, 11567, 11852, 12141, 12463
iitax,Federal income tax liability, 6550, 7474, 7521, 7477, 8279, 8719, 9042, 5959, 7103, 9701, 9946, 10290, 10664, 10992, 11274, 11567, 11852, 12141, 12463
k1bx14p,Partner self-employment earnings/loss for taxpayer (included in e26270 total), -213, -239, -187, -162, -144, -136, -127, -116, -129, -133, -142, -148, -152, -151, -146, -136, -121, -102, -86
k1bx14s,Partner self-employment earnings/loss for spouse (included in e26270 total), -7, -9, 0, 2, 8, 10, 11, 9, 11, 11, 11, 12, 13, 15, 17, 19, 21, 25, 26
nu06,Number of dependents under 6 years old, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Expand Down
12 changes: 6 additions & 6 deletions taxcalc/tests/pufcsv_agg_expect.csv
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ AMT Income ($b),10514.1,11420.4,11944.1,11859.8,12863.0,13213.5,13671.1,14230.8,
AMT Liability ($b),51.8,23.4,24.5,25.9,26.8,27.0,27.6,28.7,30.1,80.3
AMT Filers (#m),5.7,0.6,1.0,1.0,1.0,1.0,1.0,1.1,1.1,7.9
Tax before Credits ($b),1707.8,1731.3,1819.3,1768.0,1956.9,2024.7,2104.9,2205.3,2314.0,2575.8
Refundable Credits ($b),103.0,117.6,118.9,645.2,760.6,122.1,123.1,124.2,126.4,111.7
Nonrefundable Credits ($b),66.9,126.9,128.3,126.0,51.2,132.1,134.9,137.8,140.4,75.4
Refundable Credits ($b),103.0,117.6,118.9,645.2,798.1,122.1,123.1,124.2,126.4,111.7
Nonrefundable Credits ($b),66.9,126.9,128.3,126.0,44.0,132.1,134.9,137.8,140.4,75.4
Reform Surtaxes ($b),0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
Other Taxes ($b),40.0,45.0,48.3,45.5,53.5,54.5,52.6,52.2,52.8,53.7
Ind Income Tax ($b),1577.9,1531.8,1620.4,1042.3,1198.6,1825.0,1899.5,1995.4,2099.9,2442.4
Ind Income Tax ($b),1577.9,1531.8,1620.4,1042.3,1168.3,1825.0,1899.5,1995.4,2099.9,2442.4
Payroll Taxes ($b),1083.8,1133.1,1186.2,1198.2,1250.8,1306.3,1362.3,1422.8,1486.2,1548.8
Combined Liability ($b),2661.7,2664.9,2806.6,2240.5,2449.5,3131.3,3261.8,3418.2,3586.1,3991.2
With Income Tax <= 0 (#m),92.8,98.5,99.2,132.6,126.2,102.3,103.3,104.1,105.1,101.1
With Combined Tax <= 0 (#m),63.3,65.5,66.6,102.7,95.5,69.9,71.0,72.0,73.0,72.6
Combined Liability ($b),2661.7,2664.9,2806.6,2240.5,2419.1,3131.3,3261.8,3418.2,3586.1,3991.2
With Income Tax <= 0 (#m),92.8,98.5,99.2,132.6,127.1,102.3,103.3,104.1,105.1,101.1
With Combined Tax <= 0 (#m),63.3,65.5,66.6,102.7,96.3,69.9,71.0,72.0,73.0,72.6
UBI Benefits ($b),0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0
"Total Benefits, Consumption Value ($b)",1052.3,1104.9,1174.1,1244.8,1494.0,1406.5,1489.3,1579.4,1672.9,1772.0
Total Benefits Cost ($b),1052.3,1104.9,1174.1,1244.8,1494.0,1406.5,1489.3,1579.4,1672.9,1772.0

0 comments on commit 36f75f2

Please sign in to comment.