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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user