1 <% include('elements/monthly.html',
2 'title' => $agentname. 'Package Churn',
5 'graph_labels' => \%graph_label,
8 'agentnum' => $agentnum,
15 #XXX use a different ACL for package churn?
17 unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
19 #false laziness w/money_time.cgi, cust_bill_pkg.cgi
22 my( $agentnum, $agent ) = ('', '');
23 if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
25 $agent = qsearchs('agent', { 'agentnum' => $agentnum } );
26 die "agentnum $agentnum not found!" unless $agent;
29 my $agentname = $agent ? $agent->agent.' ' : '';
31 my @items = qw( setup_pkg susp_pkg cancel_pkg );
34 'setup_pkg' => 'New orders',
35 'susp_pkg' => 'Suspensions',
36 # 'unsusp' => 'Unsuspensions',
37 'cancel_pkg' => 'Cancellations',
39 my %graph_label = %label;
42 'setup_pkg' => '00cc00', #green
43 'susp_pkg' => 'ff9900', #yellow
44 #'unsusp' => '', #light green?
45 'cancel_pkg' => 'cc0000', #red ? 'ff0000'
49 'setup_pkg' => { 'link' => "${p}search/cust_pkg.cgi?agentnum=$agentnum;",
50 'fromparam' => 'setup_begin',
51 'toparam' => 'setup_end',
53 'susp_pkg' => { 'link' => "${p}search/cust_pkg.cgi?agentnum=$agentnum;",
54 'fromparam' => 'susp_begin',
55 'toparam' => 'susp_end',
57 'cancel_pkg' => { 'link' => "${p}search/cust_pkg.cgi?agentnum=$agentnum;",
58 'fromparam' => 'cancel_begin',
59 'toparam' => 'cancel_end',