summaryrefslogtreecommitdiff
path: root/httemplate/graph
diff options
context:
space:
mode:
authorivan <ivan>2006-03-03 15:02:33 +0000
committerivan <ivan>2006-03-03 15:02:33 +0000
commit02ffd747f8cbc05815c0d96f437c507cfac04ba6 (patch)
treeecf04f1d39079ff5656729a840d6f0b6fe2785e0 /httemplate/graph
parentec3dc4ea9ac60ba99adb6c067452e5aac30957c5 (diff)
agent-specific sales/credit/receipts summary
Diffstat (limited to 'httemplate/graph')
-rwxr-xr-xhttemplate/graph/money_time-graph.cgi7
-rw-r--r--httemplate/graph/money_time.cgi29
2 files changed, 28 insertions, 8 deletions
diff --git a/httemplate/graph/money_time-graph.cgi b/httemplate/graph/money_time-graph.cgi
index bb3d23aae..fc8207a81 100755
--- a/httemplate/graph/money_time-graph.cgi
+++ b/httemplate/graph/money_time-graph.cgi
@@ -12,6 +12,12 @@ my $eyear = $cgi->param('eyear') || 1900+$curyear;
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 @@ my $report = new FS::Report::Table::Monthly (
'start_year' => $syear,
'end_month' => $emonth,
'end_year' => $eyear,
+ 'agentnum' => $agentnum,
);
my %data = %{$report->data};
diff --git a/httemplate/graph/money_time.cgi b/httemplate/graph/money_time.cgi
index 1c7d54266..874f58b09 100644
--- a/httemplate/graph/money_time.cgi
+++ b/httemplate/graph/money_time.cgi
@@ -12,13 +12,23 @@ my $smonth = $cgi->param('smonth') || $curmon+1;
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 @@ my %color = (
'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 @@ my $report = new FS::Report::Table::Monthly (
'start_year' => $syear,
'end_month' => $emonth,
'end_year' => $eyear,
+ 'agentnum' => $agentnum,
);
my $data = $report->data;
@@ -119,6 +130,8 @@ From <SELECT NAME="smonth">
<% } %>
</SELECT>
+for agent: <%= include('/elements/select-agent.html', $agentnum) %>
+
<INPUT TYPE="submit" VALUE="Redisplay">
</FORM>
</BODY>