diff options
Diffstat (limited to 'FS/FS/cust_svc.pm')
-rw-r--r-- | FS/FS/cust_svc.pm | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/FS/FS/cust_svc.pm b/FS/FS/cust_svc.pm index 5922e32..0465580 100644 --- a/FS/FS/cust_svc.pm +++ b/FS/FS/cust_svc.pm @@ -183,6 +183,37 @@ sub delete { } +=item suspend + +Suspends the relevant service by calling the B<suspend> method of the associated +FS::svc_XXX object (i.e. an FS::svc_acct object or FS::svc_domain object). + +If there is an error, returns the error, otherwise returns false. + +=cut + +sub suspend { + my( $self, %opt ) = @_; + + $self->part_svc->svcdb =~ /^([\w\-]+)$/ or return 'Illegal part_svc.svcdb'; + my $svcdb = $1; + require "FS/$svcdb.pm"; + + my $svc = qsearchs( $svcdb, { 'svcnum' => $self->svcnum } ) + or return ''; + + $error = $svc->suspend; + return $error if $error; + + if ( $opt{labels_arryref} ) { + my( $label, $value ) = $self->label; + push @{ $opt{labels_arrayref} }, "$label: $value"; + } + + ''; + +} + =item cancel Cancels the relevant service by calling the B<cancel> method of the associated |