From a8bdf4eafaed00a5679e1293df634340fe9f4336 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Wed, 18 Mar 2020 01:32:03 -0400 Subject: [PATCH] Fix some remaining bugs in tax computation. --- src/fed2019/Form1040.ts | 2 +- src/fed2019/Form8960.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fed2019/Form1040.ts b/src/fed2019/Form1040.ts index 95bf92e..7d1a986 100644 --- a/src/fed2019/Form1040.ts +++ b/src/fed2019/Form1040.ts @@ -259,7 +259,7 @@ export class QDCGTaxWorksheet extends Form { '3': new ComputedLine((tr): number => { const schedD = tr.findForm(ScheduleD); if (schedD) - return Math.min(schedD.getValue(tr, '15'), schedD.getValue(tr, '16')); + return clampToZero(Math.min(schedD.getValue(tr, '15'), schedD.getValue(tr, '16'))); return tr.getForm(Form1040).getValue(tr, '6'); }), '4': new ComputedLine((tr): number => this.getValue(tr, '2') + this.getValue(tr, '3')), diff --git a/src/fed2019/Form8960.ts b/src/fed2019/Form8960.ts index 0373aea..46f45a8 100644 --- a/src/fed2019/Form8960.ts +++ b/src/fed2019/Form8960.ts @@ -5,7 +5,7 @@ import { Form, TaxReturn } from '../core'; import { ComputedLine, ReferenceLine } from '../core/Line'; -import { clampToZero } from '../core/Math'; +import { clampToZero, undefinedToZero } from '../core/Math'; import Form1040, { FilingStatus } from './Form1040'; import Schedule1 from './Schedule1'; @@ -24,7 +24,7 @@ export default class Form8960 extends Form { // 4c not supported - 4a+4b '5a': new ComputedLine((tr): number => { return (new ReferenceLine(Form1040, '6')).value(tr) + - (new ReferenceLine(Schedule1, '4', undefined, 0)).value(tr); + undefinedToZero(new ReferenceLine(Schedule1, '4', undefined, 0).value(tr)); }, 'Net gain or loss'), // 5b not supported - Net gain or loss from disposition of property that is not subject to net investment income tax // 5c not supported - Adjustment from disposition of partnership interest or S corporation stock -- 2.22.5