1 <% include('/graph/elements/monthly.html',
4 'graph_type' => 'none',
8 'graph_labels' => \@labels,
11 'agentnum' => $agentnum,
12 'doublemonths' => \@doublemonths,
19 unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
21 my @doublemonths = ( 'Billed', 'Paid' );
23 my ($agentnum,$sel_agent);
24 if ( $cgi->param('agentnum') eq 'all' ) {
27 elsif ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
29 $sel_agent = qsearchs('agent', { 'agentnum' => $agentnum } );
30 die "agentnum $agentnum not found!" unless $sel_agent;
32 my $title = $sel_agent ? $sel_agent->agent.' ' : '';
33 $title .= 'Customer Accounting Summary Report';
36 @custs = qsearch('cust_main', {} );
42 my $status = $cgi->param('status');
43 die "invalid status" unless $status =~ /^\w+|$/;
45 foreach my $cust_main ( @custs ) {
46 next unless ($status eq '' || $status eq $cust_main->status);
47 next unless ($agentnum == 0 || $cust_main->agentnum eq $agentnum);
49 push @items, 'netsales', 'cashflow';
51 push @labels, $cust_main->name;
53 push @params, [ ('custnum' => $cust_main->custnum),
55 [ ('custnum' => $cust_main->custnum),