expect(f1040.getValue(tr, '3b')).toBe(200);
});
+test('tax-exempt interest', () => {
+ const p = Person.self('A');
+ const tr = new TaxReturn();
+ tr.addPerson(p);
+ tr.addForm(new Form1099DIV({
+ payer: 'Brokerage',
+ payee: p,
+ exemptInterestDividends: 100,
+ }));
+ tr.addForm(new Form1099INT({
+ payer: 'Bank',
+ payee: p,
+ interest: 0,
+ taxExemptInterest: 50
+ }));
+
+ const f1040 = new Form1040();
+ tr.addForm(f1040);
+
+ expect(f1040.getValue(tr, '2a')).toBe(150);
+});
+
test('capital gain/loss', () => {
const p = Person.self('A');
const tr = new TaxReturn();
protected readonly _lines = {
'1': new AccumulatorLine(W2, '1', 'Wages, salaries, tips, etc.'),
- '2a': new AccumulatorLine(Form1099INT, '8', 'Tax-exempt interest'),
+ '2a': new ComputedLine((tr): number => {
+ const value = (new AccumulatorLine(Form1099INT, '8')).value(tr) +
+ (new AccumulatorLine(Form1099DIV, '11')).value(tr);
+ return value;
+ }, 'Tax-exempt interest'),
'2b': new AccumulatorLine(Form1099INT, '1', 'Taxable interest'),
'3a': new AccumulatorLine(Form1099DIV, '1b', 'Qualified dividends'),
'3b': new AccumulatorLine(Form1099DIV, '1a', 'Ordinary dividends'),