From 694263cadf9e430912a28f3e6353f0ef14791243 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Fri, 13 Mar 2020 00:43:28 -0400 Subject: [PATCH] Implement Form.person() on fed2019 forms. --- src/fed2019/Form1040.test.ts | 7 +++++++ src/fed2019/Form1099B.ts | 2 ++ src/fed2019/Form1099DIV.ts | 2 ++ src/fed2019/Form1099INT.ts | 2 ++ src/fed2019/Form1099R.ts | 2 ++ src/fed2019/Form1116.test.ts | 1 + src/fed2019/Form8606.test.ts | 2 ++ src/fed2019/Form8606.ts | 2 ++ src/fed2019/Form8949.test.ts | 3 +++ src/fed2019/Form8960.test.ts | 2 ++ src/fed2019/Schedule3.test.ts | 2 ++ 11 files changed, 27 insertions(+) diff --git a/src/fed2019/Form1040.test.ts b/src/fed2019/Form1040.test.ts index 12f1ba9..c498cc4 100644 --- a/src/fed2019/Form1040.test.ts +++ b/src/fed2019/Form1040.test.ts @@ -18,6 +18,8 @@ test('w2 wages', () => { const pa = Person.self('A'); const pb = Person.spouse('B'); const tr = new TaxReturn(); + tr.addPerson(pa); + tr.addPerson(pb); tr.addForm(new W2({ employer: 'AA', employee: pa, @@ -42,6 +44,7 @@ test('w2 wages', () => { test('interest income', () => { const p = Person.self('A'); const tr = new TaxReturn(); + tr.addPerson(p); tr.addForm(new Form1099INT({ payer: 'Bank', payee: p, @@ -65,6 +68,7 @@ test('interest income', () => { test('dividend income', () => { const p = Person.self('A'); const tr = new TaxReturn(); + tr.addPerson(p); const f1099div = new Form1099DIV({ payer: 'Brokerage', payee: p, @@ -85,6 +89,7 @@ test('dividend income', () => { test('capital gain/loss', () => { const p = Person.self('A'); const tr = new TaxReturn(); + tr.addPerson(p); tr.addForm(new Form1040({ filingStatus: FilingStatus.Single })); tr.addForm(new W2({ employer: 'Money', @@ -110,6 +115,7 @@ test('capital gain/loss', () => { test('require Form8959', () => { const p = Person.self('A'); const tr = new TaxReturn(); + tr.addPerson(p); tr.addForm(new W2({ employer: 'Company', employee: p, @@ -130,6 +136,7 @@ test('require Form8959', () => { test('backdoor and megabackdoor roth', () => { const p = Person.self('A'); const tr = new TaxReturn(); + tr.addPerson(p); tr.addForm(new Form1099R({ payer: 'Roth', payee: p, diff --git a/src/fed2019/Form1099B.ts b/src/fed2019/Form1099B.ts index dbd8de2..ebe1ebe 100644 --- a/src/fed2019/Form1099B.ts +++ b/src/fed2019/Form1099B.ts @@ -48,6 +48,8 @@ export default class Form1099B extends Form readonly supportsMultipleCopies = true; + person() { return this.getInput('payee'); } + protected readonly _lines = { 'payer': new Input('payer'), 'recipient': new Input('payee'), diff --git a/src/fed2019/Form1099DIV.ts b/src/fed2019/Form1099DIV.ts index fbbfe6b..ff1a636 100644 --- a/src/fed2019/Form1099DIV.ts +++ b/src/fed2019/Form1099DIV.ts @@ -29,6 +29,8 @@ export default class Form1099DIV extends Form readonly supportsMultipleCopies = true; + person() { return this.getInput('payee'); } + protected readonly _lines = { 'payer': new Input('payer'), 'recipeint': new Input('payee'), diff --git a/src/fed2019/Form1116.test.ts b/src/fed2019/Form1116.test.ts index add04cc..27c69ba 100644 --- a/src/fed2019/Form1116.test.ts +++ b/src/fed2019/Form1116.test.ts @@ -86,6 +86,7 @@ test('foreign tax credit', () => { test('no net capital losses in total income', () => { const p = Person.self('A'); const tr = new TaxReturn(); + tr.addPerson(p); tr.addForm(new Form1040({ filingStatus: FilingStatus.MarriedFilingJoint })); diff --git a/src/fed2019/Form8606.test.ts b/src/fed2019/Form8606.test.ts index 643c8e4..32e19a7 100644 --- a/src/fed2019/Form8606.test.ts +++ b/src/fed2019/Form8606.test.ts @@ -7,6 +7,7 @@ import TaxReturn from './TaxReturn'; test('skip part 1', () => { const p = Person.self('A'); const tr = new TaxReturn(); + tr.addPerson(p); const f = new Form8606({ person: p, nondeductibleContributions: 6000, @@ -21,6 +22,7 @@ test('skip part 1', () => { test('Roth conversion no basis', () => { const p = Person.self('A'); const tr = new TaxReturn(); + tr.addPerson(p); const f = new Form8606({ person: p, nondeductibleContributions: 6000, diff --git a/src/fed2019/Form8606.ts b/src/fed2019/Form8606.ts index 0e9d1ce..4e436bc 100644 --- a/src/fed2019/Form8606.ts +++ b/src/fed2019/Form8606.ts @@ -20,6 +20,8 @@ export default class Form8606 extends Form { readonly supportsMultipleCopies = true; + person() { return this.getInput('person'); } + protected readonly _lines = { 'person': new Input('person'), diff --git a/src/fed2019/Form8949.test.ts b/src/fed2019/Form8949.test.ts index 4719181..e4a8125 100644 --- a/src/fed2019/Form8949.test.ts +++ b/src/fed2019/Form8949.test.ts @@ -10,6 +10,7 @@ describe('single form', () => { test(`box ${Form8949Box[box]}`, () => { const p = Person.self('A'); const tr = new TaxReturn(); + tr.addPerson(p); tr.addForm(new Form1040({ filingStatus: FilingStatus.Single })); tr.addForm(new Form1099B({ payer: 'Brokerage', @@ -49,6 +50,7 @@ describe('single form', () => { test('multiple forms', () => { const p = Person.self('A'); const tr = new TaxReturn(); + tr.addPerson(p); tr.addForm(new Form1040({ filingStatus: FilingStatus.Single })); tr.addForm(new Form1099B({ payer: 'Brokerage', @@ -106,6 +108,7 @@ test('multiple forms', () => { test('adjustments', () => { const p = Person.self('A'); const tr = new TaxReturn(); + tr.addPerson(p); tr.addForm(new Form1040({ filingStatus: FilingStatus.Single })); const b1 = new Form1099B({ payer: 'Brokerage', diff --git a/src/fed2019/Form8960.test.ts b/src/fed2019/Form8960.test.ts index 093ae2a..5c32ab9 100644 --- a/src/fed2019/Form8960.test.ts +++ b/src/fed2019/Form8960.test.ts @@ -23,6 +23,7 @@ describe('net investment income tax', () => { test(`filing status ${filingStatus}`, () => { const p = Person.self('A'); const tr = new TaxReturn(); + tr.addPerson(p); tr.addForm(new Form1040({ filingStatus })); tr.addForm(new Form1099DIV({ payer: 'Brokerage', @@ -83,6 +84,7 @@ describe('no net investment income tax', () => { test(`filing status ${filingStatus}`, () => { const p = Person.self('A'); const tr = new TaxReturn(); + tr.addPerson(p); tr.addForm(new Form1040({ filingStatus })); tr.addForm(new Form1099DIV({ payer: 'Brokerage', diff --git a/src/fed2019/Schedule3.test.ts b/src/fed2019/Schedule3.test.ts index 1e7a0ba..aa5080b 100644 --- a/src/fed2019/Schedule3.test.ts +++ b/src/fed2019/Schedule3.test.ts @@ -19,6 +19,7 @@ test('foreign tax credit, form 1116 not required', () => { for (const filingStatus of Object.values(FilingStatus)) { const p = Person.self('A'); const tr = new TaxReturn(); + tr.addPerson(p); tr.addForm(new Form1040({ filingStatus })); tr.addForm(new Form8949); tr.addForm(new ScheduleD); @@ -47,6 +48,7 @@ test('foreign tax credit, form 1116 required', () => { for (const filingStatus of Object.values(FilingStatus)) { const p = Person.self('A'); const tr = new TaxReturn(); + tr.addPerson(p); tr.addForm(new Form1040({ filingStatus })); tr.addForm(new Form8949); tr.addForm(new ScheduleD); -- 2.43.5