Fix: Category totals mismatch with dashboard

Ensured the Categories page sums all transactions, resolving the discrepancy between category totals and the dashboard's total expenses.
This commit is contained in:
gpt-engineer-app[bot] 2025-06-25 18:50:12 +00:00
parent 099af14499
commit 9bfdc3efc7

View File

@ -192,6 +192,7 @@ export async function getCategorySummary(tipo: string = 'despesa', monthFilter?:
// Use the EXACT same query structure as getResumoFinanceiro
let query = supabase.from('transacoes').select('categoria, valor, tipo');
// Apply EXACT same user/group filter as getResumoFinanceiro
if (groupIds.length > 0) {
const orFilter = `login.eq.${normalizedEmail},grupo_id.in.(${groupIds.map(id => `"${id}"`).join(',')})`;
query = query.or(orFilter);