X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fsearch-cust_main.html;h=dbcc2ed0b589ac11765dd6579375b389a0835abf;hb=51d044c74ff531b744a6b570fe4a178654a0e7da;hp=f2b17eacb5e500e1ad4fdea298347f7e52a1626c;hpb=5e05724a635a22776f1b973f5d7e77989da4e048;p=freeside.git diff --git a/httemplate/elements/search-cust_main.html b/httemplate/elements/search-cust_main.html index f2b17eacb..dbcc2ed0b 100644 --- a/httemplate/elements/search-cust_main.html +++ b/httemplate/elements/search-cust_main.html @@ -1,23 +1,24 @@ -% -% 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, -% ); -% } -% - - - + - + + +% if ( $opt{'find_button'} ) { + +% } @@ -161,4 +162,20 @@ } +<%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, + }); +} + +