X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fpayment_history.html;h=4f46ace6d5b570d9831316cff36a20c97ee15926;hb=942b10d6477c70fa2f23c909c9bb0ee19eb9b959;hp=4e4cd154f22fe07c51068ffeed7eddd4e2136c0f;hpb=1f0ac8cfa1653f578c498835f9a20851f2cb16ac;p=freeside.git 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); +%}