Implement Form.person() on fed2019 forms.
[ustaxlib.git] / src / fed2019 / Form1099R.ts
1 import { Form, Person, TaxReturn } from '../core';
2 import { InputLine } from '../core/Line';
3
4 export enum Box7Code {
5 _1 = '1', // Early distribution, no known exception
6 _2 = '2', // Early distribution, exception applies
7 _3 = '3', // Disability
8 _4 = '4', // Death
9 _5 = '5', // Prohibited transaction
10 _6 = '6', // Section 1035 exchange
11 _7 = '7', // Normal distribution
12 _8 = '8', // Excess contributions plus earnings/excess deferrals taxable
13 _9 = '9', // Cost of current life insurance protection
14 A = 'A', // May be eligible for 10-year tax option
15 B = 'B', // Designated Roth account distribution
16 C = 'C', // Reportable death benefits under section 6050Y
17 D = 'D', // Annuity payments from nonqualified annuities that may be subject to tax under section 1411.
18 E = 'E', // Distributions under Employee Plans Compliance Resolution System (EPCRS).
19 F = 'F', // Charitable gift annuity.
20 G = 'G', // Direct rollover of a distribution to a qualified plan, a section 403(b) plan, a governmental section 457(b) plan, or an IRA.
21 H = 'H', // Direct rollover of a designated Roth account distribution to a Roth IRA.
22 J = 'J', // Early distribution from a Roth IRA, no known exception (in most cases, under age 59½).
23 K = 'K', // Distribution of traditional IRA assets not having a readily available FMV.
24 L = 'L', // Loans treated as distributions.
25 M = 'M', // Qualified plan loan offset.
26 N = 'N', // Recharacterized IRA contribution made for 2019 and recharacterized in 2019.
27 P = 'P', // Excess contributions plus earnings/excess deferrals (and/or earnings) taxable in 2018.
28 Q = 'Q', // Qualified distribution from a Roth IRA. R—Recharacterized IRA contribution made for 2018 and recharacterized in 2019.
29 S = 'S', // Early distribution from a SIMPLE IRA in first 2 years, no known exception (under age 59½).
30 T = 'T', // Roth IRA distribution, exception applies.
31 U = 'U', // Dividend distribution from ESOP under section 404(k).
32 W = 'W', // Charges or payments for purchasing qualified long-term care insurance contracts under combined arrangements. If the IRA/SEP/SIMPLE box is checked,you've received a traditional IRA, SEP, or SIMPLE distribution.
33 };
34
35 export interface Form1099RInput {
36 payer: string;
37 payee: Person;
38 grossDistribution: number;
39 taxableAmount: number;
40 taxableAmountNotDetermined: boolean;
41 totalDistribution: boolean;
42 capitalGain?: number;
43 fedIncomeTax?: number;
44 employeeContributionsOrDesignatedRothContributions?: number;
45 distributionCodes?: Box7Code[];
46 iraSepSimple?: boolean;
47 firstYearOfDesignatedRothContributions?: number;
48 };
49
50 class Input<T extends keyof Form1099RInput> extends InputLine<Form1099RInput, T> {};
51
52 export default class Form1099R extends Form<Form1099R['_lines'], Form1099RInput> {
53 readonly name = '1099-R';
54
55 readonly supportsMultipleCopies = true;
56
57 person() { return this.getInput('payee'); }
58
59 protected readonly _lines = {
60 'payer': new Input('payer'),
61 'recipeint': new Input('payee'),
62 '1': new Input('grossDistribution'),
63 '2a': new Input('taxableAmount'),
64 '2b.1': new Input('taxableAmountNotDetermined'),
65 '2b.2': new Input('totalDistribution'),
66 '3': new Input('capitalGain'),
67 '4': new Input('fedIncomeTax'),
68 '5': new Input('employeeContributionsOrDesignatedRothContributions'),
69 '7': new Input('distributionCodes'),
70 '7.1': new Input('iraSepSimple'),
71 '11': new Input('firstYearOfDesignatedRothContributions'),
72 };
73 };