use Time::Local;
use FS::UID qw( dbh );
use FS::Report::Table;
+use FS::CurrentUser;
@ISA = qw( FS::Report::Table );
);
}
-#these should be auto-generated
+#these should be auto-generated or $AUTOLOADed or something
sub invoiced_12mo {
my( $self, $speriod, $eperiod, $agentnum ) = @_;
$speriod = $self->_subtract_11mo($speriod);
sub in_time_period_and_agent {
my( $self, $speriod, $eperiod, $agentnum ) = splice(@_, 0, 4);
my $table = @_ ? shift().'.' : '';
+
my $sql = "${table}_date >= $speriod AND ${table}_date < $eperiod";
+
+ #agent selection
$sql .= " AND agentnum = $agentnum"
if $agentnum;
+
+ #agent virtualization
+ $sql .= ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql;
+
$sql;
}