From 488e66c99137ca699b2c5a3c608042903f62ad70 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 21 Feb 2020 14:23:39 -0500 Subject: [PATCH] Add Form 1099-INT. --- src/Line.ts | 2 +- src/fed2019/Form1040.test.ts | 24 ++++++++++++++++++ src/fed2019/Form1040.ts | 2 +- src/fed2019/Form1099INT.ts | 47 ++++++++++++++++++++++++++++++++++++ 4 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 src/fed2019/Form1099INT.ts diff --git a/src/Line.ts b/src/Line.ts index 31c82fa..91f6bbf 100644 --- a/src/Line.ts +++ b/src/Line.ts @@ -58,7 +58,7 @@ export class InputLine extends Line form: Form; constructor(input: T, description?: string) { - super(description); + super(description || `Input from ${input}`); this._input = input; } diff --git a/src/fed2019/Form1040.test.ts b/src/fed2019/Form1040.test.ts index f953311..cfe9b64 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 from './Form1040'; +import Form1099INT from './Form1099INT'; import FormW2 from './FormW2'; test('w2 wages', () => { @@ -15,3 +16,26 @@ test('w2 wages', () => { expect(f1040.getValue(tr, '1')).toBe(136.32); f1040.getValue(tr, '23'); }); + +test('interest income', () => { + const p = Person.self('A'); + const tr = new TaxReturn(2019); + tr.addForm(new Form1099INT({ + payer: 'Bank', + payee: p, + interest: 100, + taxExemptInterest: 0 + })); + tr.addForm(new Form1099INT({ + payer: 'Bank 2', + payee: p, + interest: 3.50, + taxExemptInterest: 95 + })); + + const f1040 = new Form1040(); + tr.addForm(f1040); + + expect(f1040.getValue(tr, '2a')).toBe(95); + expect(f1040.getValue(tr, '2b')).toBe(103.5); +}); diff --git a/src/fed2019/Form1040.ts b/src/fed2019/Form1040.ts index 83bcc4d..3d77496 100644 --- a/src/fed2019/Form1040.ts +++ b/src/fed2019/Form1040.ts @@ -20,7 +20,7 @@ export default class Form1040 extends Form { protected readonly _lines = { '1': new AccumulatorLine('W-2', '1', 'Wages, salaries, tips, etc.'), '2a': new AccumulatorLine('1099-INT', '8', 'Tax-exempt interest'), - '2b': new AccumulatorLine('1009-INT', '1', 'Taxable interest'), + '2b': new AccumulatorLine('1099-INT', '1', 'Taxable interest'), '3a': new AccumulatorLine('1099-DIV', '1b', 'Qualified dividends'), '3b': new AccumulatorLine('1099-DIV', '1a', 'Ordinary dividends'), // 4a and 4b are complex diff --git a/src/fed2019/Form1099INT.ts b/src/fed2019/Form1099INT.ts new file mode 100644 index 0000000..5721cda --- /dev/null +++ b/src/fed2019/Form1099INT.ts @@ -0,0 +1,47 @@ +import Form from '../Form'; +import { InputLine } from '../Line'; +import Person from '../Person'; + +export interface Form1099INTInput { + payer: string; + payee: Person; + interest: number; + earlyWithdrawalPenalty?: number; + interestOnUsSavingsBondOrTreas?: number; + fedIncomeTax?: number; + investmentExpenses?: number; + foreignTaxPaid?: number; + foreignCountryOrPosession?: string; + taxExemptInterest?: number; + privateActivityBondInterest?: number; + marketDiscount?: number; + bondPremium?: number; + bondPremiumOnTreas?: number; + bondPremiumOnTaxExempt?: number; +}; + +class Input extends InputLine {}; + +export default class Form1099INT extends Form { + readonly name = '1099-INT'; + + readonly supportsMultipleCopies = true; + + protected readonly _lines = { + 'payer': new Input('payer'), + 'recipient': new Input('payee'), + '1': new Input('interest'), + '2': new Input('earlyWithdrawalPenalty'), + '3': new Input('interestOnUsSavingsBondOrTreas'), + '4': new Input('fedIncomeTax'), + '5': new Input('investmentExpenses'), + '6': new Input('foreignTaxPaid'), + '7': new Input('foreignCountryOrPosession'), + '8': new Input('taxExemptInterest'), + '9': new Input('privateActivityBondInterest'), + '10': new Input('marketDiscount'), + '11': new Input('bondPremium'), + '12': new Input('bondPremiumOnTreas'), + '13': new Input('bondPremiumOnTaxExempt') + }; +}; -- 2.43.5