use FS::type_pkgs;
use FS::part_pkg_option;
use FS::pkg_class;
+use FS::agent;
@ISA = qw( FS::m2m_Common FS::Record ); # FS::option_Common ); # this can use option_Common
# when all the plandata bs is
=item credit_weight - Weight (relative to other package definitions) that controls credit application to specific line items.
+=item agentnum - Optional agentnum (see L<FS::agent>)
+
=back
=head1 METHODS
|| $self->ut_enum('disabled', [ '', 'Y' ] )
|| $self->ut_floatn('pay_weight')
|| $self->ut_floatn('credit_weight')
+ || $self->ut_agentnum_acl('agentnum', 'Edit global package definitions')
|| $self->SUPER::check
;
return $error if $error;
: '';
}
+=item agent
+
+Returns the associated agent for this event, if any, as an FS::agent object.
+
+=cut
+
+sub agent {
+ my $self = shift;
+ qsearchs('agent', { 'agentnum' => $self->agentnum } );
+}
+
=item pkg_svc
Returns all FS::pkg_svc objects (see L<FS::pkg_svc>) for this package