$error = $self->SUPER::delete;
return $error if $error;
- my $cust_svc = qsearchs( 'cust_svc' , { 'svcnum' => $svcnum } );
+ my $cust_svc = $self->cust_svc;
$error = $cust_svc->delete;
return $error if $error;
#get part_svc
my $svcpart;
if ( $self->svcnum ) {
- my $cust_svc = qsearchs( 'cust_svc', { 'svcnum' => $self->svcnum } );
+ my $cust_svc = $self->cust_svc;
return "Unknown svcnum" unless $cust_svc;
$svcpart = $cust_svc->svcpart;
} else {
}
+=item cust_svc
+
+Returns the cust_svc record associated with this svc_ record, as a FS::cust_svc
+object (see L<FS::cust_svc>).
+
+=cut
+
+sub cust_svc {
+ my $self = shift;
+ qsearchs('cust_svc', { 'svcnum' => $self->svcnum } );
+}
+
=item suspend
=item unsuspend
=head1 VERSION
-$Id: svc_Common.pm,v 1.5 2001-09-06 20:41:59 ivan Exp $
+$Id: svc_Common.pm,v 1.7 2001-11-30 00:04:38 ivan Exp $
=head1 BUGS
The setfixed method return value.
-The new method should set defaults from part_svc (like the check method
-sets fixed values)?
-
=head1 SEE ALSO
L<FS::Record>, L<FS::cust_svc>, L<FS::part_svc>, L<FS::cust_pkg>, schema.html