fix visual glitch
[freeside.git] / httemplate / search / svc_acct.cgi
index dd0221d..e28e00e 100755 (executable)
@@ -21,13 +21,14 @@ $query ||= ''; #to avoid use of unitialized value errors
 my $unlinked = '';
 if ( $query =~ /^UN_(.*)$/ ) {
   $query = $1;
-  $unlinked = '
+  my $empty = driver_name =~ /^Pg$/i ? qq('') : qq("");
+  $unlinked = "
     WHERE 0 <
       ( SELECT count(*) FROM cust_svc
           WHERE cust_svc.svcnum = svc_acct.svcnum
-            AND pkgnum IS NULL
+            AND ( pkgnum IS NULL OR pkgnum = 0 OR pkgnum = $empty )
       )
-  ';
+  ";
 }
 
 my(@svc_acct, $sortby);
@@ -100,7 +101,7 @@ if ( scalar(@svc_acct) == 1 ) {
   }
   #end pager
 
-  print header("Account Search Results",''),
+  print header("Account Search Results",menubar('Main Menu'=>popurl(2))),
         "$total matching accounts found<BR><BR>$pager",
         &table(), <<END;
       <TR>
@@ -141,7 +142,7 @@ END
         my $conf = new FS::Conf;
         unless ( $mydomain = $conf->config('domain') ) {
           die "No legacy domain config file and no svc_domain.svcnum record ".
-              "for svc_acct.domsvc: ". $cust_svc->domsvc;
+              "for svc_acct.domsvc: ". $svc_acct->domsvc;
         }
       }
       $domain = "<i>$mydomain</i><FONT COLOR=\"#FF0000\">*</FONT>";