diff options
author | ivan <ivan> | 2004-12-30 01:41:28 +0000 |
---|---|---|
committer | ivan <ivan> | 2004-12-30 01:41:28 +0000 |
commit | 02f0f4ce6f01b9f6d67c44b8884320e6204a95a1 (patch) | |
tree | ac95bc89da7576080157903db239ff9a77998cc0 /FS/FS/Report | |
parent | 3abee42db895fa691d147c4d6d53664af670b7dc (diff) |
domain_record.pm
Diffstat (limited to 'FS/FS/Report')
-rw-r--r-- | FS/FS/Report/Table/Monthly.pm | 38 |
1 files changed, 38 insertions, 0 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().'.' : ''; |