[freeside-commits] freeside/FS/FS Conf.pm, 1.301, 1.302 cust_main.pm, 1.444, 1.445 cust_pkg.pm, 1.133, 1.134

Jeff Finucane,420,, jeff at wavetail.420.am
Sun Jul 26 20:26:48 PDT 2009


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

Modified Files:
	Conf.pm cust_main.pm cust_pkg.pm 
Log Message:
FCC from 477 improvements #4912

Index: Conf.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Conf.pm,v
retrieving revision 1.301
retrieving revision 1.302
diff -u -d -r1.301 -r1.302
--- Conf.pm	24 Jul 2009 09:38:15 -0000	1.301
+++ Conf.pm	27 Jul 2009 03:26:46 -0000	1.302
@@ -2605,6 +2605,28 @@
   },
 
   {
+    'key'         => 'census_year',
+    'section'     => 'UI',
+    'description' => 'The year to use in census tract lookups',
+    'type'        => 'select',
+    'select_enum' => [ qw( 2008 2007 2006 ) ],
+  },
+
+  {
+    'key'         => 'company_latitude',
+    'section'     => 'UI',
+    'description' => 'Your company latitude (-90 through 90)',
+    'type'        => 'text',
+  },
+
+  {
+    'key'         => 'company_longitude',
+    'section'     => 'UI',
+    'description' => 'Your company longitude (-180 thru 180)',
+    'type'        => 'text',
+  },
+
+  {
     'key'         => 'disable_acl_changes',
     'section'     => '',
     'description' => 'Disable all ACL changes, for demos.',

Index: cust_main.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main.pm,v
retrieving revision 1.444
retrieving revision 1.445
diff -u -d -r1.444 -r1.445
--- cust_main.pm	20 Jul 2009 14:26:12 -0000	1.444
+++ cust_main.pm	27 Jul 2009 03:26:46 -0000	1.445
@@ -1571,6 +1571,13 @@
     unless ! $self->referral_custnum 
            || qsearchs( 'cust_main', { 'custnum' => $self->referral_custnum } );
 
+  if ( $self->censustract ne '' ) {
+    $self->censustract =~ /^\s*(\d{9})\.?(\d{2})\s*$/
+      or return "Illegal census tract: ". $self->censustract;
+    
+    $self->censustract("$1.$2");
+  }
+
   if ( $self->ss eq '' ) {
     $self->ss('');
   } else {
@@ -7371,6 +7378,19 @@
 
 }
 
+# Return a list of latitude/longitude for one of the services (if any)
+sub service_coordinates {
+  my $self = shift;
+
+  my @svc_X = 
+    grep { $_->latitude && $_->longitude }
+    map { $_->svc_x }
+    map { $_->cust_svc }
+    $self->ncancelled_pkgs;
+
+  scalar(@svc_X) ? ( $svc_X[0]->latitude, $svc_X[0]->longitude ) : ()
+}
+
 =back
 
 =head1 CLASS METHODS

Index: cust_pkg.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_pkg.pm,v
retrieving revision 1.133
retrieving revision 1.134
diff -u -d -r1.133 -r1.134
--- cust_pkg.pm	20 Jul 2009 04:51:34 -0000	1.133
+++ cust_pkg.pm	27 Jul 2009 03:26:46 -0000	1.134
@@ -2377,8 +2377,11 @@
   # parse censustract
   ###
 
-  if ( $params->{'censustract'} =~ /^([.\d]+)$/ and $1 ) {
-    push @where,  "cust_main.censustract = '". $params->{censustract}. "'";
+  if ( exists($params->{'censustract'}) ) {
+    $params->{'censustract'} =~ /^([.\d]*)$/;
+    my $censustract = "cust_main.censustract = '$1'";
+    $censustract .= ' OR cust_main.censustract is NULL' unless $1;
+    push @where,  "( $censustract )";
   }
 
   ###



More information about the freeside-commits mailing list