diff options
author | ivan <ivan> | 2008-10-24 02:08:21 +0000 |
---|---|---|
committer | ivan <ivan> | 2008-10-24 02:08:21 +0000 |
commit | 8032977c915b42634c70feee045b4ec42c3db98f (patch) | |
tree | 4ec7c340a9fdaf815f5b57af3704a8004b1813c0 /httemplate/misc/xmlhttp-cust_main-search.cgi | |
parent | 4eea4e8c5dc178ccd3b478b80361896da027e481 (diff) |
fixes to facilitate using agent_custid as custnum, RT#4190
Diffstat (limited to 'httemplate/misc/xmlhttp-cust_main-search.cgi')
-rw-r--r-- | httemplate/misc/xmlhttp-cust_main-search.cgi | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/httemplate/misc/xmlhttp-cust_main-search.cgi b/httemplate/misc/xmlhttp-cust_main-search.cgi index 20707dab8..26e68b5d8 100644 --- a/httemplate/misc/xmlhttp-cust_main-search.cgi +++ b/httemplate/misc/xmlhttp-cust_main-search.cgi @@ -1,11 +1,21 @@ % if ( $sub eq 'custnum_search' ) { % % my $custnum = $cgi->param('arg'); -% my $cust_main = qsearchs({ -% 'table' => 'cust_main', -% 'hashref' => { 'custnum' => $custnum }, -% 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, -% }); +% my $cust_main = ''; +% if ( $custnum <= 2147483647 ) { +% $cust_main = qsearchs({ +% 'table' => 'cust_main', +% 'hashref' => { 'custnum' => $custnum }, +% 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, +% }); +% } +% if ( ! $cust_main ) { +% $cust_main = qsearchs({ +% 'table' => 'cust_main', +% 'hashref' => { 'agent_custid' => $custnum }, +% 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, +% }); +% } % "<% $cust_main ? $cust_main->name : '' %>" % @@ -19,6 +29,8 @@ % } <%init> +my $conf = new FS::Conf; + my $sub = $cgi->param('sub'); </%init> |