- add new suspend and unsuspend export hooks (with null defaults)
[freeside.git] / FS / FS / svc_acct.pm
index e3589d8..f0b0abc 100644 (file)
@@ -433,10 +433,11 @@ sub suspend {
          ) {
     $hash{_password} = '*SUSPENDED* '.$hash{_password};
     my $new = new FS::svc_acct ( \%hash );
          ) {
     $hash{_password} = '*SUSPENDED* '.$hash{_password};
     my $new = new FS::svc_acct ( \%hash );
-    $new->replace($self);
-  } else {
-    ''; #no error (already suspended)
+    my $error = $new->replace($self);
+    return $error if $error;
   }
   }
+
+  $self->SUPER::suspend;
 }
 
 =item unsuspend
 }
 
 =item unsuspend
@@ -454,10 +455,11 @@ sub unsuspend {
   if ( $hash{_password} =~ /^\*SUSPENDED\* (.*)$/ ) {
     $hash{_password} = $1;
     my $new = new FS::svc_acct ( \%hash );
   if ( $hash{_password} =~ /^\*SUSPENDED\* (.*)$/ ) {
     $hash{_password} = $1;
     my $new = new FS::svc_acct ( \%hash );
-    $new->replace($self);
-  } else {
-    ''; #no error (already unsuspended)
+    my $error = $new->replace($self);
+    return $error if $error;
   }
   }
+
+  $self->SUPER::unsuspend;
 }
 
 =item cancel
 }
 
 =item cancel