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