treasuredb/templates/bankStatement.html.ep
2017-01-29 16:08:28 +01:00

15 lines
736 B
Plaintext

% title 'Bank statement';
<table>
<tr><th>Date</th><th>Purpose</th><th>Account</th><th>Debit</th><th>Credit</th></tr>
% my ($total_credit, $total_debit);
% while ( my $record = $records->next ) {
% $total_credit += $record->credit;
% $total_debit += $record->debit;
<tr><td><%= $record->date %></td><td><%= $record->purpose %></td><td><%= $record->account %></td><td class="number"><%== money $record->debit %></td><td class="number"><%== money $record->credit %></td></tr>
% }
<tr><td colspan="3" style="text-align:right;">Current balance:</td><td class="number"><%== $total_debit ? money $total_debit : '' %></td><td class="number"><%== $total_credit ? money $total_credit : '' %></td>
</table>
%= include 'filter-widget'