surpress warnings
[freeside.git] / FS / FS / svc_acct.pm
index e049af0..11f09a1 100644 (file)
@@ -415,9 +415,10 @@ sub delete {
   foreach my $cust_main_invoice (
     qsearch( 'cust_main_invoice', { 'dest' => $self->svcnum } )
   ) {
-    #next unless defined; #wtf is up with qsearch?
-    warn $cust_main_invoice;
-    next unless defined $cust_main_invoice;
+    unless ( defined($cust_main_invoice) ) {
+      warn "WARNING: something's wrong with qsearch";
+      next;
+    }
     my %hash = $cust_main_invoice->hash;
     $hash{'dest'} = $self->email;
     my $new = new FS::cust_main_invoice \%hash;
@@ -548,9 +549,13 @@ sub replace {
 
   return "Username in use"
     if $old->username ne $new->username &&
-      qsearchs( 'svc_acct', { 'username' => $new->username } );
-
-  return "Can't change uid!" if $old->uid != $new->uid;
+      qsearchs( 'svc_acct', { 'username' => $new->username,
+                               'domsvc'   => $new->domsvc,
+                             } );
+  {
+    no warnings 'numeric';
+    return "Can't change uid!" if $old->uid != $new->uid;
+  }
 
   return "can't change username using Cyrus"
     if $cyrus_server && $old->username ne $new->username;
@@ -958,7 +963,7 @@ sub ssh {
 
 =head1 VERSION
 
-$Id: svc_acct.pm,v 1.54 2001-11-05 13:57:31 ivan Exp $
+$Id: svc_acct.pm,v 1.57 2001-12-19 14:30:12 ivan Exp $
 
 =head1 BUGS