budget pulls all Cc transactions instead of just credits

This commit is contained in:
2026-04-21 10:37:33 -04:00
parent 2a63b9120e
commit 8c0e4ad684
2 changed files with 2 additions and 8 deletions

View File

@@ -31,10 +31,7 @@ export default async function BudgetsPage({ searchParams }: { searchParams: Sear
JOIN "Account" a ON t."accountId" = a.id
WHERE a."userId" = ${userId}
AND t."budgetId" IS NOT NULL
AND (
(a.type = 'CREDIT_CARD' AND t.type = 'CREDIT')
OR (a.type != 'CREDIT_CARD' AND t.type = 'DEBIT')
)
AND (a.type = 'CREDIT_CARD' OR t.type = 'DEBIT')
AND t.date >= ${start}
AND t.date <= ${end}
GROUP BY t."budgetId"

View File

@@ -46,10 +46,7 @@ export default async function DashboardPage({ searchParams }: { searchParams: Se
JOIN "Account" a ON t."accountId" = a.id
WHERE a."userId" = ${userId}
AND t."budgetId" IS NOT NULL
AND (
(a.type = 'CREDIT_CARD' AND t.type = 'CREDIT')
OR (a.type != 'CREDIT_CARD' AND t.type = 'DEBIT')
)
AND (a.type = 'CREDIT_CARD' OR t.type = 'DEBIT')
AND t.date >= ${start}
AND t.date <= ${end}
GROUP BY t."budgetId"