domain_record.pm
authorivan <ivan>
Thu, 30 Dec 2004 01:41:28 +0000 (01:41 +0000)
committerivan <ivan>
Thu, 30 Dec 2004 01:41:28 +0000 (01:41 +0000)
FS/FS/Report/Table/Monthly.pm
FS/FS/cust_svc.pm
FS/FS/domain_record.pm

index d3ff5d1..89d44f9 100644 (file)
@@ -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().'.' : '';
 sub in_time_period {
   my( $self, $speriod, $eperiod ) = ( shift, shift, shift );
   my $table = @_ ? shift().'.' : '';
index 9cb7a81..37b73b1 100644 (file)
@@ -19,7 +19,7 @@ use FS::part_export;
 
 @ISA = qw( FS::Record );
 
 
 @ISA = qw( FS::Record );
 
-$DEBUG = 1;
+$DEBUG = 0;
 
 $ignore_quantity = 0;
 
 
 $ignore_quantity = 0;
 
index 2a30594..7b67f66 100644 (file)
@@ -10,7 +10,7 @@ use FS::svc_www;
 
 @ISA = qw(FS::Record);
 
 
 @ISA = qw(FS::Record);
 
-$DEBUG = 1;
+$DEBUG = 0;
 
 =head1 NAME
 
 
 =head1 NAME