1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-24 15:49:39 +02:00

Maintain order (#1318)

This commit is contained in:
Tony Vincent 2024-10-16 17:09:52 +01:00 committed by GitHub
parent f3bb80dde6
commit 76decc06c3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View file

@ -86,7 +86,7 @@ module AccountsHelper
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.children, liabilities.children ].flatten
[ assets.children.sort_by(&:name), liabilities.children.sort_by(&:name) ].flatten
end
private

View file

@ -15,6 +15,6 @@
</div>
</div>
<div class="bg-white border border-alpha-black-25 shadow-xs rounded-lg divide-y divide-alpha-black-50">
<%= render partial: "pages/account_group_disclosure", collection: account_groups.sort_by(&:percent_of_total).reverse, as: :accountable_group %>
<%= render partial: "pages/account_group_disclosure", collection: account_groups.sort_by(&:name), as: :accountable_group %>
</div>
</div>