From 02f0f4ce6f01b9f6d67c44b8884320e6204a95a1 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 30 Dec 2004 01:41:28 +0000 Subject: [PATCH] domain_record.pm --- FS/FS/Report/Table/Monthly.pm | 38 ++++++++++++++++++++++++++++++++++++++ FS/FS/cust_svc.pm | 2 +- FS/FS/domain_record.pm | 2 +- 3 files changed, 40 insertions(+), 2 deletions(-) diff --git a/FS/FS/Report/Table/Monthly.pm b/FS/FS/Report/Table/Monthly.pm index d3ff5d1db..89d44f92f 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 9cb7a8163..37b73b124 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 2a30594da..7b67f666d 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 -- 2.11.0