X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fsearch%2Freport_prepaid_income.cgi;h=eb8bbb55eb903d2df14624311dea752c46fcf1f6;hp=bcad93325eb2f2270b49db3434e833c9795f7d53;hb=eb9668a6f3181ee02cb335272c5ee4616e61fd09;hpb=55de0fac57f2a71bd05aa5ce583601fb2edeacdf diff --git a/httemplate/search/report_prepaid_income.cgi b/httemplate/search/report_prepaid_income.cgi index bcad93325..eb8bbb55e 100644 --- a/httemplate/search/report_prepaid_income.cgi +++ b/httemplate/search/report_prepaid_income.cgi @@ -5,7 +5,9 @@ #needs to be re-written in sql for efficiency - my $now = time; + my $now = $cgi->param('date') && str2time($cgi->param('date')) || time; + $now =~ /^(\d+)$/ or die "unparsable date?"; + $now = $1; my %prepaid; @@ -35,9 +37,12 @@ } + my @mon = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec); + %> -<%= header('Prepaid Income Report', menubar( 'Main Menu'=>$p, ) ) %> +<%= header( 'Prepaid Income (Unearned Revenue) Report', + menubar( 'Main Menu'=>$p, ) ) %> <%= table() %> <% @@ -52,8 +57,10 @@ for my $mon ( ( $subseq++ ? 1 : $now_mon ) .. 12 ) { if ( $prepaid{"$year-$mon"} ) { $total += $prepaid{"$year-$mon"}; - %> <%= "$year-$mon" %> - <%= sprintf("%.2f", $prepaid{"$year-$mon"} ) %> + %> <%= $mon[$mon-1]. ' '. $year %> + + <%= sprintf("%.2f", $prepaid{"$year-$mon"} ) %> + <% } @@ -62,7 +69,7 @@ } %> -Total<%= sprintf("%.2f", $total) %> +Total<%= sprintf("%.2f", $total) %>