mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-05 21:45:23 +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
This commit is contained in:
parent
ee53546c1b
commit
bbcd3881db
4 changed files with 23 additions and 7 deletions
|
@ -11,13 +11,8 @@
|
|||
</div>
|
||||
|
||||
<div>
|
||||
<% transactions_by_currency = group[:transactions].group_by(&:currency) %>
|
||||
<% transactions_by_currency.each_with_index do |(_currency, transactions), idx| %>
|
||||
<%= tag.span format_money(-transactions.sum(&:amount_money)) %>
|
||||
<%= tag.span "|", class: "mx-2" if idx < transactions_by_currency.count - 1 %>
|
||||
<% end %>
|
||||
<%= totals_by_currency(collection: group[:transactions], money_method: :amount_money, negate: true) %>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="bg-white shadow-xs rounded-md border border-alpha-black-25 divide-y divide-alpha-black-50">
|
||||
<%= render group[:transactions] %>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue