From 51d044c74ff531b744a6b570fe4a178654a0e7da Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 19 Oct 2008 00:38:09 +0000 Subject: add a master custnum field to agents, RT#2933 (roundabout) --- httemplate/elements/search-cust_main.html | 51 ++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 17 deletions(-) (limited to 'httemplate/elements/search-cust_main.html') 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, + }); +} + + -- cgit v1.2.1