diff options
| author | Ivan Kohler <ivan@freeside.biz> | 2015-07-26 15:41:26 -0700 |
|---|---|---|
| committer | Ivan Kohler <ivan@freeside.biz> | 2015-07-26 15:41:26 -0700 |
| commit | 9aee669886202be7035e6c6049fc71bc99dd3013 (patch) | |
| tree | 2fd5bf6de74f3d99270587ffb1833e4188a6373d /httemplate/elements/customer-statement.html | |
| parent | ac20214d38d9af00430423f147b5a0e50751b050 (diff) | |
| parent | 1add633372bdca3cc7163c2ce48363fed3984437 (diff) | |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate/elements/customer-statement.html')
| -rw-r--r-- | httemplate/elements/customer-statement.html | 45 |
1 files changed, 45 insertions, 0 deletions
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. + +</%doc> + +% my $style = 'text-align: left; margin: 0; padding: 0 1em 0 0;'; +% my $moneystyle = 'text-align: right; margin: 0; padding: 0 1em 0 0;'; + +<TABLE STYLE="margin: 0;" CELLSPACING="0"> + <TR> + <TH STYLE="<% $style %> background: #ff9999;">Date</TH> + <TH STYLE="<% $style %> background: #ff9999;">Description</TH> + <TH STYLE="<% $moneystyle %> background: #ff9999;">Amount</TH> + <TH STYLE="<% $moneystyle %> background: #ff9999;">Balance</TH> + </TR> + +% my $col1 = "#ffffff"; +% my $col2 = "#dddddd"; +% my $col = $col1; +% foreach my $item (@{$opt{'history'}}) { + <TR> + <TD STYLE="<% $style %> background: <% $col %>;"><% $$item{'date_pretty'} %></TD> + <TD STYLE="<% $style %> background: <% $col %>;"><% $$item{'description'} %></TD> + <TD STYLE="<% $moneystyle %> background: <% $col %>;"><% $$item{'amount_pretty'} %></TD> + <TD STYLE="<% $moneystyle %> background: <% $col %>;"><% $$item{'balance_pretty'} %></TD> + </TR> +% $col = $col eq $col1 ? $col2 : $col1; +% } + +</TABLE> + +<%init> +my %opt = @_; + +die "Invalid type for history" unless ref($opt{'history'}) eq 'ARRAY'; +</%init> |
