freeside/FS/FS/Report/Table Monthly.pm,1.3,1.4
ivan
ivan at pouncequick.420.am
Wed Dec 29 17:41:31 PST 2004
Update of /home/cvs/cvsroot/freeside/FS/FS/Report/Table
In directory pouncequick:/tmp/cvs-serv409/Report/Table
Modified Files:
Monthly.pm
Log Message:
domain_record.pm
Index: Monthly.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Report/Table/Monthly.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Monthly.pm 23 Apr 2004 12:19:40 -0000 1.3
+++ Monthly.pm 30 Dec 2004 01:41:28 -0000 1.4
@@ -144,6 +144,44 @@
);
}
+sub canceled { #active
+ my( $self, $speriod, $eperiod ) = ( shift, shift, shift );
+ $self->scalar_sql("
+ SELECT COUNT(*) FROM cust_pkg
+ WHERE cust_pkg.custnum = cust_main.custnum
+ AND 0 = ( SELECT COUNT(*) FROM cust_pkg
+ WHERE cust_pkg.custnum = cust_main.custnum
+ AND ( cust_pkg.cancel IS NULL OR cust_pkg.cancel = 0 )
+ )
+ AND cust_pkg.cancel > $speriod AND cust_pkg.cancel < $eperiod
+ ");
+}
+
+sub newaccount { #newaccount
+ my( $self, $speriod, $eperiod ) = ( shift, shift, shift );
+ $self->scalar_sql("
+ SELECT COUNT(*) FROM cust_pkg
+ WHERE cust_pkg.custnum = cust_main.custnum
+ AND ( cust_pkg.cancel IS NULL OR cust_pkg.cancel = 0 )
+ AND ( cust_pkg.susp IS NULL OR cust_pkg.susp = 0 )
+ AND cust_pkg.setup > $speriod AND cust_pkg.setup < $eperiod
+ ");
+}
+
+sub suspended { #suspended
+ my( $self, $speriod, $eperiod ) = ( shift, shift, shift );
+ $self->scalar_sql("
+ SELECT COUNT(*) FROM cust_pkg
+ WHERE cust_pkg.custnum = cust_main.custnum
+ AND ( cust_pkg.cancel IS NULL OR cust_pkg.cancel = 0 )
+ AND 0 = ( SELECT COUNT(*) FROM cust_pkg
+ WHERE cust_pkg.custnum = cust_main.custnum
+ AND ( cust_pkg.susp IS NULL OR cust_pkg.susp = 0 )
+ )
+ AND cust_pkg.susp > $speriod AND cust_pkg.susp < $eperiod
+ ");
+}
+
sub in_time_period {
my( $self, $speriod, $eperiod ) = ( shift, shift, shift );
my $table = @_ ? shift().'.' : '';
More information about the freeside-commits
mailing list