Accounts in sidebar should be ordered the same as in the accounts summary page #1318

Merged
tonyvince merged 1 commits from fix-1294 into main 2024-10-17 00:09:52 +08:00
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>