diff options
author | Ivan Kohler <ivan@freeside.biz> | 2013-06-08 01:30:52 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2013-06-08 01:30:52 -0700 |
commit | e96a2a6fd3a8885b0fb035ecc55bdf50dbe5a4aa (patch) | |
tree | 1be65eac435d9445d71a2c63e33fefe94db96349 /FS/FS/agent.pm | |
parent | 0f21021fea8f99d28b4507c3cffa55cbdd6f110d (diff) |
multi-currency, RT#21565
Diffstat (limited to 'FS/FS/agent.pm')
-rw-r--r-- | FS/FS/agent.pm | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/FS/FS/agent.pm b/FS/FS/agent.pm index 9b32209..109343a 100644 --- a/FS/FS/agent.pm +++ b/FS/FS/agent.pm @@ -1,19 +1,18 @@ package FS::agent; +use base qw( FS::m2m_Common FS::m2name_Common FS::Record ); use strict; use vars qw( @ISA ); -#use Crypt::YAPassGen; use Business::CreditCard 0.28; use FS::Record qw( dbh qsearch qsearchs ); use FS::cust_main; use FS::cust_pkg; use FS::agent_type; +use FS::agent_currency; use FS::reg_code; use FS::TicketSystem; use FS::Conf; -@ISA = qw( FS::m2m_Common FS::Record ); - =head1 NAME FS::agent - Object methods for agent records @@ -177,6 +176,31 @@ sub agent_cust_main { qsearchs( 'cust_main', { 'custnum' => $self->agent_custnum } ); } +=item agent_currency + +Returns the FS::agent_currency objects (see L<FS::agent_currency>), if any, for +this agent. + +=cut + +sub agent_currency { + my $self = shift; + qsearch('agent_currency', { 'agentnum' => $self->agentnum } ); +} + +=item agent_currency_hashref + +Returns a hash references of supported additional currencies for this agent. + +=cut + +sub agent_currency_hashref { + my $self = shift; + +{ map { $_->currency => 1 } + $self->agent_currency + }; +} + =item pkgpart_hashref Returns a hash reference. The keys of the hash are pkgparts. The value is |