add prepaid income to main menu and allow arbitrary dates
authorivan <ivan>
Fri, 23 Jan 2004 11:20:43 +0000 (11:20 +0000)
committerivan <ivan>
Fri, 23 Jan 2004 11:20:43 +0000 (11:20 +0000)
httemplate/index.html
httemplate/search/report_prepaid_income.cgi
httemplate/search/report_prepaid_income.html [new file with mode: 0644]

index 548c25c..2d4f6b5 100644 (file)
@@ -69,6 +69,7 @@
             </UL>
       <A HREF="search/report_cust_pay.html">Payment report (by type and/or date range)</A>
       <BR><BR><A HREF="search/report_receivables.cgi">Accounts Receivable Aging Summary</A>
             </UL>
       <A HREF="search/report_cust_pay.html">Payment report (by type and/or date range)</A>
       <BR><BR><A HREF="search/report_receivables.cgi">Accounts Receivable Aging Summary</A>
+      <BR><BR><A HREF="search/report_prepaid_income.html">Prepaid Income (Unearned Revenue) Report</A>
       <BR><BR>(old) Financial reports (being rewritten)
             <UL>
               <LI> <A HREF="search/report_tax.html">tax reports</A>
       <BR><BR>(old) Financial reports (being rewritten)
             <UL>
               <LI> <A HREF="search/report_tax.html">tax reports</A>
index 9f04573..eb8bbb5 100644 (file)
@@ -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;
 
@@ -39,7 +41,8 @@
 
 %>
 
 
 %>
 
-<%= header('Prepaid Income Report', menubar( 'Main Menu'=>$p, ) ) %>
+<%= header( 'Prepaid Income (Unearned Revenue) Report',
+            menubar( 'Main Menu'=>$p, ) )               %>
 <%= table() %>
 <%
 
 <%= table() %>
 <%
 
@@ -54,7 +57,7 @@
     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><%= $mon[$mon-1]. ' '. $year %></TD>
+        %> <TR><TD ALIGN="right"><%= $mon[$mon-1]. ' '. $year %></TD>
                <TD ALIGN="right">
                  <%= sprintf("%.2f", $prepaid{"$year-$mon"} ) %>
                </TD>
                <TD ALIGN="right">
                  <%= sprintf("%.2f", $prepaid{"$year-$mon"} ) %>
                </TD>
diff --git a/httemplate/search/report_prepaid_income.html b/httemplate/search/report_prepaid_income.html
new file mode 100644 (file)
index 0000000..b85a481
--- /dev/null
@@ -0,0 +1,17 @@
+<HTML>
+  <HEAD>
+    <TITLE>Prepaid Income (Unearned Revenue) Report</TITLE>
+    <LINK REL="stylesheet" TYPE="text/css" HREF="../elements/calendar-win2k-2.css" TITLE="win2k-2">
+    <SCRIPT TYPE="text/javascript" SRC="../elements/calendar_stripped.js"></SCRIPT>
+    <SCRIPT TYPE="text/javascript" SRC="../elements/calendar-en.js"></SCRIPT>
+    <SCRIPT TYPE="text/javascript" SRC="../elements/calendar-setup.js"></SCRIPT>
+  </HEAD>
+  <BODY BGCOLOR="#e8e8e8">
+    <H1>Prepaid Income (Unearned Revenue) Report</H1>
+    <FORM ACTION="report_prepaid_income.cgi" METHOD="post">
+    Prepaid income (unearned revenue) as of <INPUT TYPE="text" NAME="date" VALUE="now">
+    <INPUT TYPE="submit" VALUE="Generate report">
+  </BODY>
+</HTML>
+    <TABLE>
+