% title 'Transfer history';

Reverse ordered list:

% while ( my $hr = $history->next ) { % }
TimestampPurpose (own/other/debit)debitcredit
<%= $hr->date %> % my $that = $hr->that_credit; % my $this = $hr->this_credit; % my $credit_ref = begin %== sprintf q{%s%d}, shift() ? ($that->account->ID.q{.}, $that->credId) : (q{}, $this->credId) % end

<%= $hr->billId %>: <%= $hr->purpose %> → <%== $credit_ref->($hr->debit) %>

from <%= $credit_ref->($hr->credit) %>, <%= $hr->credit ? $that->purpose : $this->purpose %> % if ( $hr->note ) {
Note: <%= $hr->note %> % }

<%== money $hr->debit %><%== money $hr->credit %>
%= include 'filter-widget'