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