mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-20 21:59:38 +02:00
Exclude inactive accounts from networth calculation and from sidebar (#1432)
This commit is contained in:
parent
e434ed0e1f
commit
154a1a971b
2 changed files with 2 additions and 2 deletions
|
@ -19,7 +19,7 @@ class PagesController < ApplicationController
|
||||||
@top_earners = snapshot_account_transactions[:top_earners]
|
@top_earners = snapshot_account_transactions[:top_earners]
|
||||||
@top_savers = snapshot_account_transactions[:top_savers]
|
@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)
|
@account_groups = @accounts.by_group(period: @period, currency: Current.family.currency)
|
||||||
@transaction_entries = Current.family.entries.account_transactions.limit(6).reverse_chronological
|
@transaction_entries = Current.family.entries.account_transactions.limit(6).reverse_chronological
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ module AccountsHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def account_groups(period: nil)
|
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
|
[ assets.children.sort_by(&:name), liabilities.children.sort_by(&:name) ].flatten
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue