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