budget pulls all Cc transactions instead of just credits
This commit is contained in:
@@ -31,10 +31,7 @@ export default async function BudgetsPage({ searchParams }: { searchParams: Sear
|
|||||||
JOIN "Account" a ON t."accountId" = a.id
|
JOIN "Account" a ON t."accountId" = a.id
|
||||||
WHERE a."userId" = ${userId}
|
WHERE a."userId" = ${userId}
|
||||||
AND t."budgetId" IS NOT NULL
|
AND t."budgetId" IS NOT NULL
|
||||||
AND (
|
AND (a.type = 'CREDIT_CARD' OR t.type = 'DEBIT')
|
||||||
(a.type = 'CREDIT_CARD' AND t.type = 'CREDIT')
|
|
||||||
OR (a.type != 'CREDIT_CARD' AND t.type = 'DEBIT')
|
|
||||||
)
|
|
||||||
AND t.date >= ${start}
|
AND t.date >= ${start}
|
||||||
AND t.date <= ${end}
|
AND t.date <= ${end}
|
||||||
GROUP BY t."budgetId"
|
GROUP BY t."budgetId"
|
||||||
|
|||||||
@@ -46,10 +46,7 @@ export default async function DashboardPage({ searchParams }: { searchParams: Se
|
|||||||
JOIN "Account" a ON t."accountId" = a.id
|
JOIN "Account" a ON t."accountId" = a.id
|
||||||
WHERE a."userId" = ${userId}
|
WHERE a."userId" = ${userId}
|
||||||
AND t."budgetId" IS NOT NULL
|
AND t."budgetId" IS NOT NULL
|
||||||
AND (
|
AND (a.type = 'CREDIT_CARD' OR t.type = 'DEBIT')
|
||||||
(a.type = 'CREDIT_CARD' AND t.type = 'CREDIT')
|
|
||||||
OR (a.type != 'CREDIT_CARD' AND t.type = 'DEBIT')
|
|
||||||
)
|
|
||||||
AND t.date >= ${start}
|
AND t.date >= ${start}
|
||||||
AND t.date <= ${end}
|
AND t.date <= ${end}
|
||||||
GROUP BY t."budgetId"
|
GROUP BY t."budgetId"
|
||||||
|
|||||||
Reference in New Issue
Block a user