[freeside-commits] freeside/FS/FS/Report/Table Monthly.pm,1.7,1.8

Ivan,,, ivan at wavetail.420.am
Wed Jul 12 20:54:09 PDT 2006


Update of /home/cvs/cvsroot/freeside/FS/FS/Report/Table
In directory wavetail:/tmp/cvs-serv11714/FS/FS/Report/Table

Modified Files:
	Monthly.pm 
Log Message:
fix multiple-agent virtualization properly for these reports

Index: Monthly.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Report/Table/Monthly.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- Monthly.pm	8 May 2006 10:01:54 -0000	1.7
+++ Monthly.pm	13 Jul 2006 03:54:07 -0000	1.8
@@ -5,6 +5,7 @@
 use Time::Local;
 use FS::UID qw( dbh );
 use FS::Report::Table;
+use FS::CurrentUser;
 
 @ISA = qw( FS::Report::Table );
 
@@ -215,7 +216,7 @@
   );
 }
 
-#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 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;
 }
 



More information about the freeside-commits mailing list