projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
This commit was generated by cvs2svn to compensate for changes in r3241,
[freeside.git]
/
httemplate
/
search
/
report_prepaid_income.cgi
diff --git
a/httemplate/search/report_prepaid_income.cgi
b/httemplate/search/report_prepaid_income.cgi
index
f1d284b
..
eb8bbb5
100644
(file)
--- 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
#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;
my %prepaid;
@@
-30,13
+32,17
@@
foreach my $which_month ( 2 .. $freq ) {
until ( $mon < 13 ) { $mon -= 12; $year++; }
$prepaid{"$year-$mon"} += $per_month;
foreach my $which_month ( 2 .. $freq ) {
until ( $mon < 13 ) { $mon -= 12; $year++; }
$prepaid{"$year-$mon"} += $per_month;
+ $mon++;
}
}
}
}
+ 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() %>
<%
<%= table() %>
<%
@@
-51,8
+57,10
@@
for my $mon ( ( $subseq++ ? 1 : $now_mon ) .. 12 ) {
if ( $prepaid{"$year-$mon"} ) {
$total += $prepaid{"$year-$mon"};
for my $mon ( ( $subseq++ ? 1 : $now_mon ) .. 12 ) {
if ( $prepaid{"$year-$mon"} ) {
$total += $prepaid{"$year-$mon"};
- %> <TR><TD><%= "$year-$mon" %></TD>
- <TD><%= sprintf("%.2f", $prepaid{"$year-$mon"} ) %></TD>
+ %> <TR><TD ALIGN="right"><%= $mon[$mon-1]. ' '. $year %></TD>
+ <TD ALIGN="right">
+ <%= sprintf("%.2f", $prepaid{"$year-$mon"} ) %>
+ </TD>
</TR>
<%
}
</TR>
<%
}
@@
-61,7
+69,7
@@
}
%>
}
%>
-<TR><TH>Total</TH><TD><%= sprintf("%.2f", $total) %></TD></TR>
+<TR><TH>Total</TH><TD
ALIGN="right"
><%= sprintf("%.2f", $total) %></TD></TR>
</TABLE>
</BODY>
</HTML>
</TABLE>
</BODY>
</HTML>