From 3b46d452696901ff2dec41125f68c689ecffd5b9 Mon Sep 17 00:00:00 2001 From: Jonathan Prykop Date: Thu, 25 Jun 2015 00:51:02 -0500 Subject: RT#34078: Payment History Report / Statement [refactor to not use msg_template] --- httemplate/elements/customer-statement.html | 45 +++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 httemplate/elements/customer-statement.html (limited to 'httemplate/elements') diff --git a/httemplate/elements/customer-statement.html b/httemplate/elements/customer-statement.html new file mode 100644 index 000000000..63c21cba3 --- /dev/null +++ b/httemplate/elements/customer-statement.html @@ -0,0 +1,45 @@ +<%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; +% } + +
DateDescriptionAmountBalance
<% $$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'; + -- cgit v1.2.1