We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4b3e88d commit 4f0ea99Copy full SHA for 4f0ea99
1 file changed
db/migration/V7__Reporting_Views.sql
@@ -15,12 +15,12 @@ WITH account_sums AS (
15
SELECT
16
a.code AS account_code,
17
a.name AS account_name,
18
- a.category,
+ a.type,
19
s.total_debit,
20
s.total_credit,
21
-- Calculate net balance based on account category rules
22
CASE
23
- WHEN a.category IN ('ASSET', 'EXPENSE') THEN s.total_debit - s.total_credit
+ WHEN a.type IN ('asset','expense') THEN s.total_debit - s.total_credit
24
ELSE s.total_credit - s.total_debit
25
END AS net_balance
26
FROM accounts a
0 commit comments