more link methods
authorivan <ivan>
Fri, 30 Nov 2001 00:04:38 +0000 (00:04 +0000)
committerivan <ivan>
Fri, 30 Nov 2001 00:04:38 +0000 (00:04 +0000)
FS/FS/cust_pkg.pm
FS/FS/cust_svc.pm
FS/FS/svc_Common.pm

index 19e1da3..c6fabe5 100644 (file)
@@ -99,7 +99,7 @@ inherits from FS::Record.  The following fields are currently supported:
 =item otaker - order taker (assigned automatically if null, see L<FS::UID>)
 
 =item manual_flag - If this field is set to 1, disables the automatic
-unsuspensiond of this package when using the B<unsuspendauto> config file.
+unsuspension of this package when using the B<unsuspendauto> config file.
 
 =back
 
@@ -629,7 +629,7 @@ sub order {
 
 =head1 VERSION
 
-$Id: cust_pkg.pm,v 1.13 2001-11-03 17:49:52 ivan Exp $
+$Id: cust_pkg.pm,v 1.14 2001-11-30 00:04:38 ivan Exp $
 
 =head1 BUGS
 
index c398e5e..9bc563f 100644 (file)
@@ -134,6 +134,18 @@ sub part_svc {
     : qsearchs( 'part_svc', { 'svcpart' => $self->svcpart } );
 }
 
+=item cust_pkg
+
+Returns the definition for this service, as a FS::part_svc object (see
+L<FS::part_svc>).
+
+=cut
+
+sub cust_pkg {
+  my $self = shift;
+  qsearchs( 'cust_pkg', { 'pkgnum' => $self->pkgnum } );
+}
+
 =item label
 
 Returns a list consisting of:
@@ -183,7 +195,7 @@ sub label {
 
 =head1 VERSION
 
-$Id: cust_svc.pm,v 1.6 2001-11-03 17:49:52 ivan Exp $
+$Id: cust_svc.pm,v 1.7 2001-11-30 00:04:38 ivan Exp $
 
 =head1 BUGS
 
index 7e21646..042c243 100644 (file)
@@ -107,7 +107,7 @@ sub delete {
   $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;
 
@@ -154,7 +154,7 @@ sub setx {
   #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 {
@@ -176,6 +176,18 @@ sub setx {
 
 }
 
+=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
@@ -195,7 +207,7 @@ sub cancel { ''; }
 
 =head1 VERSION
 
-$Id: svc_Common.pm,v 1.6 2001-09-11 22:20:28 ivan Exp $
+$Id: svc_Common.pm,v 1.7 2001-11-30 00:04:38 ivan Exp $
 
 =head1 BUGS