diff --git a/app/main.py b/app/main.py index 2c576a0..301880a 100644 --- a/app/main.py +++ b/app/main.py @@ -274,7 +274,9 @@ PAGE_HTML = """ .range-label { font-size: 12px; color: var(--muted); margin-right: 2px; } .range-btn { cursor: pointer; border: 1px solid var(--border); background: #fff; color: var(--muted); border-radius: 8px; font-size: 12px; font-weight: 600; padding: 5px 12px; } .range-btn.active { background: var(--green-mid); color: #fff; border-color: var(--green-mid); } - .members-all-time .balance-col { display: none; } + .members-all-time .balance-col.allowance-only, + .members-all-time .balance-col.remaining-only { display: none; } + .members-all-time .credits-col-head .mode-note::after { content: " (total purchased)"; } .table-scroll { overflow-x: auto; border-radius: 12px; } .table-scroll table { min-width: 980px; } th.sortable { cursor: pointer; user-select: none; } @@ -322,8 +324,8 @@ PAGE_HTML = """ Status Activated Source - Allowance - Credits + Allowance + Credits Spend Remaining Reset @@ -483,8 +485,11 @@ function renderMembers() { ? 'yes' : 'pending'; const credits = m.credit_balance ?? 0; - const creditsCell = credits > 0 - ? fmt(credits) + const creditsLeft = m.credits_remaining ?? credits; + // Balance view: credits LEFT. All-time view: total purchased. + const creditsShown = memberMode === 'all' ? credits : creditsLeft; + const creditsCell = creditsShown > 0 + ? fmt(creditsShown) : '—'; const src = m.manual ? 'manual' @@ -494,10 +499,10 @@ function renderMembers() { '' + pill + '' + '' + act + '' + '' + src + '' + - '' + fmt(m.balance) + '' + + '' + fmt(m.balance) + '' + '' + creditsCell + '' + '' + fmt(memberSpend(m)) + '' + - '' + fmt(m.remaining) + '' + + '' + fmt(m.remaining) + '' + '' + esc(reset) + '' + '
' + '' +