RT# 83450 - fixed rateplan export
[freeside.git] / FS / FS / Agent_Mixin.pm
1 package FS::Agent_Mixin;
2
3 use strict;
4 use FS::Record qw( qsearchs );
5 use FS::agent;
6
7 =head1 NAME
8
9 FS::Agent_Mixin - Mixin class for objects that have an agent.
10
11 =over 4
12
13 =item agent
14
15 Returns the agent (see L<FS::agent>) for this object.
16
17 =cut
18
19 sub agent {
20   my $self = shift;
21   qsearchs( 'agent', { 'agentnum' => $self->agentnum } );
22 }
23
24 =item agent_name
25
26 Returns the agent name (see L<FS::agent>) for this object.
27
28 =cut
29
30 sub agent_name {
31   my $self = shift;
32   $self->agent->agent;
33 }
34
35 =back
36
37 =head1 BUGS
38
39 =cut
40
41 1;
42