blob: 605bc1cf52ce07bd816add3945db09cbcb5f6b50 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
<%= include('header', 'Payment History') %>
<%=
my $balance = 0;
my $style = 'text-align: left; margin: 0; padding: 0 1em 0 0;';
my $moneystyle = 'text-align: right; margin: 0; padding: 0 1em 0 0;';
my $col1 = "#ffffff";
my $col2 = "#dddddd";
my $col = $col1;
foreach my $item (@history) {
$balance += $$item{'amount'};
$$item{'amount'} =~ s/^(-?)/$1$money_char/;
$out .= <<EOF;
<TR>
<TD style="$style background: $col;">$$item{'date_pretty'}</TD>
<TD style="$style background: $col;">$$item{'description'}</TD>
<TD style="$moneystyle background: $col;">$$item{'amount'}</TD>
</TR>
EOF
$col = $col eq $col1 ? $col2 : $col1;
}
$balance = sprintf('%.2f',$balance);
$balance =~ s/^(-?)/$1$money_char/;
$out = <<EOF;
<P>Balance: <B>$balance</B></P>
<TABLE style="margin: 0;" CELLSPACING="0">
<TR>
<TH style="$style background: #ff9999;">Date</TH>
<TH style="$style background: #ff9999;">Description</TH>
<TH style="$moneystyle background: #ff9999;">Amount</TH>
</TR>
$out
</TABLE>
EOF
%>
</TABLE>
<%= include('footer') %>
|