X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fsearch-cust_main.html;h=dbcc2ed0b589ac11765dd6579375b389a0835abf;hb=43e42a04ae37ca7a84c05d9ff8b94d9f8cde6dcf;hp=f2b17eacb5e500e1ad4fdea298347f7e52a1626c;hpb=9509e5bfb7f9331303153cac24d7bfecbe2ea9f1;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, + }); +} + +