[freeside-commits] freeside/httemplate/view/cust_main
payment_history.html, 1.16, 1.17
Ivan,,,
ivan at wavetail.420.am
Sun Nov 5 07:55:55 PST 2006
Update of /home/cvs/cvsroot/freeside/httemplate/view/cust_main
In directory wavetail:/tmp/cvs-serv21256
Modified Files:
payment_history.html
Log Message:
fix but with no "show prior history" showing up when everything is hidden
Index: payment_history.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_main/payment_history.html,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- payment_history.html 15 Sep 2006 19:16:37 -0000 1.16
+++ payment_history.html 5 Nov 2006 15:55:53 -0000 1.17
@@ -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/^\$\-/- \$/;
+
+ <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/^\$\-/- \$/;
-%
-
-
- <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>
More information about the freeside-commits
mailing list