mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-06 05:55:21 +02:00
* Fix #910 * Unify helper for balance formatting in transactions and accounts views * Remove obsolete method * Rename helper method format_amount_by_curreny => totals_by_currency
17 lines
641 B
Text
17 lines
641 B
Text
<%# locals: (accounts:) %>
|
|
|
|
<% accounts.group_by(&:accountable_type).each do |group, accounts| %>
|
|
<div class="bg-gray-25 p-1 rounded-xl">
|
|
<div class="flex items-center px-4 py-2 text-xs font-medium text-gray-500">
|
|
<p><%= to_accountable_title(Accountable.from_type(group)) %></p>
|
|
<span class="text-gray-400 mx-2">·</span>
|
|
<p><%= accounts.count %></p>
|
|
<p class="ml-auto"><%= totals_by_currency(collection: accounts, money_method: :balance_money) %></p>
|
|
</div>
|
|
<div class="bg-white">
|
|
<% accounts.each do |account| %>
|
|
<%= render account %>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
<% end %>
|