Skip to content

Commit e79fb86

Browse files
[Hotfix] roth conversion not on if set to no on
Co-authored-by: Adrian Heath <adrian.heath@stonybrook.edu>
1 parent b462ce5 commit e79fb86

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

server/computation/simulationHelper.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,6 @@ export function calculateTaxes(federalIncomeTax, stateIncomeTax, capitalGainTax,
560560
break;
561561
}
562562
else {
563-
console.log(bracket.upperBound)
564563
if (bracket.upperBound < curYearStateTaxableIncome && bracket.upperBound!==0) {
565564

566565
sIncomeTax += (bracket.upperBound - bracket.lowerBound) * bracket.rate;

server/computation/simulator.js

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -253,21 +253,27 @@ export async function simulate(
253253

254254
curYearIncome += rmd;
255255
}
256-
256+
257257
curYearIncome += await updateInvestments(investmentTypes);
258258

259-
const rothConversion = await performRothConversion(
260-
curYearIncome,
261-
curYearSS,
262-
federalIncomeTax,
263-
currentYear,
264-
scenario.userBirthYear,
265-
scenario.orderedRothStrategy,
266-
investmentTypes
267-
);
259+
let rothConversion = {curYearIncome: 0, curYearEarlyWithdrawals: 0}
260+
if(scenario.startYearRothOptimizer!==undefined
261+
&& scenario.startYearRothOptimizer<=realYear+currentYear
262+
&& scenario.endYearRothOptimizer!==undefined
263+
&& scenario.endYearRothOptimizer>=realYear+currentYear
264+
){
265+
rothConversion = await performRothConversion(
266+
curYearIncome,
267+
curYearSS,
268+
federalIncomeTax,
269+
currentYear,
270+
scenario.userBirthYear,
271+
scenario.orderedRothStrategy,
272+
investmentTypes
273+
);
274+
}
268275

269276
curYearIncome += rothConversion.curYearIncome;
270-
271277
let earlyWithdrawalTaxPaid = 0;
272278
const calcTaxReturn = calculateTaxes(
273279
federalIncomeTax,

0 commit comments

Comments
 (0)