[freeside-commits] freeside/httemplate/graph money_time.cgi, 1.6, 1.7 money_time-graph.cgi, 1.7, 1.8

Ivan,,, ivan at wavetail.420.am
Fri Mar 3 07:02:35 PST 2006


Update of /home/cvs/cvsroot/freeside/httemplate/graph
In directory wavetail:/tmp/cvs-serv27489/httemplate/graph

Modified Files:
	money_time.cgi money_time-graph.cgi 
Log Message:
agent-specific sales/credit/receipts summary

Index: money_time.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/graph/money_time.cgi,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- money_time.cgi	23 Apr 2004 12:19:40 -0000	1.6
+++ money_time.cgi	3 Mar 2006 15:02:33 -0000	1.7
@@ -12,13 +12,23 @@
 my $eyear = $cgi->param('eyear') || 1900+$curyear;
 my $emonth = $cgi->param('emonth') || $curmon+1;
 
+#XXX or virtual
+my( $agentnum, $agent ) = ('', '');
+if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
+  $agentnum = $1;
+  $agent = qsearchs('agent', { 'agentnum' => $agentnum } );
+  die "agentnum $agentnum not found!" unless $agent;
+}
+my $agentname = $agent ? $agent->agent.' ' : '';
+warn $agentname;
+
+%>
+
+<%= include('/elements/header.html',
+              $agentname. 'Sales, Credits and Receipts Summary'
+           )
 %>
 
-<HTML>
-  <HEAD>
-    <TITLE>Sales, Credits and Receipts Summary</TITLE>
-  </HEAD>
-<BODY BGCOLOR="#e8e8e8">
 <IMG SRC="money_time-graph.cgi?<%= $cgi->query_string %>" WIDTH="976" HEIGHT="384">
 <BR>
 
@@ -41,9 +51,9 @@
   '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;",
+  'invoiced' => "${p}search/cust_bill.html?agentnum=$agentnum;",
+  'credits'  => "${p}search/cust_credit.html?agentnum=$agentnum;",
+  'payments' => "${p}search/cust_pay.cgi?magic=_date;agentnum=$agentnum;",
 );
 
 my $report = new FS::Report::Table::Monthly (
@@ -52,6 +62,7 @@
   'start_year'  => $syear,
   'end_month'   => $emonth,
   'end_year'    => $eyear,
+  'agentnum'    => $agentnum,
 );
 my $data = $report->data;
 
@@ -119,6 +130,8 @@
 <% } %>
 </SELECT>
 
+for agent: <%= include('/elements/select-agent.html', $agentnum) %>
+
 <INPUT TYPE="submit" VALUE="Redisplay">
 </FORM>
 </BODY>

Index: money_time-graph.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/graph/money_time-graph.cgi,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- money_time-graph.cgi	23 Apr 2004 12:19:40 -0000	1.7
+++ money_time-graph.cgi	3 Mar 2006 15:02:33 -0000	1.8
@@ -12,6 +12,12 @@
 my $emonth = $cgi->param('emonth') || $curmon+1;
 #if ( $emonth++>12 ) { $emonth-=12; $eyear++; }
 
+# XXX or virtual
+my $agentnum = '';
+if ( $cgi->param('agentnum') =~ /^(\d*)$/ ) {
+  $agentnum = $1;
+}
+
 #my @labels;
 #my %data;
 
@@ -37,6 +43,7 @@
   'start_year'  => $syear,
   'end_month'   => $emonth,
   'end_year'    => $eyear,
+  'agentnum'    => $agentnum,
 );
 my %data = %{$report->data};
 



More information about the freeside-commits mailing list