[freeside-commits] freeside/FS/FS Conf.pm, 1.324.2.34, 1.324.2.35 Mason.pm, 1.19.2.8, 1.19.2.9 Schema.pm, 1.168.2.37, 1.168.2.38 cust_pkg.pm, 1.139.2.15, 1.139.2.16 part_pkg.pm, 1.97.2.3, 1.97.2.4

Jeff Finucane,420,, jeff at wavetail.420.am
Sat May 22 12:49:22 PDT 2010


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv31798/FS/FS

Modified Files:
      Tag: FREESIDE_1_9_BRANCH
	Conf.pm Mason.pm Schema.pm cust_pkg.pm part_pkg.pm 
Log Message:
improved fcc 477 report #7783

Index: Schema.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Schema.pm,v
retrieving revision 1.168.2.37
retrieving revision 1.168.2.38
diff -u -w -d -r1.168.2.37 -r1.168.2.38
--- Schema.pm	30 Apr 2010 02:17:32 -0000	1.168.2.37
+++ Schema.pm	22 May 2010 19:49:20 -0000	1.168.2.38
@@ -1298,6 +1298,7 @@
         'pay_weight',    'real',    'NULL', '', '', '',
         'credit_weight', 'real',    'NULL', '', '', '',
         'agentnum',      'int',     'NULL', '', '', '', 
+        'fcc_ds0s',      'int',     'NULL', '', '', '', 
 
       ],
       'primary_key' => 'pkgpart',

Index: Conf.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Conf.pm,v
retrieving revision 1.324.2.34
retrieving revision 1.324.2.35
diff -u -w -d -r1.324.2.34 -r1.324.2.35
--- Conf.pm	18 May 2010 03:25:41 -0000	1.324.2.34
+++ Conf.pm	22 May 2010 19:49:19 -0000	1.324.2.35
@@ -2369,6 +2369,13 @@
   },
 
   {
+    'key'         => 'cust_pkg-show_fcc_voice_grade_equivalent',
+    'section'     => 'UI',
+    'description' => "Show a field on package definitions for assigning a DSO equivalency number suitable for use on FCC form 477.",
+    'type'        => 'checkbox',
+  },
+
+  {
     'key'         => 'svc_acct-edit_uid',
     'section'     => 'shell',
     'description' => 'Allow UID editing.',

Index: part_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_pkg.pm,v
retrieving revision 1.97.2.3
retrieving revision 1.97.2.4
diff -u -w -d -r1.97.2.3 -r1.97.2.4
--- part_pkg.pm	30 Mar 2010 02:53:12 -0000	1.97.2.3
+++ part_pkg.pm	22 May 2010 19:49:20 -0000	1.97.2.4
@@ -98,6 +98,8 @@
 
 =item agentnum - Optional agentnum (see L<FS::agent>)
 
+=item fcc_ds0s - Optional DS0 equivalency number for FCC form 477
+
 =back
 
 =head1 METHODS
@@ -477,6 +479,7 @@
            ? $self->ut_foreign_keyn('agentnum', 'agent', 'agentnum' )
            : $self->ut_agentnum_acl('agentnum', \@null_agentnum_right)
        )
+    || $self->ut_numbern('fcc_ds0s')
     || $self->SUPER::check
   ;
   return $error if $error;

Index: Mason.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Mason.pm,v
retrieving revision 1.19.2.8
retrieving revision 1.19.2.9
diff -u -w -d -r1.19.2.8 -r1.19.2.9
--- Mason.pm	8 May 2010 02:38:54 -0000	1.19.2.8
+++ Mason.pm	22 May 2010 19:49:20 -0000	1.19.2.9
@@ -121,6 +121,7 @@
   use FS::Msgcat qw(gettext geterror);
   use FS::Misc qw( send_email send_fax states_hash counties state_label );
   use FS::Misc::eps2png qw( eps2png );
+  use FS::Report::FCC_477;
   use FS::Report::Table::Monthly;
   use FS::TicketSystem;
   use FS::Tron qw( tron_lint );

Index: cust_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_pkg.pm,v
retrieving revision 1.139.2.15
retrieving revision 1.139.2.16
diff -u -w -d -r1.139.2.15 -r1.139.2.16
--- cust_pkg.pm	26 Mar 2010 21:43:47 -0000	1.139.2.15
+++ cust_pkg.pm	22 May 2010 19:49:20 -0000	1.139.2.16
@@ -2381,6 +2381,10 @@
 
 specifies the user for agent virtualization
 
+=item fcc_line
+
+ boolean selects packages containing fcc form 477 telco lines
+
 =back
 
 =cut
@@ -2502,6 +2506,12 @@
   push @where,  "part_pkg.custom = 'Y'" if $params->{custom};
 
   ###
+  # parse fcc_line
+  ###
+
+  push @where,  "part_pkg.fcc_ds0s > 0" if $params->{fcc_line};
+
+  ###
   # parse censustract
   ###
 
@@ -2648,6 +2658,35 @@
 
 }
 
+=item fcc_477_count
+
+Returns a list of two package counts.  The first is a count of packages
+based on the supplied criteria and the second is the count of residential
+packages with those same criteria.  Criteria are specified as in the search
+method.
+
+=cut
+
+sub fcc_477_count {
+  my ($class, $params) = @_;
+
+  my $sql_query = $class->search( $params );
+
+  my $count_sql = delete($sql_query->{'count_query'});
+  $count_sql =~ s/ FROM/,count(CASE WHEN cust_main.company IS NULL OR cust_main.company = '' THEN 1 END) FROM/
+    or die "couldn't parse count_sql";
+
+  my $count_sth = dbh->prepare($count_sql)
+    or die "Error preparing $count_sql: ". dbh->errstr;
+  $count_sth->execute
+    or die "Error executing $count_sql: ". $count_sth->errstr;
+  my $count_arrayref = $count_sth->fetchrow_arrayref;
+
+  return ( @$count_arrayref );
+
+}
+
+
 =item location_sql
 
 Returns a list: the first item is an SQL fragment identifying matching 



More information about the freeside-commits mailing list