[freeside-commits] freeside/FS/FS cust_main.pm,1.379,1.380

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


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

Modified Files:
	cust_main.pm 
Log Message:
fixes to facilitate using agent_custid as custnum, RT#4190

Index: cust_main.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main.pm,v
retrieving revision 1.379
retrieving revision 1.380
diff -u -d -r1.379 -r1.380
--- cust_main.pm	18 Oct 2008 01:22:55 -0000	1.379
+++ cust_main.pm	24 Oct 2008 02:08:21 -0000	1.380
@@ -5988,22 +5988,28 @@
 
   # custnum search (also try agent_custid), with some tweaking options if your
   # legacy cust "numbers" have letters
-  } elsif ( $search =~ /^\s*(\d+)\s*$/
+  } 
+
+  if ( $search =~ /^\s*(\d+)\s*$/
             || ( $conf->config('cust_main-agent_custid-format') eq 'ww?d+'
                  && $search =~ /^\s*(\w\w?\d+)\s*$/
                )
           )
   {
 
-    push @cust_main, qsearch( {
-      'table'     => 'cust_main',
-      'hashref'   => { 'custnum' => $1, %options },
-      'extra_sql' => " AND $agentnums_sql", #agent virtualization
-    } );
+    my $num = $1;
+
+    if ( $num <= 2147483647 ) { #need a bigint custnum?  wow.
+      push @cust_main, qsearch( {
+        'table'     => 'cust_main',
+        'hashref'   => { 'custnum' => $num, %options },
+        'extra_sql' => " AND $agentnums_sql", #agent virtualization
+      } );
+    }
 
     push @cust_main, qsearch( {
       'table'     => 'cust_main',
-      'hashref'   => { 'agent_custid' => $1, %options },
+      'hashref'   => { 'agent_custid' => $num, %options },
       'extra_sql' => " AND $agentnums_sql", #agent virtualization
     } );
 



More information about the freeside-commits mailing list