Simplify core imports.
[ustaxlib.git] / src / fed2019 / W2.ts
1 import { Form, Person } from '../core';
2 import { Line, InputLine } from '../core/Line';
3
4 export enum Box13 {
5 StatutoryEmployee,
6 RetirementPlan,
7 ThirdPartySickPay
8 };
9
10 export interface CodeAndAmount {
11 code: string;
12 amount: number;
13 };
14
15 export interface W2Input {
16 employer: string;
17 employee: Person;
18 wages?: number;
19 fedIncomeTax?: number;
20 socialSecurityWages?: number;
21 socialSecuirtyTax?: number;
22 medicareWages?: number;
23 medicareTax?: number;
24 socialSecurityTips?: number;
25 allocatedTips?: number;
26 dependentCareBenefits?: number;
27 nonqualifiedPlans?: number;
28 box12?: CodeAndAmount[];
29 box13?: Box13;
30 box14?: CodeAndAmount[];
31 };
32
33 class Input<T extends keyof W2Input> extends InputLine<W2Input, T> {};
34
35 export default class W2 extends Form<W2['_lines'], W2Input> {
36 readonly name = 'W-2';
37
38 readonly supportsMultipleCopies = true;
39
40 protected readonly _lines = {
41 'c': new Input('employer', 'Employer name'),
42 'e': new Input('employee', 'Emplyee name'),
43 '1': new Input('wages', 'Wages, tips, other compensation'),
44 '2': new Input('fedIncomeTax', 'Federal income tax withheld'),
45 '3': new Input('socialSecurityWages', 'Social security wages'),
46 '4': new Input('socialSecuirtyTax', 'Social security tax withheld'),
47 '5': new Input('medicareWages', 'Medicare wages and tips'),
48 '6': new Input('medicareTax', 'Medicare tax withheld'),
49 '7': new Input('socialSecurityTips', 'Social security tips'),
50 '8': new Input('allocatedTips', 'Allocated tips'),
51 '10': new Input('dependentCareBenefits', 'Dependent care benefits'),
52 '11': new Input('nonqualifiedPlans','Nonqualified plans'),
53 '12': new Input('box12', 'Box 12'),
54 '13': new Input('box13', 'Box 13'),
55 '14': new Input('box14', 'Other'),
56 };
57 };