summaryrefslogtreecommitdiff
path: root/httemplate/graph
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2012-12-31 14:03:43 -0800
committerMark Wells <mark@freeside.biz>2012-12-31 14:03:43 -0800
commitc7286ce9036d71665c2bfed9de93f87309b72d35 (patch)
tree59ef48f8fd7688cf7039a0d2e5500b84ae076543 /httemplate/graph
parenta14db43cc4ec18badd0aff4fbc3e6738f4f63f6c (diff)
filter by customer class on all financial reports, #20573
Diffstat (limited to 'httemplate/graph')
-rw-r--r--httemplate/graph/cust_bill_pkg.cgi8
-rw-r--r--httemplate/graph/elements/monthly.html2
-rw-r--r--httemplate/graph/money_time.cgi7
-rw-r--r--httemplate/graph/money_time_daily.cgi6
-rw-r--r--httemplate/graph/report_cust_bill_pkg.html6
-rw-r--r--httemplate/graph/report_money_time.html5
-rw-r--r--httemplate/graph/report_money_time_daily.html5
7 files changed, 39 insertions, 0 deletions
diff --git a/httemplate/graph/cust_bill_pkg.cgi b/httemplate/graph/cust_bill_pkg.cgi
index c334ae9e7..91bedf3fe 100644
--- a/httemplate/graph/cust_bill_pkg.cgi
+++ b/httemplate/graph/cust_bill_pkg.cgi
@@ -13,6 +13,7 @@
'bottom_total' => 1,
'bottom_link' => $bottom_link,
'agentnum' => $agentnum,
+ 'cust_classnum'=> \@cust_classnums,
)
%>
<%init>
@@ -68,6 +69,9 @@ $title .= $sel_part_referral->referral.' '
$title .= 'Sales Report (Gross)';
$title .= ', average per customer package' if $average_per_cust_pkg;
+my @cust_classnums = grep /^\d+$/, $cgi->param('cust_classnum');
+$bottom_link .= "cust_classnum=$_;" foreach @cust_classnums;
+
#classnum (here)
# 0: all classes
# not specified: empty class
@@ -188,6 +192,7 @@ foreach my $agent ( $all_agent || $sel_agent || qsearch('agent', { 'disabled' =>
push @links, "$link;".
($all_agent ? '' : "agentnum=$row_agentnum;").
($all_part_referral ? '' : "refnum=$row_refnum;").
+ (join('',map {"cust_classnum=$_;"} @cust_classnums)).
($all_class ? '' : "classnum=$row_classnum;").
"distribute=$distribute;".
"use_override=$use_override;charges=$component;";
@@ -209,6 +214,7 @@ foreach my $agent ( $all_agent || $sel_agent || qsearch('agent', { 'disabled' =>
my $component = join('', @components);
my @row_params = ( 'agentnum' => $row_agentnum,
+ 'cust_classnum' => \@cust_classnums,
'use_override' => $use_override,
'average_per_cust_pkg' => $average_per_cust_pkg,
'distribute' => $distribute,
@@ -231,6 +237,8 @@ foreach my $agent ( $all_agent || $sel_agent || qsearch('agent', { 'disabled' =>
$row_link .= ";refnum=".$sel_part_referral->refnum;
}
+ $row_link .= ";cust_classnum=$_" foreach @cust_classnums;
+
push @items, 'cust_bill_pkg';
push @labels, mt('[_1] - Subtotal', $agent->agent);
push @params, \@row_params;
diff --git a/httemplate/graph/elements/monthly.html b/httemplate/graph/elements/monthly.html
index c736de696..939f18a35 100644
--- a/httemplate/graph/elements/monthly.html
+++ b/httemplate/graph/elements/monthly.html
@@ -37,6 +37,7 @@ Example:
#optional
'agentnum' => $agentnum,
'refnum' => $refnum,
+ 'cust_classnum' => \@classnums,
'nototal' => 1,
'graph_type' => 'LinesPoints',
'remove_empty' => 1,
@@ -121,6 +122,7 @@ my %reportopts = (
'projection' => $opt{'projection'},
'agentnum' => $opt{'agentnum'},
'refnum' => $opt{'refnum'},
+ 'cust_classnum'=> $opt{'cust_classnum'},
'remove_empty' => $opt{'remove_empty'},
'doublemonths' => $opt{'doublemonths'},
);
diff --git a/httemplate/graph/money_time.cgi b/httemplate/graph/money_time.cgi
index 166735fc6..9071fc7b9 100644
--- a/httemplate/graph/money_time.cgi
+++ b/httemplate/graph/money_time.cgi
@@ -8,6 +8,7 @@
'links' => \%link,
'agentnum' => $agentnum,
'refnum' => $refnum,
+ 'cust_classnum'=> \@classnums,
'nototal' => scalar($cgi->param('12mo')),
)
%>
@@ -25,6 +26,11 @@ if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
}
my $agentname = $agent ? $agent->agent.' ' : '';
+my @classnums;
+if ( $cgi->param('cust_classnum') ) {
+ @classnums = grep /^\d+$/, $cgi->param('cust_classnum');
+}
+
my( $refnum, $part_referral ) = ('', '');
if ( $cgi->param('refnum') =~ /^(\d+)$/ ) {
$refnum = $1;
@@ -93,6 +99,7 @@ $color{$_.'_12mo'} = $color{$_}
foreach keys %color;
my $ar = "agentnum=$agentnum;refnum=$refnum";
+$ar .= ";cust_classnum=$_" foreach @classnums;
my %link = (
'invoiced' => "${p}search/cust_bill.html?$ar;",
diff --git a/httemplate/graph/money_time_daily.cgi b/httemplate/graph/money_time_daily.cgi
index 4d16ff871..0fdbd895e 100644
--- a/httemplate/graph/money_time_daily.cgi
+++ b/httemplate/graph/money_time_daily.cgi
@@ -7,6 +7,7 @@
'colors' => \%color,
'links' => \%link,
'agentnum' => $agentnum,
+ 'cust_classnum'=> \@classnums,
'nototal' => scalar($cgi->param('12mo')),
'daily' => 1,
'start_day' => $smday,
@@ -32,6 +33,11 @@ if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
my $agentname = $agent ? $agent->agent.' ' : '';
+my @classnums;
+if ( $cgi->param('cust_classnum') ) {
+ @classnums = grep /^\d+$/, $cgi->param('cust_classnum');
+}
+
my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi);
my ($ssec,$smin,$shour,$smday,$smon,$syear,$swday,$syday,$sisdst)
= localtime($beginning);
diff --git a/httemplate/graph/report_cust_bill_pkg.html b/httemplate/graph/report_cust_bill_pkg.html
index 31792e8dd..251e7d36e 100644
--- a/httemplate/graph/report_cust_bill_pkg.html
+++ b/httemplate/graph/report_cust_bill_pkg.html
@@ -34,6 +34,12 @@ function enable_agent_totals(obj) {
'onchange' => 'enable_agent_totals',
&>
+<& /elements/tr-select-cust_class.html,
+ 'field' => 'cust_classnum',
+ 'label' => 'Customer class',
+ 'multiple' => 1,
+&>
+
<& /elements/tr-select-part_referral.html,
'field' => 'refnum',
'label' => 'Advertising source ',
diff --git a/httemplate/graph/report_money_time.html b/httemplate/graph/report_money_time.html
index 97876c996..315d31bc5 100644
--- a/httemplate/graph/report_money_time.html
+++ b/httemplate/graph/report_money_time.html
@@ -24,6 +24,11 @@
)
%>
+<& /elements/tr-select-cust_class.html,
+ 'field' => 'cust_classnum', # to avoid ambiguity in FS::Report::Table
+ 'multiple' => 1
+&>
+
<% include('/elements/tr-select-part_referral.html',
'label' => 'Advertising source ',
'disable_empty' => 0,
diff --git a/httemplate/graph/report_money_time_daily.html b/httemplate/graph/report_money_time_daily.html
index 8328199c7..a436d0879 100644
--- a/httemplate/graph/report_money_time_daily.html
+++ b/httemplate/graph/report_money_time_daily.html
@@ -17,6 +17,11 @@
)
%>
+<& /elements/tr-select-cust_class.html,
+ 'field' => 'cust_classnum',
+ 'multiple' => 1,
+&>
+
</TABLE>
<BR><INPUT TYPE="submit" VALUE="Display">