From 8c0e4ad684be6966c971f5490d372ba3f88530e6 Mon Sep 17 00:00:00 2001 From: jerick Date: Tue, 21 Apr 2026 10:37:33 -0400 Subject: [PATCH] budget pulls all Cc transactions instead of just credits --- src/app/(app)/budgets/page.tsx | 5 +---- src/app/(app)/dashboard/page.tsx | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/app/(app)/budgets/page.tsx b/src/app/(app)/budgets/page.tsx index 6c0ecc5..d52e5b4 100644 --- a/src/app/(app)/budgets/page.tsx +++ b/src/app/(app)/budgets/page.tsx @@ -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" diff --git a/src/app/(app)/dashboard/page.tsx b/src/app/(app)/dashboard/page.tsx index 7b00f0d..9adef9a 100644 --- a/src/app/(app)/dashboard/page.tsx +++ b/src/app/(app)/dashboard/page.tsx @@ -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"