summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FS/FS/Report/Table/Monthly.pm38
-rw-r--r--FS/FS/cust_svc.pm2
-rw-r--r--FS/FS/domain_record.pm2
3 files changed, 40 insertions, 2 deletions
diff --git a/FS/FS/Report/Table/Monthly.pm b/FS/FS/Report/Table/Monthly.pm
index d3ff5d1..89d44f9 100644
--- a/FS/FS/Report/Table/Monthly.pm
+++ b/FS/FS/Report/Table/Monthly.pm
@@ -144,6 +144,44 @@ sub credits {
);
}
+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().'.' : '';
diff --git a/FS/FS/cust_svc.pm b/FS/FS/cust_svc.pm
index 9cb7a81..37b73b1 100644
--- a/FS/FS/cust_svc.pm
+++ b/FS/FS/cust_svc.pm
@@ -19,7 +19,7 @@ use FS::part_export;
@ISA = qw( FS::Record );
-$DEBUG = 1;
+$DEBUG = 0;
$ignore_quantity = 0;
diff --git a/FS/FS/domain_record.pm b/FS/FS/domain_record.pm
index 2a30594..7b67f66 100644
--- a/FS/FS/domain_record.pm
+++ b/FS/FS/domain_record.pm
@@ -10,7 +10,7 @@ use FS::svc_www;
@ISA = qw(FS::Record);
-$DEBUG = 1;
+$DEBUG = 0;
=head1 NAME