[freeside-commits] freeside/httemplate/misc xmlhttp-cust_main-search.cgi, 1.5, 1.6

Ivan,,, ivan at wavetail.420.am
Thu Oct 23 19:08:23 PDT 2008


Update of /home/cvs/cvsroot/freeside/httemplate/misc
In directory wavetail.420.am:/tmp/cvs-serv20717/httemplate/misc

Modified Files:
	xmlhttp-cust_main-search.cgi 
Log Message:
fixes to facilitate using agent_custid as custnum, RT#4190

Index: xmlhttp-cust_main-search.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/misc/xmlhttp-cust_main-search.cgi,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- xmlhttp-cust_main-search.cgi	9 May 2008 06:34:58 -0000	1.5
+++ xmlhttp-cust_main-search.cgi	24 Oct 2008 02:08:21 -0000	1.6
@@ -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>



More information about the freeside-commits mailing list