%# locals: (totals:) %> <%# Show Inflow/Outflow labels only when the result set contains exclusively transfers (income and expense are both $0). For mixed filters (e.g. Expense+Transfer), we keep Income/Expenses labels — transfer amounts aren't included in the summary bar in that case, though the transaction list still shows both types. %> <% show_transfers = totals.income_money.zero? && totals.expense_money.zero? && (totals.transfer_inflow_money.amount > 0 || totals.transfer_outflow_money.amount > 0) %>
<%= t("transactions.summary.total_transactions") %>
<%= totals.count.round(0) %>
<%= t("transactions.summary.inflow") %>
<%= (totals.income_money + totals.transfer_inflow_money).format %>
<% else %><%= t("transactions.summary.income") %>
<%= totals.income_money.format %>
<% end %><%= t("transactions.summary.outflow") %>
<%= (totals.expense_money + totals.transfer_outflow_money).format %>
<% else %><%= t("transactions.summary.expenses") %>
<%= totals.expense_money.format %>
<% end %>