if ( $cgi->param('agentnum') =~ /^(\d+)$/ and $1 ) {
push @where,
- "agentnum = $1";
+ "cust_main.agentnum = $1";
}
##
##
# here is the agent virtualization
-push @where, $FS::CurrentUser::CurrentUser->agentnums_sql;
+push @where, $FS::CurrentUser::CurrentUser->agentnums_sql('table'=>'cust_main');
my $extra_sql = scalar(@where) ? ' WHERE '. join(' AND ', @where) : '';