diff options
author | Ivan Kohler <ivan@freeside.biz> | 2013-08-18 02:01:23 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2013-08-18 02:01:23 -0700 |
commit | ad46607a14730f6ce4d70cd796b803591d90070e (patch) | |
tree | eb1c437b032ad1b72ff8cf7f98fdab4ce19a9615 /FS | |
parent | ca87449136cd950891603a71e83ba31b55c76938 (diff) |
continue sales person work: customer and package selection, commissions, reporting. RT#23402
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/agent.pm | 15 | ||||
-rw-r--r-- | FS/FS/cust_pkg.pm | 6 |
2 files changed, 18 insertions, 3 deletions
diff --git a/FS/FS/agent.pm b/FS/FS/agent.pm index 231259173..68a5912f2 100644 --- a/FS/FS/agent.pm +++ b/FS/FS/agent.pm @@ -602,6 +602,21 @@ sub num_prepay_credit { $sth->fetchrow_arrayref->[0]; } +=item num_sales + +Returns the number of non-disabled sales people for this agent. + +=cut + +sub num_sales { + my $self = shift; + my $sth = dbh->prepare( + "SELECT COUNT(*) FROM sales WHERE agentnum = ? + AND ( disabled = '' OR disabled IS NULL )" + ) or die dbh->errstr; + $sth->execute($self->agentnum) or die $sth->errstr; + $sth->fetchrow_arrayref->[0]; +} =back diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm index 766357be0..a627e2489 100644 --- a/FS/FS/cust_pkg.pm +++ b/FS/FS/cust_pkg.pm @@ -1,9 +1,9 @@ package FS::cust_pkg; - -use strict; -use base qw( FS::otaker_Mixin FS::cust_main_Mixin +use base qw( FS::otaker_Mixin FS::cust_main_Mixin FS::Sales_Mixin FS::contact_Mixin FS::location_Mixin FS::m2m_Common FS::option_Common ); + +use strict; use vars qw($disable_agentcheck $DEBUG $me); use Carp qw(cluck); use Scalar::Util qw( blessed ); |