From 73abd84ffc879d51b9de1bb9257728a02f553ed6 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 21 Feb 2020 23:12:34 -0500 Subject: [PATCH] Add Form 1099-DIV. --- src/fed2019/Form1040.test.ts | 21 ++++++++++++++ src/fed2019/Form1099DIV.ts | 53 ++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+) create mode 100644 src/fed2019/Form1099DIV.ts diff --git a/src/fed2019/Form1040.test.ts b/src/fed2019/Form1040.test.ts index ef3dde6..bbd533c 100644 --- a/src/fed2019/Form1040.test.ts +++ b/src/fed2019/Form1040.test.ts @@ -2,6 +2,7 @@ import Person from '../Person'; import TaxReturn from '../TaxReturn'; import Form1040, { FilingStatus } from './Form1040'; +import Form1099DIV from './Form1099DIV'; import Form1099INT from './Form1099INT'; import FormW2 from './FormW2'; @@ -39,3 +40,23 @@ test('interest income', () => { expect(f1040.getValue(tr, '2a')).toBe(95); expect(f1040.getValue(tr, '2b')).toBe(103.5); }); + +test('dividend income', () => { + const p = Person.self('A'); + const tr = new TaxReturn(2019); + const f1099div = new Form1099DIV({ + payer: 'Brokerage', + payee: p, + ordinaryDividends: 100, + qualifiedDividends: 75, + totalCapitalGain: 100 + }); + tr.addForm(f1099div); + tr.addForm(f1099div); + + const f1040 = new Form1040(); + tr.addForm(f1040); + + expect(f1040.getValue(tr, '3a')).toBe(75 * 2); + expect(f1040.getValue(tr, '3b')).toBe(200); +}); diff --git a/src/fed2019/Form1099DIV.ts b/src/fed2019/Form1099DIV.ts new file mode 100644 index 0000000..4f575df --- /dev/null +++ b/src/fed2019/Form1099DIV.ts @@ -0,0 +1,53 @@ +import Form from '../Form'; +import { InputLine } from '../Line'; +import Person from '../Person'; + +export interface Form1099DIVInput { + payer: string; + payee: Person; + ordinaryDividends?: number; // Includes qualifiedDividends. + qualifiedDividends?: number; + totalCapitalGain?: number; + unrecaptured1250Gain?: number; + section1202Gain?: number; + collectiblesGain?: number; + nondividendDistributions?: number; + fedIncomeTax?: number; + section199ADividends?: number; + investmentExpenses?: number; + foreignTaxPaid?: number; + foreignCountryOrPosession?: string; + cashLiquidationDistributions?: number; + noncashLiquidationDistributions?: number; + exemptInterestDividends?: number; + privateActivityBondDividends?: number; +}; + +class Input extends InputLine {}; + +export default class Form1099DIV extends Form { + readonly name = '1099-DIV'; + + readonly supportsMultipleCopies = true; + + protected readonly _lines = { + 'payer': new Input('payer'), + 'recipient': new Input('payee'), + '1a': new Input('ordinaryDividends'), + '1b': new Input('qualifiedDividends'), + '2a': new Input('totalCapitalGain'), + '2b': new Input('unrecaptured1250Gain'), + '2c': new Input('section1202Gain'), + '2d': new Input('collectiblesGain'), + '3': new Input('nondividendDistributions'), + '4': new Input('fedIncomeTax'), + '5': new Input('section199ADividends'), + '6': new Input('investmentExpenses'), + '7': new Input('foreignTaxPaid'), + '8': new Input('foreignCountryOrPosession'), + '9': new Input('cashLiquidationDistributions'), + '10': new Input('noncashLiquidationDistributions'), + '11': new Input('exemptInterestDividends'), + '12': new Input('privateActivityBondDividends'), + }; +} -- 2.22.5