X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_svc.pm;fp=FS%2FFS%2Fcust_svc.pm;h=0465580045ed8202efbe0badbdd8d2f8932b8f08;hp=5922e32ad11aa3605188e3e8cab3b88dd9e3bb52;hb=a9bd30b5b5231db37360e285fbbfa237195cd064;hpb=f1446e6af463609c1488ba367d437b728556f35a diff --git a/FS/FS/cust_svc.pm b/FS/FS/cust_svc.pm index 5922e32ad..046558004 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 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 method of the associated