Show available balance including activities of this month

This commit is contained in:
2021-12-07 21:32:36 +00:00
parent a19d3d6932
commit edd1319222
4 changed files with 18 additions and 18 deletions

View File

@ -26,16 +26,16 @@ SELECT categories.id, categories.name, category_groups.name as group,
SELECT SUM(a_hist.amount)
FROM assignments a_hist
WHERE categories.id = a_hist.category_id
AND a_hist.date < @from_date
AND a_hist.date < @to_date
)
, 0)+COALESCE(
(
SELECT SUM(t_hist.amount)
FROM transactions t_hist
WHERE categories.id = t_hist.category_id
AND t_hist.date < @from_date
AND t_hist.date < @to_date
)
, 0))::decimal(12,2) as balance,
, 0))::decimal(12,2) as available,
COALESCE(
(
SELECT SUM(t_this.amount)