add customer fields option with agent, display_custnum, status and name, RT#73721
[freeside.git] / FS / FS / access_groupagent.pm
index 6b5def1..b0c4bb3 100644 (file)
@@ -1,10 +1,7 @@
 package FS::access_groupagent;
 package FS::access_groupagent;
+use base qw(FS::Record);
 
 use strict;
 
 use strict;
-use vars qw( @ISA );
-use FS::Record qw( qsearch qsearchs );
-
-@ISA = qw(FS::Record);
 
 =head1 NAME
 
 
 =head1 NAME
 
@@ -27,7 +24,7 @@ FS::access_groupagent - Object methods for access_groupagent records
 
 =head1 DESCRIPTION
 
 
 =head1 DESCRIPTION
 
-An FS::access_groupagent object represents an example.  FS::access_groupagent inherits from
+An FS::access_groupagent object represents an group reseller virtualization.  FS::access_groupagent inherits from
 FS::Record.  The following fields are currently supported:
 
 =over 4
 FS::Record.  The following fields are currently supported:
 
 =over 4
@@ -47,7 +44,7 @@ FS::Record.  The following fields are currently supported:
 
 =item new HASHREF
 
 
 =item new HASHREF
 
-Creates a new example.  To add the example to the database, see L<"insert">.
+Creates a new group reseller virtualization.  To add the record to the database, see L<"insert">.
 
 Note that this stores the hash reference, not a distinct copy of the hash it
 points to.  You can ask the object for a copy with the I<hash> method.
 
 Note that this stores the hash reference, not a distinct copy of the hash it
 points to.  You can ask the object for a copy with the I<hash> method.
@@ -86,7 +83,7 @@ returns the error, otherwise returns false.
 
 =item check
 
 
 =item check
 
-Checks all fields to make sure this is a valid example.  If there is
+Checks all fields to make sure this is a valid group reseller virtualization.  If there is
 an error, returns the error, otherwise returns false.  Called by the insert
 and replace methods.
 
 an error, returns the error, otherwise returns false.  Called by the insert
 and replace methods.
 
@@ -100,20 +97,26 @@ sub check {
 
   my $error = 
     $self->ut_numbern('groupagentnum')
 
   my $error = 
     $self->ut_numbern('groupagentnum')
-    || $self->ut_number('groupnum')
-    || $self->ut_number('agentnum')
+    || $self->ut_foreign_key('groupnum', 'access_group', 'groupnum')
+    || $self->ut_foreign_key('agentnum', 'agent',        'agentnum')
   ;
   return $error if $error;
 
   $self->SUPER::check;
 }
 
   ;
   return $error if $error;
 
   $self->SUPER::check;
 }
 
+=item agent
+
+Returns the associated FS::agent object.
+
+=item access_group
+
+Returns the associated FS::access_group object.
+
 =back
 
 =head1 BUGS
 
 =back
 
 =head1 BUGS
 
-The author forgot to customize this manpage.
-
 =head1 SEE ALSO
 
 L<FS::Record>, schema.html from the base documentation.
 =head1 SEE ALSO
 
 L<FS::Record>, schema.html from the base documentation.