Skip to content

Commit 4f0ea99

Browse files
Update V7__Reporting_Views.sql
1 parent 4b3e88d commit 4f0ea99

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

db/migration/V7__Reporting_Views.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ WITH account_sums AS (
1515
SELECT
1616
a.code AS account_code,
1717
a.name AS account_name,
18-
a.category,
18+
a.type,
1919
s.total_debit,
2020
s.total_credit,
2121
-- Calculate net balance based on account category rules
2222
CASE
23-
WHEN a.category IN ('ASSET', 'EXPENSE') THEN s.total_debit - s.total_credit
23+
WHEN a.type IN ('asset','expense') THEN s.total_debit - s.total_credit
2424
ELSE s.total_credit - s.total_debit
2525
END AS net_balance
2626
FROM accounts a

0 commit comments

Comments
 (0)