Show available balance including activities of this month
This commit is contained in:
@ -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)
|
||||
|
Reference in New Issue
Block a user