Add license information.
[ustaxlib.git] / src / fed2019 / Form1099B.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 GainType {
10 ShortTerm = 'ST',
11 LongTerm = 'LT',
12 Ordinary = 'O',
13 };
14
15 export interface SpecialProceeds {
16 collectibles?: boolean;
17 qof?: boolean;
18 };
19
20 export interface IRSReporting {
21 grossProceeds?: boolean;
22 netProceeds?: boolean;
23 };
24
25 export interface Form1099BInput {
26 payer: string;
27 payee: Person;
28 description: string;
29 dateAcquired?: string;
30 dateSold?: string;
31 proceeds: number;
32 costBasis: number;
33 accruedMarketDiscount?: number;
34 washSaleLossDisallowed?: number;
35 gainType: GainType;
36 specialProceeds?: SpecialProceeds;
37 fedIncomeTax?: number;
38 nonCoveredSecurity?: boolean;
39 irsReporting?: IRSReporting;
40 disallowedLoss?: boolean;
41 profitOnClosedContracts?: number;
42 unrealizedProfitOnOpenContractsCurrentTY?: number;
43 unrealizedProfitOnOpenContractsNextTY?: number;
44 aggregateProfitOnContracts?: number;
45 basisReportedToIRS?: boolean;
46 bartering?: number;
47 };
48
49 class Input<T extends keyof Form1099BInput> extends InputLine<Form1099BInput, T> {};
50
51 export default class Form1099B extends Form<Form1099B['_lines'], Form1099BInput> {
52 readonly name = '1099-B';
53
54 readonly supportsMultipleCopies = true;
55
56 person() { return this.getInput('payee'); }
57
58 protected readonly _lines = {
59 'payer': new Input('payer'),
60 'recipient': new Input('payee'),
61 '1a': new Input('description'),
62 '1b': new Input('dateAcquired'),
63 '1c': new Input('dateSold'),
64 '1d': new Input('proceeds'),
65 '1e': new Input('costBasis'),
66 '1f': new Input('accruedMarketDiscount'),
67 '1g': new Input('washSaleLossDisallowed'),
68 '2': new Input('gainType'),
69 '3': new Input('specialProceeds'),
70 '4': new Input('fedIncomeTax'),
71 '5': new Input('nonCoveredSecurity'),
72 '6': new Input('irsReporting'),
73 '7': new Input('disallowedLoss'),
74 '8': new Input('profitOnClosedContracts'),
75 '9': new Input('unrealizedProfitOnOpenContractsCurrentTY'),
76 '10': new Input('unrealizedProfitOnOpenContractsNextTY'),
77 '11': new Input('aggregateProfitOnContracts'),
78 '12': new Input('basisReportedToIRS'),
79 '13': new Input('bartering')
80 };
81 };