<% my( %opt ) = @_; $opt{'field_name'} ||= 'custnum'; my $cust_main = ''; if ( $opt{'value'} ) { $cust_main = qsearchs( 'table' => 'cust_main', 'hashref' => { 'custnum' => $opt{'value'} }, 'extra_sql' => " AND ". $FS::CurrentUser::CurrentUser->agentnums_sql, ); } %> <%= include('/elements/xmlhttp.html', 'url' => $p. 'misc/xmlhttp-cust_main-search.cgi', 'subs' => [ 'smart_search' ], ) %>