<%doc> Formats customer payment history into a table. include('/elements/customer-statement.html', 'history' => \@history ); Option 'history' should be of the form returned by $cust_main->payment_history. This element might be used directly by selfservice, so it does not (and should not) pull data from the database. % 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 (@{$opt{'history'}}) { % $col = $col eq $col1 ? $col2 : $col1; % }
Date Description Amount Balance
<% $$item{'date_pretty'} %> <% $$item{'description'} %> <% $$item{'amount_pretty'} %> <% $$item{'balance_pretty'} %>
<%init> my %opt = @_; die "Invalid type for history" unless ref($opt{'history'}) eq 'ARRAY';