feat: Add Income Statement to DashboardPage + fix account types

- Add Income Statement section with Revenue and Expenses tables
- Color-code revenue (green) and expenses (red)
- Show Net Income prominently at bottom
- Fix SQL query to use LOWER() for case-insensitive matching
- Update account types in DB (asset/liability/revenue/expense/equity)
- Balance Sheet and Income Statement now work correctly
This commit is contained in:
Bernt
2026-07-29 20:11:13 +00:00
parent f967d1a810
commit f793fc46a4
5 changed files with 138 additions and 74 deletions
+1 -1
View File
@@ -147,7 +147,7 @@ func (c *RobustClient) GetIncomeStatement(ctx context.Context, period string) (*
FROM boc_chart_of_accounts a
LEFT JOIN boc_journal_lines jl ON a.id = jl.account_id
LEFT JOIN boc_journal_entries je ON jl.entry_id = je.id AND je.entry_date >= $1::date AND je.entry_date < ($1::date + INTERVAL '1 month')
WHERE a.account_type IN ('Revenue', 'Expense')
WHERE LOWER(a.account_type) IN ('revenue', 'expense')
GROUP BY a.id, a.account_code, a.name, a.account_type
ORDER BY a.account_code
`, period+"-01")