Add license information.
[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 protected readonly _lines = {
46 'c': new Input('employer', 'Employer name'),
47 'e': new Input('employee', 'Emplyee name'),
48 '1': new Input('wages', 'Wages, tips, other compensation'),
49 '2': new Input('fedIncomeTax', 'Federal income tax withheld'),
50 '3': new Input('socialSecurityWages', 'Social security wages'),
51 '4': new Input('socialSecuirtyTax', 'Social security tax withheld'),
52 '5': new Input('medicareWages', 'Medicare wages and tips'),
53 '6': new Input('medicareTax', 'Medicare tax withheld'),
54 '7': new Input('socialSecurityTips', 'Social security tips'),
55 '8': new Input('allocatedTips', 'Allocated tips'),
56 '10': new Input('dependentCareBenefits', 'Dependent care benefits'),
57 '11': new Input('nonqualifiedPlans','Nonqualified plans'),
58 '12': new Input('box12', 'Box 12'),
59 '13': new Input('box13', 'Box 13'),
60 '14': new Input('box14', 'Other'),
61 };
62 };