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:
parent
099af14499
commit
9bfdc3efc7
@ -192,6 +192,7 @@ export async function getCategorySummary(tipo: string = 'despesa', monthFilter?:
|
|||||||
// Use the EXACT same query structure as getResumoFinanceiro
|
// Use the EXACT same query structure as getResumoFinanceiro
|
||||||
let query = supabase.from('transacoes').select('categoria, valor, tipo');
|
let query = supabase.from('transacoes').select('categoria, valor, tipo');
|
||||||
|
|
||||||
|
// Apply EXACT same user/group filter as getResumoFinanceiro
|
||||||
if (groupIds.length > 0) {
|
if (groupIds.length > 0) {
|
||||||
const orFilter = `login.eq.${normalizedEmail},grupo_id.in.(${groupIds.map(id => `"${id}"`).join(',')})`;
|
const orFilter = `login.eq.${normalizedEmail},grupo_id.in.(${groupIds.map(id => `"${id}"`).join(',')})`;
|
||||||
query = query.or(orFilter);
|
query = query.or(orFilter);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user