From 35125976b65791c4b3f88827639ff44f1b13eb17 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Sat, 17 Aug 2013 22:36:35 -0700 Subject: continue sales person work: customer and package selection, commissions, reporting. RT#23402 --- FS/FS/Agent_Mixin.pm | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 FS/FS/Agent_Mixin.pm (limited to 'FS/FS/Agent_Mixin.pm') diff --git a/FS/FS/Agent_Mixin.pm b/FS/FS/Agent_Mixin.pm new file mode 100644 index 000000000..0f84ba96a --- /dev/null +++ b/FS/FS/Agent_Mixin.pm @@ -0,0 +1,42 @@ +package FS::Agent_Mixin; + +use strict; +use FS::Record qw( qsearchs ); +use FS::agent; + +=head1 NAME + +FS::Agent_Mixin - Mixin class for objects that have an agent. + +=over 4 + +=item agent + +Returns the agent (see L) for this object. + +=cut + +sub agent { + my $self = shift; + qsearchs( 'agent', { 'agentnum' => $self->agentnum } ); +} + +=item agent_name + +Returns the agent name (see L) for this object. + +=cut + +sub agent_name { + my $self = shift; + $self->agent->agent; +} + +=back + +=head1 BUGS + +=cut + +1; + -- cgit v1.2.1