fix ambiguous agentnum errors in cust_event.html & report_tax.cgi (provide a table...
[freeside.git] / httemplate / search / cust_event.html
index f9cce46..dc6fd05 100644 (file)
@@ -151,7 +151,7 @@ my $title = $cgi->param('failed')
 my @search = ();
 
 if ( $cgi->param('agentnum') && $cgi->param('agentnum') =~ /^(\d+)$/ ) {
-  push @search, "agentnum = $1";
+  push @search, "cust_main.agentnum = $1";
   #my $agent = qsearchs('agent', { 'agentnum' => $1 } );
   #die "unknown agentnum $1" unless $agent;
 }
@@ -183,9 +183,7 @@ if ( $cgi->param('pkgnum') =~ /^(\d+)$/ ) {
 }
 
 #here is the agent virtualization
-my $agent_sql = $curuser->agentnums_sql;
-$agent_sql =~ s/agentnum/cust_main.agentnum/g;
-push @search, $agent_sql;
+push @search, $curuser->agentnums_sql( 'table' => 'cust_main' );
 
 my $where = 'WHERE '. join(' AND ', @search );