1 <% include('elements/monthly.html',
3 'Package Costs Report',
4 'graph_type' => 'Lines',
7 'graph_labels' => \%label,
10 'agentnum' => $agentnum,
11 'nototal' => scalar($cgi->param('12mo')),
17 unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
20 my( $agentnum, $agent ) = ('', '');
21 if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
23 $agent = qsearchs('agent', { 'agentnum' => $agentnum } );
24 die "agentnum $agentnum not found!" unless $agent;
27 my $agentname = $agent ? $agent->agent.' ' : '';
29 my @items = qw( cust_pkg_setup_cost cust_pkg_recur_cost );
30 if ( $cgi->param('12mo') == 1 ) {
31 @items = map $_.'_12mo', @items;
35 'cust_pkg_setup_cost' => 'Setup Costs',
36 'cust_pkg_recur_cost' => 'Recurring Costs',
39 $label{$_.'_12mo'} = $label{$_}. " (prev 12 months)"
43 'cust_pkg_setup_cost' => '0000cc',
44 'cust_pkg_recur_cost' => '00cc00',
46 $color{$_.'_12mo'} = $color{$_}
50 'cust_pkg_setup_cost' => { 'link' => "${p}search/cust_pkg.cgi?agentnum=$agentnum;",
51 'fromparam' => 'setup_begin',
52 'toparam' => 'setup_end',
54 'cust_pkg_recur_cost' => { 'link' => "${p}search/cust_pkg.cgi?agentnum=$agentnum;",
55 'fromparam' => 'active_begin',
56 'toparam' => 'active_end',