Skip to content

armgit / maybe

Public Imported from GitHub
0

The personal finance app for everyone

Exclude inactive accounts from networth calculation and from sidebar (#1432)

Tony Vincent154a1a971b99
diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb
index 9af9d663..79e30f25 100644
--- a/app/controllers/pages_controller.rb
+++ b/app/controllers/pages_controller.rb
@@ -19,7 +19,7 @@ class PagesController < ApplicationController
@top_earners = snapshot_account_transactions[:top_earners]
@top_savers = snapshot_account_transactions[:top_savers]
- @accounts = Current.family.accounts
+ @accounts = Current.family.accounts.active
@account_groups = @accounts.by_group(period: @period, currency: Current.family.currency)
@transaction_entries = Current.family.entries.account_transactions.limit(6).reverse_chronological
diff --git a/app/helpers/accounts_helper.rb b/app/helpers/accounts_helper.rb
index 357ec1da..24179b85 100644
--- a/app/helpers/accounts_helper.rb
+++ b/app/helpers/accounts_helper.rb
@@ -52,7 +52,7 @@ module AccountsHelper
end
def account_groups(period: nil)
- assets, liabilities = Current.family.accounts.by_group(currency: Current.family.currency, period: period || Period.last_30_days).values_at(:assets, :liabilities)
+ assets, liabilities = Current.family.accounts.active.by_group(currency: Current.family.currency, period: period || Period.last_30_days).values_at(:assets, :liabilities)
[ assets.children.sort_by(&:name), liabilities.children.sort_by(&:name) ].flatten
end