diff options
author | ivan <ivan> | 2007-09-24 00:56:50 +0000 |
---|---|---|
committer | ivan <ivan> | 2007-09-24 00:56:50 +0000 |
commit | 91caf036bc222d20d078e31f1d28c2d6c86805e1 (patch) | |
tree | 80a89433fd9dee9d2655e4b222d9988e5675525b /FS/FS/part_pkg.pm | |
parent | 308f86b554046bcf4a9e793465ad3a4cd0e0962d (diff) |
beginning of agent-virtualization of packages
Diffstat (limited to 'FS/FS/part_pkg.pm')
-rw-r--r-- | FS/FS/part_pkg.pm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm index fad7af2f9..84502b745 100644 --- a/FS/FS/part_pkg.pm +++ b/FS/FS/part_pkg.pm @@ -13,6 +13,7 @@ use FS::agent_type; 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 @@ -85,6 +86,8 @@ inherits from FS::Record. The following fields are currently supported: =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 @@ -449,6 +452,7 @@ sub check { || $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; @@ -501,6 +505,17 @@ sub classname { : ''; } +=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 |