Add Form 1099-DIV.
authorRobert Sesek <rsesek@bluestatic.org>
Sat, 22 Feb 2020 04:12:34 +0000 (23:12 -0500)
committerRobert Sesek <rsesek@bluestatic.org>
Sat, 22 Feb 2020 04:12:34 +0000 (23:12 -0500)
src/fed2019/Form1040.test.ts
src/fed2019/Form1099DIV.ts [new file with mode: 0644]

index ef3dde6eaf97c2ff0b4c99609c9e53c49569f26b..bbd533c180621be70aacece2e9de17845155a802 100644 (file)
@@ -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 (file)
index 0000000..4f575df
--- /dev/null
@@ -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<T extends keyof Form1099DIVInput> extends InputLine<Form1099DIVInput, T> {};
+
+export default class Form1099DIV extends Form<Form1099DIV['_lines'], Form1099DIVInput> {
+  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'),
+  };
+}