fix total links on agent-specific sales report, RT#5449
authorivan <ivan>
Wed, 24 Jun 2009 01:40:12 +0000 (01:40 +0000)
committerivan <ivan>
Wed, 24 Jun 2009 01:40:12 +0000 (01:40 +0000)
httemplate/graph/cust_bill_pkg.cgi

index a96eed7..b655f1f 100644 (file)
 die "access denied"
   unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
 
+my $link = "${p}search/cust_bill_pkg.cgi?nottax=1;include_comp_cust=1";
+my $bottom_link = "$link;";
+
 #XXX or virtual
 my( $agentnum, $sel_agent ) = ('', '');
 if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
   $agentnum = $1;
+  $bottom_link .= "agentnum=$agentnum;";
   $sel_agent = qsearchs('agent', { 'agentnum' => $agentnum } );
   die "agentnum $agentnum not found!" unless $sel_agent;
 }
 my $title = $sel_agent ? $sel_agent->agent.' ' : '';
 
-my $link = "${p}search/cust_bill_pkg.cgi?nottax=1;include_comp_cust=1";
-my $bottom_link = "$link;";
-
 #classnum (here)
 # 0: all classes
 # not specified: empty class
@@ -94,7 +95,6 @@ foreach my $agent ( $sel_agent || qsearch('agent', { 'disabled' => '' } ) ) {
 
     push @items, 'cust_bill_pkg';
 
-
     push @labels,
       ( $sel_agent ? '' : $agent->agent.' ' ).
       ( $classnum eq '0'