mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-02 20:15:22 +02:00
Fix parent category sums in budget (#1894)
This commit is contained in:
parent
0dea36ec7d
commit
f5ff5332d5
5 changed files with 104 additions and 30 deletions
|
@ -100,11 +100,11 @@ class Budget < ApplicationRecord
|
|||
end
|
||||
|
||||
def income_category_totals
|
||||
income_totals.category_totals.reject { |ct| ct.category.subcategory? }.sort_by(&:weight).reverse
|
||||
income_totals.category_totals.reject { |ct| ct.category.subcategory? || ct.total.zero? }.sort_by(&:weight).reverse
|
||||
end
|
||||
|
||||
def expense_category_totals
|
||||
expense_totals.category_totals.reject { |ct| ct.category.subcategory? }.sort_by(&:weight).reverse
|
||||
expense_totals.category_totals.reject { |ct| ct.category.subcategory? || ct.total.zero? }.sort_by(&:weight).reverse
|
||||
end
|
||||
|
||||
def current?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue