summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorivan <ivan>2006-11-05 15:55:53 +0000
committerivan <ivan>2006-11-05 15:55:53 +0000
commit942b10d6477c70fa2f23c909c9bb0ee19eb9b959 (patch)
tree09ae1f3a6ee23991f427af1c8e74a1ab3be9b23e /httemplate
parent1f0ac8cfa1653f578c498835f9a20851f2cb16ac (diff)
fix but with no "show prior history" showing up when everything is hidden
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/view/cust_main/payment_history.html54
1 files changed, 32 insertions, 22 deletions
diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html
index 4e4cd154f..4f46ace6d 100644
--- a/httemplate/view/cust_main/payment_history.html
+++ b/httemplate/view/cust_main/payment_history.html
@@ -400,6 +400,31 @@
%
%#display payment history
%
+%sub balance_forward_row {
+% my( $b, $date ) = @_;
+% my $conf = new FS::Conf;
+% my $money_char = $conf->config('money_char') || '$';
+% ( my $balance_forward = $money_char. $b ) =~ s/^\$\-/-&nbsp;\$/;
+
+ <TR ID="balance_forward_row">
+ <TD CLASS="grid" BGCOLOR="#dddddd">
+ <% time2str("%D",$date) %>
+ </TD>
+
+ <TD CLASS="grid" BGCOLOR="#dddddd">
+ <I>Starting balance on <% time2str("%D",$date) %></I>
+ (<A HREF="javascript:void(0);" onClick="show_history();">show prior history</A>)
+ </TD>
+
+ <TD CLASS="grid" BGCOLOR="#dddddd"></TD>
+ <TD CLASS="grid" BGCOLOR="#dddddd"></TD>
+ <TD CLASS="grid" BGCOLOR="#dddddd"></TD>
+ <TD CLASS="grid" BGCOLOR="#dddddd"></TD>
+ <TD CLASS="grid" BGCOLOR="#dddddd"><I><% $balance_forward %></I></TD>
+
+ </TR>
+%}
+%
%my $balance = 0;
%my %target = ();
%my $money_char = $conf->config('money_char') || '$';
@@ -409,9 +434,12 @@
%my $hidden = 0;
%my $seen = 0;
%my $old_history = 0;
+%my $lastdate = 0;
%
%foreach my $item ( sort { $a->{'date'} <=> $b->{'date'} } @history ) {
%
+% $lastdate = $item->{'date'};
+%
% my $display;
% if ( $item->{'date'} < $older_than ) {
% $display = ' STYLE="display:none" ';
@@ -421,28 +449,7 @@
% $display = '';
%
% if ( $hidden && ! $seen++ ) {
-% ( my $balance_forward = $money_char. $balance ) =~ s/^\$\-/-&nbsp;\$/;
-%
-
-
- <TR ID="balance_forward_row">
- <TD CLASS="grid" BGCOLOR="#dddddd">
- <% time2str("%D",$item->{'date'}) %>
- </TD>
-
- <TD CLASS="grid" BGCOLOR="#dddddd">
- <I>Starting balance on <% time2str("%D",$item->{'date'}) %></I>
- (<A HREF="javascript:void(0);" onClick="show_history();">show prior history</A>)
- </TD>
-
- <TD CLASS="grid" BGCOLOR="#dddddd"></TD>
- <TD CLASS="grid" BGCOLOR="#dddddd"></TD>
- <TD CLASS="grid" BGCOLOR="#dddddd"></TD>
- <TD CLASS="grid" BGCOLOR="#dddddd"></TD>
- <TD CLASS="grid" BGCOLOR="#dddddd"><I><% $balance_forward %></I></TD>
-
- </TR>
-%
+% balance_forward_row($balance, $item->{'date'});
% }
%
% }
@@ -523,6 +530,9 @@
</TR>
% }
+%if ( scalar(@history) && $hidden && ! $seen++ ) {
+% balance_forward_row($balance, $lastdate);
+%}
</TABLE>