From af167dc766fad944b32ca7dc431b2549943b94dd Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Thu, 17 Apr 2014 10:06:56 -0700 Subject: customer signup report, filter by customer and package class, #28025 --- httemplate/graph/cust_signup.html | 21 ++++++++++++++++++++- httemplate/graph/report_cust_signup.html | 28 ++++++++++++++++++++-------- 2 files changed, 40 insertions(+), 9 deletions(-) (limited to 'httemplate/graph') diff --git a/httemplate/graph/cust_signup.html b/httemplate/graph/cust_signup.html index a3eb702f2..28466da02 100644 --- a/httemplate/graph/cust_signup.html +++ b/httemplate/graph/cust_signup.html @@ -38,6 +38,24 @@ $title = "$agentname $title" if $agentname; my $link = $p.'search/cust_main.html?'; $link .= "agentnum=$agentnum;" if $agentnum; +my %global_params; +# cust_classnum +my @classnums = grep /^\d+$/, $cgi->param('cust_classnum'); +if (@classnums) { + $global_params{'cust_classnum'} = [ @classnums ]; + # classnum here, not cust_classnum, for cust_main.html + $link .= "classnum=$_;" foreach @classnums; +} +# pkg_classnum +@classnums = grep /^\d+$/, $cgi->param('pkg_classnum'); +if (@classnums) { + $global_params{'pkg_classnum'} = [ @classnums ]; + $link .= "pkg_classnum=$_;" foreach @classnums; + $link .= 'any_pkg_status=1;'; + # because we report any customer that had the package at any time, not + # only those for whom it's still active +} + my $bottom_link = $link; my @referral; @@ -68,7 +86,8 @@ my $hue_increment = 75; my @signup_colors; foreach my $referral (@referral) { - my %params = ('refnum' => $referral->refnum) unless $all_referral; + my %params = %global_params; + $params{'refnum'} = $referral->refnum unless $all_referral; push @items, 'signups'; push @labels, ( $all_referral ? 'Signups' : $referral->referral ); diff --git a/httemplate/graph/report_cust_signup.html b/httemplate/graph/report_cust_signup.html index d4ea8c215..bfe788188 100644 --- a/httemplate/graph/report_cust_signup.html +++ b/httemplate/graph/report_cust_signup.html @@ -11,17 +11,29 @@ <& /elements/tr-select-from_to.html &> <& /elements/tr-select-agent.html, - 'curr_value' => scalar($cgi->param('agentnum')), - 'label' => 'For agent: ', - 'disable_empty' => 0, + 'curr_value' => scalar($cgi->param('agentnum')), + 'label' => 'For agent: ', + 'disable_empty' => 0, &> <& /elements/tr-select-part_referral.html, - 'curr_value' => scalar($cgi->param('refnum')), - 'label' => 'Advertising source: ', - 'disable_empty' => 0, - 'pre_options' => [ 'all' => 'all (aggregate)' ], - 'empty_label' => 'all (breakdown)', + 'curr_value' => scalar($cgi->param('refnum')), + 'label' => 'Advertising source: ', + 'disable_empty' => 0, + 'pre_options' => [ 'all' => 'all (aggregate)' ], + 'empty_label' => 'all (breakdown)', +&> + +<& /elements/tr-select-cust_class.html, + 'field' => 'cust_classnum', + 'label' => 'Customer class ', + 'multiple' => 1, +&> + +<& /elements/tr-select-pkg_class.html, + 'field' => 'pkg_classnum', + 'label' => 'With package of class ', + 'multiple' => 1, &> -- cgit v1.2.1