]> src.bluestatic.org Git - ustaxlib.git/blob - src/fed2019/W2.ts
Implement W2.person().
[ustaxlib.git] / src / fed2019 / W2.ts
1 // Copyright 2020 Blue Static <https://www.bluestatic.org>
2 // This program is free software licensed under the GNU General Public License,
3 // version 3.0. The full text of the license can be found in LICENSE.txt.
4 // SPDX-License-Identifier: GPL-3.0-only
5
6 import { Form, Person } from '../core';
7 import { Line, InputLine } from '../core/Line';
8
9 export enum Box13 {
10 StatutoryEmployee,
11 RetirementPlan,
12 ThirdPartySickPay
13 };
14
15 export interface CodeAndAmount {
16 code: string;
17 amount: number;
18 };
19
20 export interface W2Input {
21 employer: string;
22 employee: Person;
23 wages?: number;
24 fedIncomeTax?: number;
25 socialSecurityWages?: number;
26 socialSecuirtyTax?: number;
27 medicareWages?: number;
28 medicareTax?: number;
29 socialSecurityTips?: number;
30 allocatedTips?: number;
31 dependentCareBenefits?: number;
32 nonqualifiedPlans?: number;
33 box12?: CodeAndAmount[];
34 box13?: Box13;
35 box14?: CodeAndAmount[];
36 };
37
38 class Input<T extends keyof W2Input> extends InputLine<W2Input, T> {};
39
40 export default class W2 extends Form<W2['_lines'], W2Input> {
41 readonly name = 'W-2';
42
43 readonly supportsMultipleCopies = true;
44
45 person(): Person {
46 return this.getInput('employee');
47 }
48
49 protected readonly _lines = {
50 'c': new Input('employer', 'Employer name'),
51 'e': new Input('employee', 'Emplyee name'),
52 '1': new Input('wages', 'Wages, tips, other compensation'),
53 '2': new Input('fedIncomeTax', 'Federal income tax withheld'),
54 '3': new Input('socialSecurityWages', 'Social security wages'),
55 '4': new Input('socialSecuirtyTax', 'Social security tax withheld'),
56 '5': new Input('medicareWages', 'Medicare wages and tips'),
57 '6': new Input('medicareTax', 'Medicare tax withheld'),
58 '7': new Input('socialSecurityTips', 'Social security tips'),
59 '8': new Input('allocatedTips', 'Allocated tips'),
60 '10': new Input('dependentCareBenefits', 'Dependent care benefits'),
61 '11': new Input('nonqualifiedPlans','Nonqualified plans'),
62 '12': new Input('box12', 'Box 12'),
63 '13': new Input('box13', 'Box 13'),
64 '14': new Input('box14', 'Other'),
65 };
66 };