From 942b10d6477c70fa2f23c909c9bb0ee19eb9b959 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 5 Nov 2006 15:55:53 +0000 Subject: [PATCH] fix but with no "show prior history" showing up when everything is hidden --- httemplate/view/cust_main/payment_history.html | 54 +++++++++++++++----------- 1 file 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/^\$\-/- \$/; + + + + <% time2str("%D",$date) %> + + + + Starting balance on <% time2str("%D",$date) %> + (show prior history) + + + + + + + <% $balance_forward %> + + +%} +% %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/^\$\-/- \$/; -% - - - - - <% time2str("%D",$item->{'date'}) %> - - - - Starting balance on <% time2str("%D",$item->{'date'}) %> - (show prior history) - - - - - - - <% $balance_forward %> - - -% +% balance_forward_row($balance, $item->{'date'}); % } % % } @@ -523,6 +530,9 @@ % } +%if ( scalar(@history) && $hidden && ! $seen++ ) { +% balance_forward_row($balance, $lastdate); +%} -- 2.11.0