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