X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fgraph%2Fcust_signup.html;h=28466da02618e4b08923f52f3e9ef7b9ea801adc;hp=dd9100f1ed52a9ff88c5cfe1206669c15f07f7fa;hb=ff27c3f36240aee48ed50153dd5d8fe3ac3f2443;hpb=9f97c81b19a3184ea68df32aaea43808b22e10f0 diff --git a/httemplate/graph/cust_signup.html b/httemplate/graph/cust_signup.html index dd9100f1e..28466da02 100644 --- a/httemplate/graph/cust_signup.html +++ b/httemplate/graph/cust_signup.html @@ -9,7 +9,7 @@ 'agentnum' => $agentnum, 'sprintf' => '%u', 'disable_money' => 1, - 'bottom_total' => (scalar @items > 1 ? 1 : 0), + 'bottom_total' => (scalar @items > 1 && !$indirect ? 1 : 0), 'bottom_link' => $bottom_link, 'link_fromparam' => 'signupdate_begin', 'link_toparam' => 'signupdate_end', @@ -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; @@ -59,25 +77,35 @@ elsif ( $cgi->param('refnum') =~ /^(\d*)$/ ) { } } +my $indirect = ($cgi->param('indirect') eq 'Y' ? 1 : 0); + my (@items, @labels, @colors, @params, @links); my $hue = 0; -my $hue_increment = 125; +my $hue_increment = 75; my @signup_colors; foreach my $referral (@referral) { + my %params = %global_params; + $params{'refnum'} = $referral->refnum unless $all_referral; + push @items, 'signups'; push @labels, ( $all_referral ? 'Signups' : $referral->referral ); - push @params, ( $all_referral ? [] : [ 'refnum' => $referral->refnum ] ); + push @params, [ %params ]; push @links, $link . ($all_referral ? '' : "refnum=".$referral->refnum.';'); - if ( !@signup_colors ) { - @signup_colors = Color::Scheme->new - ->from_hue($hue) - ->scheme('analogic') - ->colors; - $hue += $hue_increment; + # rotate hue for each referral type + @signup_colors = Color::Scheme->new->from_hue($hue)->colors; + $hue += $hue_increment; + push @colors, $signup_colors[0]; + if ( $indirect ) { + push @items, 'signups'; + push @labels, $all_referral ? + 'Referrals' : + $referral->referral . ' referrals'; + push @params, [ %params, 'indirect' => 1 ]; + push @links, ''; + push @colors, $signup_colors[1]; } - push @colors, shift @signup_colors; }