fix: use real calendar math for estimateMonths and estimateYear1Cum

- estimateMonths: cycles × daysPer / 30.4 instead of simplified .months
- estimateYear1Cum: track days_left (365) instead of aggregated months
- removes dead variable cycInMonth
- Gift L3 year 1 commissions: ~,085 → ~,113 (honest calendar-based)
- Time to 3×L7 for Gift L3: 12.5mo → 15.0mo (realistic)
This commit is contained in:
Marty Bostick
2026-07-11 10:35:37 +00:00
parent 9fca0fee55
commit 7be4867604
+8 -10
View File
@@ -725,27 +725,25 @@ function getPhaseSequence(effectiveStart) {
}
function estimateMonths(phases) {
let total = 0;
let totalDays = 0;
for (const k of phases) {
if (k === '3xL7') break;
total += HYBRIDS[k].months;
totalDays += HYBRIDS[k].cycles * HYBRIDS[k].daysPer;
}
return Math.round(total * 10) / 10;
return Math.round(totalDays / 30.4 * 10) / 10;
}
function estimateYear1Cum(phases, commPct, giftLevel) {
let cum = 0;
let months = 0;
let daysLeft = 365;
for (const k of phases) {
if (k === '3xL7') break;
const p = HYBRIDS[k];
const yourCut = p.payout * (commPct / 100);
const cycInMonth = p.months / (p.daysPer / 30.4);
const cyclesInYear1 = Math.min(p.cycles, Math.max(0, (12 - months) / (p.months / p.cycles)));
const actual = Math.floor(cyclesInYear1);
for (let i = 0; i < actual; i++) cum += yourCut;
months += p.months;
if (months >= 12) break;
const cyclesFit = Math.min(p.cycles, Math.floor(daysLeft / p.daysPer));
cum += cyclesFit * yourCut;
daysLeft -= cyclesFit * p.daysPer;
if (daysLeft <= 0) break;
}
return Math.round(cum);
}