Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Health Savings accounts (Form 8889) #678

Merged
merged 61 commits into from
Jan 9, 2022
Merged

Conversation

ctSkennerton
Copy link
Contributor

@ctSkennerton ctSkennerton commented Oct 23, 2021

This is the beginning of my work to implement health savings accounts. Feedback much appreciated. Fixes #205.

Tasks:

  • Add stub of Form 8889
  • Link in Form 8889 to schedule 1 and schedule 2
  • Add in information from W2 box 12 to UI, which tracks employer contributions. (Help appreciated here. I'm not good with react and don't know how to add in this line - it needs to be a list of box 12 entries)
  • Write in logic to determine the max contribution amount
  • Write HSA UI which needs input on which months each HSA was active for. (Perhaps react-month-picker could be used)
  • wire up the PDF filing as a separate form 8889 needs to be filled out for each spouse (if they are filing jointly and each have one)
  • Write some tests.

What kind of change does this PR introduce?

  • Feature

@zakpatterson
Copy link
Collaborator

This is awesome.

Briefly reviewing the requirements for W-2 box 12, it looks like there are a bunch of possible codes, and it is possible to have more than one code for that box.

@ctSkennerton
Copy link
Contributor Author

Briefly reviewing the requirements for W-2 box 12, it looks like there are a bunch of possible codes, and it is possible to have more than one code for that box.

Yes box 12 can have multiple lines each with a different code and amount. some are just informational but others can be used in different schedules. In some W2 they are actually labeled as 12a, 12b, 12c, 12d but I don't think that is significant, it's just to show that there are multiple items.

Rewrites some of the W2 data model to handle box 12 as a dictionary
instead of an array. A single W2 should only have one value for each
Box 12 code
@zakpatterson
Copy link
Collaborator

zakpatterson commented Oct 24, 2021

I fixed up some compile errors, and implemented UI for Box 12. See here: ctSkennerton#1. Merging this PR on your fork will incorporate those commits directly here.

ctSkennerton and others added 4 commits October 23, 2021 22:41
# Conflicts:
#	src/irsForms/F1040.ts
#	src/irsForms/Schedule2.ts
#	src/tests/components/income/W2JobInfo.test.tsx
@codecov-commenter
Copy link

codecov-commenter commented Oct 24, 2021

Codecov Report

Merging #678 (3f2ffe5) into master (752e48b) will increase coverage by 0.05%.
The diff coverage is 73.08%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #678      +/-   ##
==========================================
+ Coverage   70.59%   70.64%   +0.05%     
==========================================
  Files         195      201       +6     
  Lines        6165     6555     +390     
  Branches     1004     1103      +99     
==========================================
+ Hits         4352     4631     +279     
- Misses       1799     1910     +111     
  Partials       14       14              
Impacted Files Coverage Δ
src/components/GettingStarted.tsx 37.50% <ø> (ø)
src/components/Menu.tsx 93.33% <ø> (ø)
src/components/input/DatePicker.tsx 0.00% <0.00%> (ø)
src/components/input/index.ts 100.00% <ø> (ø)
src/data/urls.ts 100.00% <ø> (ø)
src/forms/Y2020/irsForms/F8853.ts 0.00% <0.00%> (ø)
src/forms/Y2021/irsForms/F8853.ts 0.00% <0.00%> (ø)
src/forms/tests/CommonTests.ts 90.62% <ø> (-1.05%) ⬇️
src/forms/tests/TestKit.ts 34.92% <0.00%> (-1.15%) ⬇️
src/redux/data.ts 100.00% <ø> (ø)
... and 22 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 752e48b...3f2ffe5. Read the comment docs.

@zakpatterson
Copy link
Collaborator

Fixed up merge and tests issues again. I'll work on other issues for a bit, but feel free to call me back if you need anything.

- Add menu items for HSA
- Add in HSA input form
- Add in Date Picker input component using @material-ui/pickers
  so that a user can select their coverage start and end dates
- Add in Redux state actions to add, edit, and remove HSA form entries
@ctSkennerton
Copy link
Contributor Author

@zakpatterson hope I can get your help again...

I'm running into an error when trying to implement the UI for adding HSAs. I've tried to implement a frontend form with a date picker (still a work in progress) but when I go to save a new HSA entry I get the following error:

Unhandled Rejection (TypeError): validate is not a function. (In 'validate(data)', 'validate' is undefined)
checkType
src/redux/validate.ts:9

Googling hasn't given me any insights into what that might be. Have you experienced this error before and know what the cause might be?

src/redux/validate.ts Outdated Show resolved Hide resolved
@ctSkennerton ctSkennerton marked this pull request as ready for review January 2, 2022 08:03
@ctSkennerton ctSkennerton changed the title Start implementation for Health Savings accounts (Form 8889) Health Savings accounts (Form 8889) Jan 2, 2022
zakpatterson and others added 14 commits January 2, 2022 11:06
F8889 review - fix negative values
Due to adding HSA distributions, we can no longer assume that
total tax is less than taxable income. But we can still assume that
the tax on taxable income (L16 tax on L15 income) is less than taxable
income. And we can also assume that total tax must be less than AGI.
# Conflicts:
#	src/components/income/W2JobInfo.tsx
Equal condition needs to match tolerance of form rounding to nearest
dollar
Many schedules can be duplicated
For total income >= 0,

AGI <= total income
Total Tax <= total income

Total income can be negative, that's the only case where tax is
greater than total income.

Total tax can be greater than AGI. Adjustments to income can be
subtracted from taxable income but at the same time cause additional
tax.
@zakpatterson
Copy link
Collaborator

I had total tax must be less than AGI. This is not true, it is possible to have subtractions to total income which are still taxable in other ways. As long as total income is positive, we only know that total income >= AGI and total income >= total tax. Total tax can be more or less than AGI.

@zakpatterson
Copy link
Collaborator

I think this is ready with respect to calculations and tests. @thegrims when you can please review for UI and merge thanks!

@thegrims
Copy link
Collaborator

thegrims commented Jan 8, 2022

The date picker should either load empty or start in the current tax year. I think loading empty would be the best
image

@ctSkennerton
Copy link
Contributor Author

@thegrims sounds good, done.

Comment on lines 196 to 206
// return (
// <form tabIndex={-1} onSubmit={onAdvance}>
// <h2>Health Savings Accounts (HSA)</h2>
// {/* <p>
// did you already make payments towards your {CURRENT_YEAR} taxes this
// year or last year?
// </p> */}
// <FormProvider {...methods}>{form}</FormProvider>
// {navButtons}
// </form>
// )
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commented block of code should be removed if it isn't being used

@thegrims
Copy link
Collaborator

thegrims commented Jan 9, 2022

Looks good, only other comment is on removing the commented line of code quoted above. Thanks for your contribution!

@thegrims thegrims merged commit d37fcf9 into ustaxes:master Jan 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support HSA form 8889
4 participants