freeside/httemplate/graph money_time.cgi,1.5,1.6 money_time-graph.cgi,1.6,1.7

ivan ivan at pouncequick.420.am
Fri Apr 23 05:19:44 PDT 2004


Update of /home/cvs/cvsroot/freeside/httemplate/graph
In directory pouncequick:/tmp/cvs-serv28951/httemplate/graph

Modified Files:
	money_time.cgi money_time-graph.cgi 
Log Message:
credit report, add some links to sales/credits/receipts summary, move payment search to template

Index: money_time.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/graph/money_time.cgi,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- money_time.cgi	12 Mar 2004 12:11:58 -0000	1.5
+++ money_time.cgi	23 Apr 2004 12:19:40 -0000	1.6
@@ -25,19 +25,26 @@
 <%= table('e8e8e8') %>
 <%
 
-my @items = qw( invoiced netsales credits receipts );
+my @items = qw( invoiced netsales credits payments receipts );
 my %label = (
   'invoiced' => 'Gross Sales',
   'netsales' => 'Net Sales',
   'credits'  => 'Credits',
-  'receipts' => 'Receipts',
+  'payments' => 'Gross Receipts',
+  'receipts' => 'Net Receipts',
 );
 my %color = (
   'invoiced' => '9999ff', #light blue
   'netsales' => '0000cc', #blue
   'credits'  => 'cc0000', #red
+  'payments' => '99cc99', #light green
   'receipts' => '00cc00', #green
 );
+my %link = (
+  'invoiced' => "${p}search/cust_bill.html?",
+  'credits'  => "${p}search/cust_credit.html?",
+  'payments' => "${p}search/cust_pay.cgi?magic=_date;",
+);
 
 my $report = new FS::Report::Table::Monthly (
   'items' => \@items,
@@ -48,7 +55,6 @@
 );
 my $data = $report->data;
 
-
 my @mon = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
 
 %>
@@ -64,9 +70,15 @@
 
 <% foreach my $row (@items) { %>
   <TR><TH><FONT COLOR="#<%= $color{$row} %>"><%= $label{$row} %></FONT></TH>
+  <% my $link = exists($link{$row})
+       ? qq(<A HREF="$link{$row})
+       : '';
+     my @speriod = @{$data->{speriod}};
+     my @eperiod = @{$data->{eperiod}};
+  %>
   <% foreach my $column ( @{$data->{$row}} ) { %>
     <TD ALIGN="right" BGCOLOR="#ffffff">
-      <FONT COLOR="#<%= $color{$row} %>">$<%= sprintf("%.2f", $column) %></FONT>
+      <%= $link ? $link. 'begin='. shift(@speriod). ';end='. shift(@eperiod). '">' : '' %><FONT COLOR="#<%= $color{$row} %>">$<%= sprintf("%.2f", $column) %></FONT><%= $link ? '</A>' : '' %>
     </TD>
   <% } %>
   </TR>

Index: money_time-graph.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/graph/money_time-graph.cgi,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- money_time-graph.cgi	5 Mar 2004 14:34:24 -0000	1.6
+++ money_time-graph.cgi	23 Apr 2004 12:19:40 -0000	1.7
@@ -15,17 +15,19 @@
 #my @labels;
 #my %data;
 
-my @items = qw( invoiced netsales credits receipts );
+my @items = qw( invoiced netsales credits payments receipts );
 my %label = (
  'invoiced' => 'Gross Sales (invoiced)', 
  'netsales' => 'Net Sales (invoiced - applied credits)',
  'credits'  => 'Credits',
- 'receipts' => 'Receipts/Cashflow (payments - refunds)',
+ 'payments' => 'Gross Receipts (payments)',
+ 'receipts' => 'Net Receipts/Cashflow (payments - refunds)',
 );
 my %color = (
   'invoiced' => [ 153, 153, 255 ], #light blue
   'netsales' => [   0,   0, 204 ], #blue
   'credits'  => [ 204,   0,   0 ], #red
+  'payments' => [ 153, 204, 153 ], #light green
   'receipts' => [   0, 204,   0 ], #green
 );
 




More information about the freeside-commits mailing list