'4d': new ComputedLine(() => 0),
// 4c and 4d are not supported
// 5a and 5b are not supported
- '6': new ComputedLine((tr: TaxReturn): number => {
+ '6': new ComputedLine((tr): number => {
const schedD = tr.findForm(ScheduleD);
if (!schedD)
return 0;
}, 'Capital gain/loss'),
'7a': new ReferenceLine(/*'Schedule 1'*/ undefined, '9', 'Other income from Schedule 1', 0),
- '7b': new ComputedLine((tr: TaxReturn): number => {
+ '7b': new ComputedLine((tr): number => {
let income = 0;
income += this.getValue(tr, '1');
income += this.getValue(tr, '2b');
'8a': new ReferenceLine(undefined /*'Schedule 1'*/, '22', 'Adjustments to income', 0),
- '8b': new ComputedLine((tr: TaxReturn): number => {
+ '8b': new ComputedLine((tr): number => {
return this.getValue(tr, '7b') - this.getValue(tr, '8a');
}, 'Adjusted gross income'),
// TODO - Deduction
'9': new ComputedLine(() => 0, 'Deduction'),
- '10': new ComputedLine((tr: TaxReturn): number => {
+ '10': new ComputedLine((tr): number => {
const taxableIncome = this.getValue(tr, '8b');
let use8995a = false;
switch (this.getInput('filingStatus')) {
return 0;
}, 'Qualified business income deduction'),
- '11a': new ComputedLine((tr: TaxReturn): number => {
+ '11a': new ComputedLine((tr): number => {
return this.getValue(tr, '9') + this.getValue(tr, '10');
}),
- '11b': new ComputedLine((tr: TaxReturn): number => {
+ '11b': new ComputedLine((tr): number => {
const value = this.getValue(tr, '8b') - this.getValue(tr, '11a');
return value < 0 ? 0 : value;
}, 'Taxable income'),
- '12a': new ComputedLine((tr: TaxReturn): number => {
+ '12a': new ComputedLine((tr): number => {
// Not supported:
// Form 8814 (election to report child's interest or dividends)
// Form 4972 (relating to lump-sum distributions)
return computeTax(taxableIncome, this.getInput('filingStatus'));
}, 'Tax'),
- '12b': new ComputedLine((tr: TaxReturn): number => {
+ '12b': new ComputedLine((tr): number => {
return this.getValue(tr, '12a') + tr.getForm(Schedule2).getValue(tr, '3');
}, 'Additional tax'),
// Not supported: 13a - child tax credit
- '13b': new ComputedLine((tr: TaxReturn): number => {
+ '13b': new ComputedLine((tr): number => {
// TODO: add Sched 3.L7
return 0;
}, 'Additional credits'),
- '14': new ComputedLine((tr: TaxReturn): number => {
+ '14': new ComputedLine((tr): number => {
const l12b = this.getValue(tr, '12b');
const l13b = this.getValue(tr, '13b');
const value = l12b - l13b;
'15': new ReferenceLine(undefined /*'Schedule 2'*/, '10', undefined, 0),
- '16': new ComputedLine((tr: TaxReturn): number => {
+ '16': new ComputedLine((tr): number => {
return this.getValue(tr, '14') + this.getValue(tr, '15');
}, 'Total tax'),
- '17': new ComputedLine((tr: TaxReturn): number => {
+ '17': new ComputedLine((tr): number => {
const fedTaxWithheldBoxes = [
new AccumulatorLine(FormW2, '2'),
//new AccumulatorLine(Form1099R, '4'),
'19': new ReferenceLine(Form1040 as any, '17', 'Total payments'),
- '20': new ComputedLine((tr: TaxReturn): number => {
+ '20': new ComputedLine((tr): number => {
const l16: number = this.getValue(tr, '16');
const l19: number = this.getValue(tr, '19');
if (l19 > l16)
return 0;
}, 'Amount overpaid'),
- '23': new ComputedLine((tr: TaxReturn): number => {
+ '23': new ComputedLine((tr): number => {
const l16 = this.getValue(tr, '16');
const l19 = this.getValue(tr, '19');
if (l19 < l16)
readonly name = 'Schedule 2';
protected readonly _lines = {
- '1': new ComputedLine((tr: TaxReturn): number => {
+ '1': new ComputedLine((tr): number => {
// TODO - this is just using Taxable Income, rather than AMT-limited
// income
const f1040 = tr.getForm(Form1040);
throw new UnsupportedFeatureError('The AMT is not supported');
}, 'AMT'),
// 2 is not supported (Excess advance premium tax credit repayment)
- '3': new ComputedLine((tr: TaxReturn): number => {
+ '3': new ComputedLine((tr): number => {
// Should include line 2.
return this.getValue(tr, '1');
}),
// 5 is not supported (Unreported social security and Medicare tax from)
// 6 is not supported (Additional tax on IRAs, other qualified retirement plans, and other tax-favored accounts)
// 7 is not supported (Household employment taxes.)
- '8': new ComputedLine((tr: TaxReturn): number => {
+ '8': new ComputedLine((tr): number => {
const f1040 = tr.getForm(Form1040);
const wages = f1040.getLine('1').value(tr);
const agi = f1040.getLine('8b').value(tr);
}),
// 9 is not supported (Section 965 net tax liability installment from Form 965-A)
- '10': new ComputedLine((tr: TaxReturn): number => {
+ '10': new ComputedLine((tr): number => {
// Should be lines 4 - 8.
return this.getValue(tr, '8');
})
// 5 is not supported (Net short-term gain or (loss) from partnerships, S corporations, estates, and trusts from Schedule(s) K-1)
// 6 is not supported (Short-term capital loss carryover. Enter the amount, if any, from line 8 of your Capital Loss Carryover Worksheet in the instructions)
- '7': new ComputedLine((tr: TaxReturn): number => {
+ '7': new ComputedLine((tr): number => {
// 1-3 are computed by Form8949.
// 4-6 should be included.
const f8949 = tr.getForm(Form8949);
// 14 is not supported (Long-term capital loss carryover. Enter the amount, if any, from line 13 of your Capital Loss Carryover Worksheet in the instructions)
- '15': new ComputedLine((tr: TaxReturn): number => {
+ '15': new ComputedLine((tr): number => {
// 11-14 should be included.
const f8949 = tr.getForm(Form8949);
return f8949.getValue(tr, 'boxD').gainOrLoss +
this.getValue(tr, '13');
}, 'Net long-term capital gain or (loss)'),
- '16': new ComputedLine((tr: TaxReturn): number => {
+ '16': new ComputedLine((tr): number => {
return this.getValue(tr, '7') + this.getValue(tr, '15');
}),
- '17': new ComputedLine((tr: TaxReturn): boolean => {
+ '17': new ComputedLine((tr): boolean => {
return this.getValue(tr, '15') > 0 && this.getValue(tr, '16') > 0;
}, 'Both ST and LT are gains'),
- '18': new ComputedLine((tr: TaxReturn): number | undefined => {
+ '18': new ComputedLine((tr): number | undefined => {
if (!this.getValue(tr, '17') || this.getValue(tr, '16') <= 0)
return undefined;
// Not supported - only for gains on Qualified Small Business Stock or collectibles.
// 19 is not supported (Unrecaptured Section 1250 Gain Worksheet)
- '20': new ComputedLine((tr: TaxReturn): boolean | undefined => {
+ '20': new ComputedLine((tr): boolean | undefined => {
if (!this.getValue(tr, '17') || this.getValue(tr, '16') <= 0)
return undefined;
const l18 = this.getValue(tr, '18');
return (l18 === 0 || l18 === undefined) || (l19 === 0 || l19 === undefined);
}, 'Line 18 and 19 both 0 or blank?'),
- '21': new ComputedLine((tr: TaxReturn): number | undefined => {
+ '21': new ComputedLine((tr): number | undefined => {
if (!this.getValue(tr, '17') || !this.getValue(tr, '20'))
return undefined;
const filingStatus = tr.getForm(Form1040).getInput('filingStatus');
'2': new ReferenceLine(Form1040, '3a'),
// TODO 3 - form 4952
// TODO 4 - 4952
- '5': new ComputedLine((tr: TaxReturn): number => 0),
- '6': new ComputedLine((tr: TaxReturn): number => clampToZero(this.getValue(tr, '2') - this.getValue(tr, '5'))),
- '7': new ComputedLine((tr: TaxReturn): number => {
+ '5': new ComputedLine((tr): number => 0),
+ '6': new ComputedLine((tr): number => clampToZero(this.getValue(tr, '2') - this.getValue(tr, '5'))),
+ '7': new ComputedLine((tr): number => {
const schedD = tr.getForm(ScheduleD);
return Math.min(schedD.getValue(tr, '15'), schedD.getValue(tr, '16'));
}),
- '8': new ComputedLine((tr: TaxReturn): number => {
+ '8': new ComputedLine((tr): number => {
return 0;
// return Math.min(this.getValue(tr, '3'), this.getValue(tr, '4'));
}),
- '9': new ComputedLine((tr: TaxReturn): number => clampToZero(this.getValue(tr, '7') - this.getValue(tr, '8'))),
- '10': new ComputedLine((tr: TaxReturn): number => this.getValue(tr, '6') + this.getValue(tr, '9')),
- '11': new ComputedLine((tr: TaxReturn): number => {
+ '9': new ComputedLine((tr): number => clampToZero(this.getValue(tr, '7') - this.getValue(tr, '8'))),
+ '10': new ComputedLine((tr): number => this.getValue(tr, '6') + this.getValue(tr, '9')),
+ '11': new ComputedLine((tr): number => {
const schedD = tr.getForm(ScheduleD);
// TODO - line 19 is not supported.
return Math.min(schedD.getValue(tr, '18'), Infinity); //schedD.getValue(tr, '19'));
}),
- '12': new ComputedLine((tr: TaxReturn): number => Math.min(this.getValue(tr, '9'), this.getValue(tr, '11'))),
- '13': new ComputedLine((tr: TaxReturn): number => this.getValue(tr, '10') - this.getValue(tr, '12')),
- '14': new ComputedLine((tr: TaxReturn): number => clampToZero(this.getValue(tr, '1') - this.getValue(tr, '13'))),
- '15': new ComputedLine((tr: TaxReturn): number => {
+ '12': new ComputedLine((tr): number => Math.min(this.getValue(tr, '9'), this.getValue(tr, '11'))),
+ '13': new ComputedLine((tr): number => this.getValue(tr, '10') - this.getValue(tr, '12')),
+ '14': new ComputedLine((tr): number => clampToZero(this.getValue(tr, '1') - this.getValue(tr, '13'))),
+ '15': new ComputedLine((tr): number => {
switch (tr.getForm(Form1040).getInput('filingStatus')) {
case FilingStatus.Single:
case FilingStatus.MarriedFilingSeparate:
return 78750;
}
}),
- '16': new ComputedLine((tr: TaxReturn): number => Math.min(this.getValue(tr, '1'), this.getValue(tr, '15'))),
- '17': new ComputedLine((tr: TaxReturn): number => Math.min(this.getValue(tr, '14'), this.getValue(tr, '16'))),
- '18': new ComputedLine((tr: TaxReturn): number => clampToZero(this.getValue(tr, '1') - this.getValue(tr, '10'))),
- '19': new ComputedLine((tr: TaxReturn): number => {
+ '16': new ComputedLine((tr): number => Math.min(this.getValue(tr, '1'), this.getValue(tr, '15'))),
+ '17': new ComputedLine((tr): number => Math.min(this.getValue(tr, '14'), this.getValue(tr, '16'))),
+ '18': new ComputedLine((tr): number => clampToZero(this.getValue(tr, '1') - this.getValue(tr, '10'))),
+ '19': new ComputedLine((tr): number => {
let threshold: number;
switch (tr.getForm(Form1040).getInput('filingStatus')) {
case FilingStatus.Single:
}
return Math.min(this.getValue(tr, '1'), threshold);
}),
- '20': new ComputedLine((tr: TaxReturn): number => Math.min(this.getValue(tr, '14'), this.getValue(tr, '19'))),
- '21': new ComputedLine((tr: TaxReturn): number => Math.max(this.getValue(tr, '18'), this.getValue(tr, '20'))),
- '22': new ComputedLine((tr: TaxReturn): number => this.getValue(tr, '16') - this.getValue(tr, '17')),
- '23': new ComputedLine((tr: TaxReturn): number => Math.min(this.getValue(tr, '1'), this.getValue(tr, '13'))),
+ '20': new ComputedLine((tr): number => Math.min(this.getValue(tr, '14'), this.getValue(tr, '19'))),
+ '21': new ComputedLine((tr): number => Math.max(this.getValue(tr, '18'), this.getValue(tr, '20'))),
+ '22': new ComputedLine((tr): number => this.getValue(tr, '16') - this.getValue(tr, '17')),
+ '23': new ComputedLine((tr): number => Math.min(this.getValue(tr, '1'), this.getValue(tr, '13'))),
'24': new ReferenceLine(ScheduleDTaxWorksheet as any, '22'),
- '25': new ComputedLine((tr: TaxReturn): number => clampToZero(this.getValue(tr, '23') - this.getValue(tr, '24'))),
- '26': new ComputedLine((tr: TaxReturn): number => {
+ '25': new ComputedLine((tr): number => clampToZero(this.getValue(tr, '23') - this.getValue(tr, '24'))),
+ '26': new ComputedLine((tr): number => {
switch (tr.getForm(Form1040).getInput('filingStatus')) {
case FilingStatus.Single:
return 434550;
return 488850;
}
}),
- '27': new ComputedLine((tr: TaxReturn): number => Math.min(this.getValue(tr, '1'), this.getValue(tr, '26'))),
- '28': new ComputedLine((tr: TaxReturn): number => this.getValue(tr, '21') + this.getValue(tr, '22')),
- '29': new ComputedLine((tr: TaxReturn): number => clampToZero(this.getValue(tr, '27') - this.getValue(tr, '28'))),
- '30': new ComputedLine((tr: TaxReturn): number => Math.min(this.getValue(tr, '25'), this.getValue(tr, '29'))),
- '31': new ComputedLine((tr: TaxReturn): number => this.getValue(tr, '30') * 0.15),
- '32': new ComputedLine((tr: TaxReturn): number => this.getValue(tr, '24') + this.getValue(tr, '30')),
- '33': new ComputedLine((tr: TaxReturn): number => this.getValue(tr, '23') - this.getValue(tr, '32')),
- '34': new ComputedLine((tr: TaxReturn): number => this.getValue(tr, '33') * 0.20),
- '35': new ComputedLine((tr: TaxReturn): number => {
+ '27': new ComputedLine((tr): number => Math.min(this.getValue(tr, '1'), this.getValue(tr, '26'))),
+ '28': new ComputedLine((tr): number => this.getValue(tr, '21') + this.getValue(tr, '22')),
+ '29': new ComputedLine((tr): number => clampToZero(this.getValue(tr, '27') - this.getValue(tr, '28'))),
+ '30': new ComputedLine((tr): number => Math.min(this.getValue(tr, '25'), this.getValue(tr, '29'))),
+ '31': new ComputedLine((tr): number => this.getValue(tr, '30') * 0.15),
+ '32': new ComputedLine((tr): number => this.getValue(tr, '24') + this.getValue(tr, '30')),
+ '33': new ComputedLine((tr): number => this.getValue(tr, '23') - this.getValue(tr, '32')),
+ '34': new ComputedLine((tr): number => this.getValue(tr, '33') * 0.20),
+ '35': new ComputedLine((tr): number => {
const schedD = tr.getForm(ScheduleD);
// TODO - line 19 is not supported.
return Math.min(this.getValue(tr, '9'), Infinity); //schedD.getValue(tr, '19'));
}),
- '36': new ComputedLine((tr: TaxReturn): number => this.getValue(tr, '10') + this.getValue(tr, '21')),
+ '36': new ComputedLine((tr): number => this.getValue(tr, '10') + this.getValue(tr, '21')),
'37': new ReferenceLine(ScheduleDTaxWorksheet as any, '1'),
- '38': new ComputedLine((tr: TaxReturn): number => clampToZero(this.getValue(tr, '36') - this.getValue(tr, '37'))),
- '39': new ComputedLine((tr: TaxReturn): number => clampToZero(this.getValue(tr, '35') - this.getValue(tr, '38'))),
- '40': new ComputedLine((tr: TaxReturn): number => this.getValue(tr, '39') * 0.25),
- '41': new ComputedLine((tr: TaxReturn): number => {
+ '38': new ComputedLine((tr): number => clampToZero(this.getValue(tr, '36') - this.getValue(tr, '37'))),
+ '39': new ComputedLine((tr): number => clampToZero(this.getValue(tr, '35') - this.getValue(tr, '38'))),
+ '40': new ComputedLine((tr): number => this.getValue(tr, '39') * 0.25),
+ '41': new ComputedLine((tr): number => {
const schedD = tr.getForm(ScheduleD);
if (schedD.getValue(tr, '18'))
throw new UnsupportedFeatureError('28% Gain unsupported');
return 0;
}),
- '42': new ComputedLine((tr: TaxReturn): number => {
+ '42': new ComputedLine((tr): number => {
if (!tr.getForm(ScheduleD).getValue(tr, '18'))
return 0;
return this.getValue(tr, '1') - this.getValue(tr, '41');
}),
- '43': new ComputedLine((tr: TaxReturn): number => {
+ '43': new ComputedLine((tr): number => {
if (!tr.getForm(ScheduleD).getValue(tr, '18'))
return 0;
return this.getValue(tr, '42') * 0.28;
}),
- '44': new ComputedLine((tr: TaxReturn): number => {
+ '44': new ComputedLine((tr): number => {
const income = this.getValue(tr, '21');
return computeTax(income, tr.getForm(Form1040).getInput('filingStatus'));
}),
- '45': new ComputedLine((tr: TaxReturn): number => {
+ '45': new ComputedLine((tr): number => {
return this.getValue(tr, '31') +
this.getValue(tr, '34') +
this.getValue(tr, '40') +
this.getValue(tr, '43') +
this.getValue(tr, '44');
}),
- '46': new ComputedLine((tr: TaxReturn): number => {
+ '46': new ComputedLine((tr): number => {
const income = this.getValue(tr, '1');
return computeTax(income, tr.getForm(Form1040).getInput('filingStatus'));
}),
- '47': new ComputedLine((tr: TaxReturn): number => Math.min(this.getValue(tr, '45'), this.getValue(tr, '46'))),
+ '47': new ComputedLine((tr): number => Math.min(this.getValue(tr, '45'), this.getValue(tr, '46'))),
};
};