Stupid mistake. Works now.
[freeside.git] / httemplate / search / cust_main.cgi
index 7aa4021..0794ad0 100755 (executable)
@@ -1,5 +1,5 @@
 <%
-#<!-- $Id: cust_main.cgi,v 1.7 2001-10-10 05:33:43 thalakan Exp $ -->
+#<!-- $Id: cust_main.cgi,v 1.9 2001-10-10 05:59:36 thalakan Exp $ -->
 
 use strict;
 #use vars qw( $conf %ncancelled_pkgs %all_pkgs $cgi @cust_main $sortby );
@@ -9,7 +9,7 @@ use CGI::Carp qw(fatalsToBrowser);
 use IO::Handle;
 use String::Approx qw(amatch);
 use FS::UID qw(cgisuidsetup);
-use FS::Record qw(qsearch qsearchs dbdef ut_name);
+use FS::Record qw(qsearch qsearchs dbdef);
 use FS::CGI qw(header menubar eidiot popurl table);
 use FS::cust_main;
 use FS::cust_svc;
@@ -250,8 +250,11 @@ sub lastsearch {
     $last_type{$_}++;
   }
 
-  my $error = ut_name($cgi->param('last_text'));
+  my $cust_obj = new FS::cust_main;
+  $cust_obj->setfield('last', $cgi->param('last_text'));
+  my $error = $cust_obj->ut_name('last');
   eidiot "Illegal last name" if $error;
+  my($last) = $cust_obj->getfield('last');
 
   if ( $last_type{'Exact'}
        && ! $last_type{'Fuzzy'}