RT# 82137 - default payment amount now has processing fee in total if processing...
[freeside.git] / httemplate / elements / customer-statement.html
1 <%doc>
2
3 Formats customer payment history into a table.
4
5   include('/elements/customer-statement.html',
6     'history' => \@history
7   );
8
9 Option 'history' should be of the form returned by $cust_main->payment_history.
10 This element might be used directly by selfservice, so it does not (and should not)
11 pull data from the database.
12
13 </%doc>
14
15 % my $style      = 'text-align: left; margin: 0; padding: 0 1em 0 0;';
16 % my $moneystyle = 'text-align: right; margin: 0; padding: 0 1em 0 0;';
17
18 <TABLE STYLE="margin: 0;" CELLSPACING="0">
19   <TR>
20     <TH STYLE="<% $style %> background: #ff9999;">Date</TH>
21     <TH STYLE="<% $style %> background: #ff9999;">Description</TH>
22     <TH STYLE="<% $moneystyle %> background: #ff9999;">Amount</TH>
23     <TH STYLE="<% $moneystyle %> background: #ff9999;">Balance</TH>
24   </TR>
25
26 % my $col1 = "#ffffff";
27 % my $col2 = "#dddddd";
28 % my $col = $col1;
29 % foreach my $item (@{$opt{'history'}}) {
30   <TR>
31     <TD STYLE="<% $style %> background: <% $col %>;"><% $$item{'date_pretty'} %></TD>
32     <TD STYLE="<% $style %> background: <% $col %>;"><% $$item{'description'} %></TD>
33     <TD STYLE="<% $moneystyle %> background: <% $col %>;"><% $$item{'amount_pretty'} %></TD>
34     <TD STYLE="<% $moneystyle %> background: <% $col %>;"><% $$item{'balance_pretty'} %></TD>
35   </TR>
36 %   $col = $col eq $col1 ? $col2 : $col1;
37 % }
38
39 </TABLE>
40
41 <%init>
42 my %opt = @_;
43
44 die "Invalid type for history" unless ref($opt{'history'}) eq 'ARRAY';
45 </%init>