2017-01-15 16:27:22 +01:00
|
|
|
% title 'Bank statement';
|
|
|
|
|
|
|
|
<table>
|
2017-01-15 22:03:06 +01:00
|
|
|
<tr><th>Date</th><th>Purpose</th><th>Account</th><th>Debit</th><th>Credit</th></tr>
|
2017-01-25 22:38:39 +01:00
|
|
|
% my ($total_credit, $total_debit);
|
2017-01-15 16:27:22 +01:00
|
|
|
% while ( my $record = $records->next ) {
|
2017-01-25 22:38:39 +01:00
|
|
|
% $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>
|
2017-01-15 16:27:22 +01:00
|
|
|
% }
|
2017-01-25 22:38:39 +01:00
|
|
|
<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>
|
2017-01-15 16:27:22 +01:00
|
|
|
</table>
|