diff --git a/src/forms/Y2021/irsForms/F1040Attachment.ts b/src/forms/Y2021/irsForms/F1040Attachment.ts index bc160d015..5b3db84e1 100644 --- a/src/forms/Y2021/irsForms/F1040Attachment.ts +++ b/src/forms/Y2021/irsForms/F1040Attachment.ts @@ -10,4 +10,12 @@ abstract class F1040Attachment extends Form { } } +export abstract class Worksheet { + f1040: F1040 + + constructor(f1040: F1040) { + this.f1040 = f1040 + } +} + export default F1040Attachment diff --git a/src/forms/Y2021/irsForms/F2555.ts b/src/forms/Y2021/irsForms/F2555.ts index 29baf106d..95cae61f5 100644 --- a/src/forms/Y2021/irsForms/F2555.ts +++ b/src/forms/Y2021/irsForms/F2555.ts @@ -9,6 +9,9 @@ export default class F2555 extends F1040Attachment { tag: FormTag = 'f2555' sequenceIndex = 34 + // TODO - Required from SDCapitalGainWorksheet + l3 = (): number | undefined => undefined + // TODO - required from 6251 l36 = (): number => 0 diff --git a/src/forms/Y2021/irsForms/F6251.ts b/src/forms/Y2021/irsForms/F6251.ts index 0b5b83be3..1ef90e1c8 100644 --- a/src/forms/Y2021/irsForms/F6251.ts +++ b/src/forms/Y2021/irsForms/F6251.ts @@ -1,12 +1,43 @@ import F1040Attachment from './F1040Attachment' import { FilingStatus, PersonRole } from 'ustaxes/core/data' import { FormTag } from 'ustaxes/core/irsForms/Form' -import SDQualifiedAndCapGains from './worksheets/SDQualifiedAndCapGains' import { Field } from 'ustaxes/core/pdfFiller' +type Part3 = Partial<{ + l12: number + l13: number + l14: number + l15: number + l16: number + l17: number + l18: number + l19: number + l20: number + l21: number + l22: number + l23: number + l24: number + l25: number + l26: number + l27: number + l28: number + l29: number + l30: number + l31: number + l32: number + l33: number + l34: number + l35: number + l36: number + l37: number + l38: number + l39: number + l40: number +}> + export default class F6251 extends F1040Attachment { tag: FormTag = 'f6251' - sequenceIndex = 72 + sequenceIndex = 32 isNeeded = (): boolean => { // See https://www.irs.gov/instructions/i6251 @@ -209,7 +240,7 @@ export default class F6251 extends F1040Attachment { // Use line 40 if Part III is required if (this.requiresPartIII()) { - return this.l40() + return this.part3().l40 } const cap = @@ -256,379 +287,247 @@ export default class F6251 extends F1040Attachment { return Math.max(0, (this.l9() ?? 0) - (this.l10() ?? 0)) } - l12 = (): number | undefined => { - if (!this.requiresPartIII()) { - return undefined - } - return this.l6() - } - - l13 = (): number | undefined => { + part3 = (): Part3 => { if (!this.requiresPartIII()) { - return undefined + return {} } - - const schDWksht = this.f1040.scheduleD?.rateGainWorksheet - if (schDWksht) { - const amount = schDWksht.l13() - if (amount != undefined) { - return amount - } + const fs = this.f1040.info.taxPayer.filingStatus + if (fs === undefined) { + throw new Error('Filing status is undefined') } - const filingStatus = this.f1040.info.taxPayer.filingStatus - if (filingStatus !== undefined) { - const wksht = new SDQualifiedAndCapGains(this.f1040) - return wksht.l4() - } + const qdivWorksheet = this.f1040.qualifiedAndCapGainsWorksheet + const schDWksht = this.f1040.scheduleD?.taxWorksheet + const usingTaxWorksheet = schDWksht !== undefined && schDWksht.isNeeded() - return undefined - } + const l18Consts: [number, number] = (() => { + if (this.f1040.info.taxPayer.filingStatus === FilingStatus.MFS) { + return [99950, 1999] + } + return [199900, 3998] + })() - l14 = (): number | undefined => { - if (!this.requiresPartIII()) { - return undefined + const l19Value: { [k in FilingStatus]: number } = { + [FilingStatus.MFJ]: 80800, + [FilingStatus.W]: 80800, + [FilingStatus.S]: 40400, + [FilingStatus.MFS]: 40400, + [FilingStatus.HOH]: 54100 } - return this.f1040.scheduleD?.l14() - } - - l15 = (): number | undefined => { - if (!this.requiresPartIII()) { - return undefined - } - if (!this.f1040.scheduleD?.rateGainWorksheet) { - return this.l13() + const l25Value: { [k in FilingStatus]: number } = { + [FilingStatus.MFJ]: 501600, + [FilingStatus.W]: 501600, + [FilingStatus.S]: 445860, + [FilingStatus.MFS]: 250800, + [FilingStatus.HOH]: 473750 } - const l13And14 = (this.l13() ?? 0) + (this.l14() ?? 0) - return Math.min( - l13And14, - this.f1040.scheduleD?.rateGainWorksheet.l10() ?? 0 - ) - } - - l16 = (): number | undefined => { - if (!this.requiresPartIII()) { - return undefined - } - return Math.min(this.l12() ?? 0, this.l14() ?? 0) - } + const l12 = this.l6() - l17 = (): number | undefined => { - if (!this.requiresPartIII()) { - return undefined - } - return (this.l12() ?? 0) - (this.l16() ?? 0) - } + // TODO - for F2555, see the instructions for amount + const l13: number = (() => { + if (usingTaxWorksheet) { + return schDWksht.l13() ?? 0 + } - l18 = (): number | undefined => { - if (!this.requiresPartIII()) { - return undefined - } + return qdivWorksheet?.l4() ?? 0 + })() - const l17 = this.l17() ?? 0 - const cap = - this.f1040.info.taxPayer.filingStatus === FilingStatus.MFS - ? 99950 - : 199900 - if (l17 <= cap) { - return l17 * 0.26 - } - const subtract = - this.f1040.info.taxPayer.filingStatus === FilingStatus.MFS ? 1999 : 3998 - return l17 * 0.28 - subtract - } + const l14 = this.f1040.scheduleD?.l19() ?? 0 - l19 = (): number | undefined => { - if (!this.requiresPartIII()) { - return undefined - } + const l15 = (() => { + if (!usingTaxWorksheet) { + return l13 + } + return Math.min(l13 + l14, schDWksht.l10() ?? 0) + })() - switch (this.f1040.info.taxPayer.filingStatus) { - case FilingStatus.MFS: - case FilingStatus.S: - return 40400 - case FilingStatus.MFJ: - case FilingStatus.W: - return 80800 - case FilingStatus.HOH: - return 54100 - } + const l16 = Math.min(l12 ?? 0, l15 ?? 0) - return undefined - } + const l17 = (l12 ?? 0) - (l16 ?? 0) - l20 = (): number | undefined => { - if (!this.requiresPartIII()) { - return undefined - } + const l18 = (() => { + const [c1, c2] = l18Consts - const schDWksht = this.f1040.scheduleD?.rateGainWorksheet - if (schDWksht) { - const amount = schDWksht.l14() - if (amount !== undefined) { - return amount + if (l17 <= c1) { + return l17 * 0.26 } - } - - if (this.f1040.totalQualifiedDividends() > 0) { - const wksht = new SDQualifiedAndCapGains(this.f1040) - return wksht.l5() - } - - return Math.max(0, this.f1040.l15() ?? 0) - } - - l21 = (): number | undefined => { - if (!this.requiresPartIII()) { - return undefined - } + return l17 * 0.28 - c2 + })() - return Math.max(0, (this.l19() ?? 0) - (this.l20() ?? 0)) - } + const l19 = l19Value[fs] - l22 = (): number | undefined => { - if (!this.requiresPartIII()) { - return undefined - } - return Math.min(this.l12() ?? 0, this.l13() ?? 0) - } + const l20 = (() => { + if (usingTaxWorksheet) { + return schDWksht.l14() ?? 0 + } - l23 = (): number | undefined => { - if (!this.requiresPartIII()) { - return undefined - } - return Math.min(this.l21() ?? 0, this.l22() ?? 0) - } + if (qdivWorksheet !== undefined) { + return qdivWorksheet.l5() + } - l24 = (): number | undefined => { - if (!this.requiresPartIII()) { - return undefined - } + return Math.max(0, this.f1040.l15()) + })() - return Math.max(0, (this.l22() ?? 0) - (this.l23() ?? 0)) - } + const l21 = Math.max(0, (l19 ?? 0) - (l20 ?? 0)) - l25 = (): number | undefined => { - if (!this.requiresPartIII()) { - return undefined - } + const l22 = Math.min(l12 ?? 0, l13 ?? 0) - switch (this.f1040.info.taxPayer.filingStatus) { - case FilingStatus.S: - return 445850 - case FilingStatus.MFS: - return 250800 - case FilingStatus.MFJ: - case FilingStatus.W: - return 501600 - case FilingStatus.HOH: - return 473750 - } + const l23 = Math.min(l21 ?? 0, l22 ?? 0) - return undefined - } + const l24 = Math.max(0, (l22 ?? 0) - (l23 ?? 0)) - l26 = (): number | undefined => this.l21() + const l25 = l25Value[fs] - l27 = (): number | undefined => { - if (!this.requiresPartIII()) { - return undefined - } + const l26 = l21 - const schDWksht = this.f1040.scheduleD?.rateGainWorksheet - if (schDWksht) { - const amount = schDWksht.l21() - if (amount !== undefined) { - return amount + // TODO - see instructions for F2555 + const l27 = (() => { + if (usingTaxWorksheet) { + return schDWksht.l21() ?? 0 } - } - - if (this.f1040.totalQualifiedDividends() > 0) { - const wksht = new SDQualifiedAndCapGains(this.f1040) - return wksht.l5() - } - return Math.max(0, this.f1040.l15() ?? 0) - } - - l28 = (): number | undefined => { - if (!this.requiresPartIII()) { - return undefined - } - return (this.l26() ?? 0) + (this.l27() ?? 0) - } - - l29 = (): number | undefined => { - if (!this.requiresPartIII()) { - return undefined - } - return Math.max(0, (this.l25() ?? 0) - (this.l28() ?? 0)) - } + if (qdivWorksheet !== undefined) { + return qdivWorksheet.l5() + } - l30 = (): number | undefined => { - if (!this.requiresPartIII()) { - return undefined - } - return Math.min(this.l24() ?? 0, this.l29() ?? 0) - } + return Math.max(0, this.f1040.l15()) + })() - l31 = (): number | undefined => { - if (!this.requiresPartIII()) { - return undefined - } - return (this.l30() ?? 0) * 0.15 - } + const l28 = l26 + l27 - l32 = (): number | undefined => { - if (!this.requiresPartIII()) { - return undefined - } - return (this.l23() ?? 0) + (this.l30() ?? 0) - } + const l29 = Math.max(0, l25 - l28) - l33 = (): number | undefined => { - if ( - !this.requiresPartIII() || - (this.l12() ?? 0) - (this.l32() ?? 0) < 0.01 - ) { - return undefined - } - return (this.l22() ?? 0) + (this.l32() ?? 0) - } + const l30 = Math.min(l24, l29) - l34 = (): number | undefined => { - const l33 = this.l33() - if (l33 === undefined) { - return undefined - } - return l33 * 0.2 - } + const l31 = l30 * 0.15 - l35 = (): number | undefined => { - if ((this.l14() ?? 0) === 0) { - return undefined - } - return (this.l17() ?? 0) + (this.l32() ?? 0) + (this.l33() ?? 0) - } + const l32 = l23 + l30 - l36 = (): number | undefined => { - if ((this.l14() ?? 0) === 0) { - return undefined - } - return (this.l12() ?? 0) - (this.l35() ?? 0) - } + const l33 = l22 - l32 - l37 = (): number | undefined => { - if ((this.l14() ?? 0) === 0) { - return undefined - } - return (this.l36() ?? 0) * 0.25 - } + const l34 = l33 * 0.2 - l38 = (): number | undefined => { - if (!this.requiresPartIII()) { - return undefined - } - return ( - (this.l18() ?? 0) + - (this.l31() ?? 0) + - (this.l34() ?? 0) + - (this.l37() ?? 0) - ) - } + const l35 = l17 + l32 + l33 - l39 = (): number | undefined => { - if (!this.requiresPartIII()) { - return undefined - } + const l36 = l12 - l35 - const l12 = this.l12() ?? 0 - const cap = - this.f1040.info.taxPayer.filingStatus === FilingStatus.MFS - ? 99950 - : 199900 - if (l12 <= cap) { - return l12 * 0.26 - } - const subtract = - this.f1040.info.taxPayer.filingStatus === FilingStatus.MFS ? 1999 : 3998 - return l12 * 0.28 - subtract - } + const l37 = l36 * 0.25 - l40 = (): number | undefined => { - if (!this.requiresPartIII()) { - return undefined - } + const l38 = l18 + l31 + l34 + l37 - return Math.min(this.l38() ?? 0, this.l39() ?? 0) + const l39 = (() => { + // numbers referenced here are the same as l18. + const [c1, c2] = l18Consts + if (l12 <= c1) { + return l12 * 0.26 + } + return l12 * 0.28 - c2 + })() + + const l40 = Math.min(l38, l39) + + return { + l12, + l13, + l14, + l15, + l16, + l17, + l18, + l19, + l20, + l21, + l22, + l23, + l24, + l25, + l26, + l27, + l28, + l29, + l30, + l31, + l32, + l33, + l34, + l35, + l36, + l37, + l38, + l39, + l40 + } + } + + fields = (): Field[] => { + const p3 = this.part3() + return [ + this.f1040.info.namesString(), + this.f1040.info.taxPayer.primaryPerson?.ssid, + // Part I + this.l1(), + this.l2a(), + this.l2b(), + this.l2c(), + this.l2d(), + this.l2e(), + this.l2f(), + this.l2g(), + this.l2h(), + this.l2i(), + this.l2j(), + this.l2k(), + this.l2l(), + this.l2m(), + this.l2n(), + this.l2o(), + this.l2p(), + this.l2q(), + this.l2r(), + this.l2s(), + this.l2t(), + this.l3(), + this.l4(), + // Part II + this.l5(), + this.l6(), + this.l7(), + this.l8(), + this.l9(), + this.l10(), + this.l11(), + // Part III + p3.l12, + p3.l13, + p3.l14, + p3.l15, + p3.l16, + p3.l17, + p3.l18, + p3.l19, + p3.l20, + p3.l21, + p3.l22, + p3.l23, + p3.l24, + p3.l25, + p3.l26, + p3.l27, + p3.l28, + p3.l29, + p3.l30, + p3.l31, + p3.l32, + p3.l33, + p3.l34, + p3.l35, + p3.l36, + p3.l37, + p3.l38, + p3.l39, + p3.l40 + ] } - - fields = (): Field[] => [ - this.f1040.info.namesString(), - this.f1040.info.taxPayer.primaryPerson?.ssid, - // Part I - this.l1(), - this.l2a(), - this.l2b(), - this.l2c(), - this.l2d(), - this.l2e(), - this.l2f(), - this.l2g(), - this.l2h(), - this.l2i(), - this.l2j(), - this.l2k(), - this.l2l(), - this.l2m(), - this.l2n(), - this.l2o(), - this.l2p(), - this.l2q(), - this.l2r(), - this.l2s(), - this.l2t(), - this.l3(), - this.l4(), - // Part II - this.l5(), - this.l6(), - this.l7(), - this.l8(), - this.l9(), - this.l10(), - this.l11(), - // Part III - this.l12(), - this.l13(), - this.l14(), - this.l15(), - this.l16(), - this.l17(), - this.l18(), - this.l19(), - this.l20(), - this.l21(), - this.l22(), - this.l23(), - this.l24(), - this.l25(), - this.l26(), - this.l27(), - this.l28(), - this.l29(), - this.l30(), - this.l31(), - this.l32(), - this.l33(), - this.l34(), - this.l35(), - this.l36(), - this.l37(), - this.l38(), - this.l39(), - this.l40() - ] } diff --git a/src/forms/Y2021/irsForms/ScheduleD.ts b/src/forms/Y2021/irsForms/ScheduleD.ts index f4138492a..0325cf67c 100644 --- a/src/forms/Y2021/irsForms/ScheduleD.ts +++ b/src/forms/Y2021/irsForms/ScheduleD.ts @@ -7,11 +7,14 @@ import F8949 from './F8949' import F1040Attachment from './F1040Attachment' import F1040 from './F1040' import { Field } from 'ustaxes/core/pdfFiller' - +import SDTaxWorksheet from './worksheets/SDTaxWorksheet' +import QualDivAndCGWorksheet from './worksheets/SDQualifiedAndCapGains' export default class ScheduleD extends F1040Attachment { tag: FormTag = 'f1040sd' sequenceIndex = 12 aggregated: F1099BData + qualifiedDivAndCGWorksheet: QualDivAndCGWorksheet + taxWorksheet: SDTaxWorksheet rateGainWorksheet: SDRateGainWorksheet unrecaptured1250: SDUnrecaptured1250 @@ -31,6 +34,8 @@ export default class ScheduleD extends F1040Attachment { } this.rateGainWorksheet = new SDRateGainWorksheet() + this.taxWorksheet = new SDTaxWorksheet(f1040) + this.qualifiedDivAndCGWorksheet = new QualDivAndCGWorksheet(f1040) this.unrecaptured1250 = new SDUnrecaptured1250() } diff --git a/src/forms/Y2021/irsForms/worksheets/SDQualifiedAndCapGains.ts b/src/forms/Y2021/irsForms/worksheets/SDQualifiedAndCapGains.ts index 4328754c0..9dfc1f90c 100644 --- a/src/forms/Y2021/irsForms/worksheets/SDQualifiedAndCapGains.ts +++ b/src/forms/Y2021/irsForms/worksheets/SDQualifiedAndCapGains.ts @@ -3,18 +3,7 @@ import { WorksheetData } from 'ustaxes/components/SummaryData' import { FilingStatus } from 'ustaxes/core/data' import federalBrackets from '../../data/federal' import { computeOrdinaryTax } from '../../irsForms/TaxTable' -import F1040 from '../F1040' - -export interface TestData { - qualDiv: number - taxableIncome: number - f1040l7: number | undefined - sdl15: number | undefined - sdl16: number | undefined - sdl18: number | undefined - sdl19: number | undefined - filingStatus: FilingStatus -} +import { Worksheet } from '../F1040Attachment' type Bracket = [number, number] type Cutoffs = { [key in FilingStatus]: Bracket } @@ -26,40 +15,39 @@ const cutoffAmounts: Cutoffs = { [FilingStatus.HOH]: [54100, 473750] } -export default class QualDivAndCGWorksheetReference { - [k: string]: TestData | (() => number) | (() => WorksheetData) - data: TestData - - constructor(f1040: F1040) { - const filingStatus = f1040.info.taxPayer.filingStatus - if (filingStatus === undefined) { +export default class QualDivAndCGWorksheet extends Worksheet { + fs = (): FilingStatus => { + const fs = this.f1040.info.taxPayer.filingStatus + if (fs === undefined) { throw new Error('Filing status is undefined') } - this.data = { - qualDiv: f1040.l3a() ?? 0, - taxableIncome: f1040.l15(), - f1040l7: f1040.l7(), - sdl15: f1040.scheduleD?.l15(), - sdl16: f1040.scheduleD?.l16(), - sdl18: f1040.scheduleD?.l18(), - sdl19: f1040.scheduleD?.l19(), - filingStatus - } + return fs } - // 1. Enter the amount from Form 1040 or 1040-SR, line 15. However, if you are filing Form 2555 (relating to foreign earned income), enter the amount from line 3 of the Foreign Earned Income Tax Worksheet - l1 = (): number => this.data.taxableIncome + // 1. Enter the amount from Form 1040 or 1040-SR, line 15. + // However, if you are filing Form 2555(relating to foreign earned income), + // enter the amount from line 3 of the Foreign Earned Income Tax Worksheet + l1 = (): number => { + if (this.f1040.f2555 !== undefined) { + return this.f1040.f2555.l3() ?? 0 + } + return this.f1040.l15() + } // 2. Enter the amount from Form 1040 or 1040-SR, line 3a* - l2 = (): number => this.data.qualDiv + l2 = (): number => this.f1040.l3a() ?? 0 // 3. Are you filing Schedule D?* - // Yes. Enter the smaller of line 15 or 16 of Schedule D. If either line 15 or 16 is blank or a loss, enter -0-. 3. + // Yes. Enter the smaller of line 15 or 16 of Schedule D. + // If either line 15 or 16 is blank or a loss, enter - 0 -. 3. // No. Enter the amount from Form 1040 or 1040-SR, line 7. - // Either way, it's the smaller of LTCG or total capital gain. - l3 = (): number => - Math.min( - Math.max(this.data.sdl15 ?? 0, 0), - Math.max(this.data.sdl16 ?? 0, 0) - ) + l3 = (): number => { + if (this.f1040.scheduleD !== undefined) { + return Math.min( + Math.max(this.f1040.scheduleD?.l15() ?? 0, 0), + Math.max(this.f1040.scheduleD?.l16() ?? 0, 0) + ) + } + return this.f1040.l7() ?? 0 + } // 4. Add lines 2 and 3: LTCG + QDIV l4 = (): number => this.l2() + this.l3() // 5. Subtract line 4 from line 1. If zero or less, enter -0- @@ -67,7 +55,7 @@ export default class QualDivAndCGWorksheetReference { // 6. Enter: // $40,400 if single or married filing separately, // $80,800 if married filing jointly or qualifying widow(er), $54,100 if head of household. - l6 = (): number => cutoffAmounts[this.data.filingStatus][0] + l6 = (): number => cutoffAmounts[this.fs()][0] // 7. Enter the smaller of line 1 or line 6 l7 = (): number => Math.min(this.l1(), this.l6()) // 8. Enter the smaller of line 5 or line 7 @@ -83,7 +71,7 @@ export default class QualDivAndCGWorksheetReference { // 13. Enter: // $445,850 if single, $250,800 if married filing separately, $501,600 if married filing jointly or qualifying widow(er), $473,750 if head of household. // - l13 = (): number => cutoffAmounts[this.data.filingStatus][1] + l13 = (): number => cutoffAmounts[this.fs()][1] // 14. Enter the smaller of line 1 or line 13 l14 = (): number => Math.min(this.l1(), this.l13()) // 15. Add lines 5 and 9 @@ -103,11 +91,11 @@ export default class QualDivAndCGWorksheetReference { l21 = (): number => (this.l20() * federalBrackets.longTermCapGains.rates[2]) / 100 // 22. Figure the tax on the amount on line 5. If the amount on line 5 is less than $100,000, use the Tax Table to figure the tax. If the amount on line 5 is $100,000 or more, use the Tax Computation Worksheet - l22 = (): number => computeOrdinaryTax(this.data.filingStatus, this.l5()) + l22 = (): number => computeOrdinaryTax(this.fs(), this.l5()) // 23. Add lines 18, 21, and 22 l23 = (): number => this.l18() + this.l21() + this.l22() // 24. Figure the tax on the amount on line 1. If the amount on line 1 is less than $100,000, use the Tax Table to figure the tax. If the amount on line 1 is $100,000 or more, use the Tax Computation Worksheet - l24 = (): number => computeOrdinaryTax(this.data.filingStatus, this.l1()) + l24 = (): number => computeOrdinaryTax(this.fs(), this.l1()) // 25. Tax on all taxable income. Enter the smaller of line 23 or 24. Also include this amount on the entry space on Form 1040 or 1040-SR, line 16. If you are filing Form 2555, don’t enter this amount on the entry space on Form 1040 or 1040-SR, line 16. Instead, enter it on line 4 of the Foreign Earned Income Tax Worksheet l25 = (): number => Math.min(this.l23(), this.l24()) diff --git a/src/forms/Y2021/irsForms/worksheets/SDTaxWorksheet.ts b/src/forms/Y2021/irsForms/worksheets/SDTaxWorksheet.ts new file mode 100644 index 000000000..73450c6af --- /dev/null +++ b/src/forms/Y2021/irsForms/worksheets/SDTaxWorksheet.ts @@ -0,0 +1,40 @@ +import { Worksheet } from '../F1040Attachment' + +export default class SDTaxWorksheet extends Worksheet { + /** + * Complete this worksheet only if line 18 or line 19 of Schedule D is more than zero + * and lines 15 and 16 of Schedule D are gains or if you file Form 4952 and you have + * an amount on line 4g, even if you don’t need to file Schedule D. Otherwise, + * complete the Qualified Dividends and Capital Gain Tax Worksheet in the instructions + * for Forms 1040 and 1040-SR, line 16 (or in the instructions for Form 1040-NR, line 16) + * to figure your tax. Before completing this worksheet, complete Form 1040, 1040-SR, or + * 1040-NR through line 15. + */ + isNeeded = (): boolean => { + const sd = this.f1040.scheduleD + const f4952 = this.f1040.f4952 + + const sdCondition = + sd !== undefined && + ((sd.l18() ?? 0) > 0 || (sd?.l19() ?? 0) > 0) && + sd.l15() > 0 && + sd.l16() > 0 + + const f4952Condition = f4952 !== undefined && (f4952.l4g() ?? 0) > 0 + + return sdCondition || f4952Condition + } + + // TODO - Required by 6251, + // Might be refigured for AMT + l10 = (): number | undefined => undefined + + // TODO - Required by 6251, + l13 = (): number | undefined => undefined + + // TODO - Required by 6251, + l14 = (): number | undefined => undefined + + // TODO - Required by 6251, + l21 = (): number | undefined => undefined +}