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