From 825eff7053e1110a7949297433c2e9b4683ae313 Mon Sep 17 00:00:00 2001 From: Inferencebot Date: Fri, 13 Nov 2026 21:44:14 +0000 Subject: [PATCH] card: read the portal's all-time spend, the number the dashboard shows too MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Kept the panel's own 'co-op's own share' line — that is the operator-account breakdown only this app can see. The headline figure is now the shared one. --- app/main.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/main.py b/app/main.py index 83ebfe0..0d289e3 100644 --- a/app/main.py +++ b/app/main.py @@ -676,7 +676,9 @@ async function load() { const d = await r.json(); $('tot-members').textContent = d.totals.members; $('tot-spend-cycle').textContent = fmt(d.totals.total_spend); - $('tot-spend-all').textContent = fmt(d.totals.total_all_time_spend ?? d.totals.total_spend); + // One number, the portal's own all-time spend (the shared helper behind the + // money payload and the member dashboard's card). + $('tot-spend-all').textContent = fmt(d.totals.spend_all_time ?? d.totals.total_all_time_spend ?? d.totals.total_spend); // Break out the co-op's OWN (operator) portion of each total. These totals // span members AND the co-op's own accounts, so the share is spelled out // rather than left for the reader to guess. @@ -696,7 +698,7 @@ async function load() { $('tot-members').textContent = newShape ? (t.members ?? membersData.length) : ((t.members ?? allRows.length) - guestsData.length); $('tot-guests').textContent = guestsData.length; $('tot-spend-cycle').textContent = fmt((t.total_spend ?? 0) - (newShape ? 0 : gSpend)); - $('tot-spend-all').textContent = fmt((t.total_all_time_spend ?? t.total_spend ?? 0) - (newShape ? 0 : gAll)); + $('tot-spend-all').textContent = fmt(t.spend_all_time ?? ((t.total_all_time_spend ?? t.total_spend ?? 0) - (newShape ? 0 : gAll))); adminsData = d.admins || []; agentsData = d.agents || []; if (currentView === 'members') renderMembers();