From 97e3f51ca9abd337016bd13b60f1e6a50af6c68e Mon Sep 17 00:00:00 2001 From: Marty Bostick Date: Thu, 30 Jul 2026 18:36:15 +0000 Subject: [PATCH] Fix Phase-by-Phase Journey cumulative payout column MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: The 'Cumulative to You' column showed /usr/bin/bash.00 (no gift) or a frozen value (with gift) instead of the actual running total of referral earnings. Fix: - Separate ROI tracking (cumulative until gift cost is recouped) from cumulative payout display (always accumulates across all phases) - Use roiCum/roiRow for ROI tracking, cumRunning for display - 3× L7 Endgame uses 1 cycle (not 0) so its contribution is counted - Highlight phase where ROI is achieved (not the phase after it) L1 Only: 5.48, L2+L1: 3.04, L3+L1: 47.68, L4+L3: 39.28, L5+L4: 05.84, L6: ,527.92, L7: ,795.92, 3×L7: ,767.92 --- index.html | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/index.html b/index.html index 9225393..59c4f9b 100644 --- a/index.html +++ b/index.html @@ -1724,18 +1724,26 @@ ${numPeople > 0 ? ` } let cumRunning = 0; + let roiCum = 0; let roiHit = false; + let roiRow = ''; // phase key where ROI was achieved let rows = ''; for (const k of phases) { const p = HYBRIDS[k]; const yourCut = p.payout * (commPct / 100); - const cyclesNum = p.cycles; + const cyclesNum = k === '3xL7' ? 1 : p.cycles; + // Track cumulative payout (always accumulates — this is the total to sponsor) + cumRunning += yourCut * cyclesNum; + + // Track ROI separately (only when there's a gift cost) if (!roiHit && giftCost > 0) { - for (let i = 0; i < cyclesNum; i++) cumRunning += yourCut; - if (cumRunning >= giftCost) roiHit = true; + roiCum += yourCut * cyclesNum; + if (roiCum >= giftCost) { + roiHit = true; + roiRow = k; + } } - const isRoi = giftCost > 0 && !roiHit ? true : false; - const cls = k === '3xL7' ? 'endgame' : (isRoi && roiHit ? 'highlight' : ''); + const cls = k === '3xL7' ? 'endgame' : (k === roiRow ? 'highlight' : ''); rows += ` ${p.label} ${k === '3xL7' ? 'every 19d' : `${cyclesNum}×`}