summaryrefslogtreecommitdiff
path: root/FS/FS/Report
diff options
context:
space:
mode:
authorivan <ivan>2006-07-13 03:54:07 +0000
committerivan <ivan>2006-07-13 03:54:07 +0000
commit779ca0263837bebf7f0ab6f45cb8381706049658 (patch)
tree3b767f57e71582f98ae36ee80a6f5b2bb3895ce3 /FS/FS/Report
parente5742a8ccfca16427631a45fc8895d6fc1a493dd (diff)
fix multiple-agent virtualization properly for these reports
Diffstat (limited to 'FS/FS/Report')
-rw-r--r--FS/FS/Report/Table/Monthly.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/FS/FS/Report/Table/Monthly.pm b/FS/FS/Report/Table/Monthly.pm
index 1b7e93a..145f2a8 100644
--- a/FS/FS/Report/Table/Monthly.pm
+++ b/FS/FS/Report/Table/Monthly.pm
@@ -5,6 +5,7 @@ use vars qw( @ISA $expenses_kludge );
use Time::Local;
use FS::UID qw( dbh );
use FS::Report::Table;
+use FS::CurrentUser;
@ISA = qw( FS::Report::Table );
@@ -215,7 +216,7 @@ sub credits {
);
}
-#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);
@@ -330,9 +331,16 @@ sub suspended { #suspended
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;
}