<%= include('header', 'Billing 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 .= < $$item{'date_pretty'} $$item{'description'} $$item{'amount'} EOF $col = $col eq $col1 ? $col2 : $col1; } $balance = sprintf('%.2f',$balance); $balance =~ s/^(-?)/$1$money_char/; $out = <Balance: $balance

$out
Date Description Amount
EOF %> <%= include('footer') %>