% title 'Outcome of ' . $account;

Listed in reverse order:

% while ( my $debit = $debits->next ) { % my $tgt = $debit->target; % }
IdDatePurposevaluepaidto
<%= $debit->billId %><%= $debit->date %><%== nl2br $debit->purpose %><%== money $debit->value %>"><%== money $debit->paid %> % if ( $tgt ) { <%= $tgt->account->ID %> % } % else { (outgoing) % }
%= include 'filter-widget'