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
6 import { Form, Person } from '../core';
7 import { Line, InputLine } from '../core/Line';
15 export interface CodeAndAmount {
20 export interface W2Input {
24 fedIncomeTax?: number;
25 socialSecurityWages?: number;
26 socialSecuirtyTax?: number;
27 medicareWages?: number;
29 socialSecurityTips?: number;
30 allocatedTips?: number;
31 dependentCareBenefits?: number;
32 nonqualifiedPlans?: number;
33 box12?: CodeAndAmount[];
35 box14?: CodeAndAmount[];
38 class Input<T extends keyof W2Input> extends InputLine<W2Input, T> {};
40 export default class W2 extends Form<W2['_lines'], W2Input> {
41 readonly name = 'W-2';
43 readonly supportsMultipleCopies = true;
46 return this.getInput('employee');
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'),