[freeside-commits] freeside/FS/FS/part_export vitelity.pm, 1.1.8.1, 1.1.8.2

Erik Levinson levinse at wavetail.420.am
Fri Nov 19 20:50:52 PST 2010


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

Modified Files:
      Tag: FREESIDE_2_1_BRANCH
	vitelity.pm 
Log Message:
bug fixes vitelity.pm, RT4868

Index: vitelity.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_export/vitelity.pm,v
retrieving revision 1.1.8.1
retrieving revision 1.1.8.2
diff -u -w -d -r1.1.8.1 -r1.1.8.2
--- vitelity.pm	8 Nov 2010 17:41:38 -0000	1.1.8.1
+++ vitelity.pm	20 Nov 2010 04:50:50 -0000	1.1.8.2
@@ -51,7 +51,6 @@
             'table'    => 'phone_avail',
             'hashref'  => { 'exportnum'   => $self->exportnum,
                             'countrycode' => '1', # vitelity is US/CA only now
-                            'state'       => $opt{'state'},
                             'npa'         => $opt{'areacode'},
                             'nxx'         => $opt{'exchange'},
                           },
@@ -61,14 +60,16 @@
 
   } elsif ( $opt{'areacode'} ) { #return exchanges in format NPA-NXX- literal 'XXXX'
 
+    # you can't call $->name .... that returns "(unlinked)"
+    # and in any case this is still major abuse of encapsulation, it just happens to work for the other fields
     return [
-      map { $_->name. ' ('. $_->npa. '-'. $_->nxx. '-XXXX)' } 
+	   map { $_->{'Hash'}->{name}.' ('. $_->npa. '-'. $_->nxx. '-XXXX)' } 
           qsearch({
-            'select'   => 'DISTINCT ON ( name, npa, nxx ) *',
+	# i know this doesn't do the same thing as before, but now the sort works
+            'select'   => 'DISTINCT npa,nxx,name',
             'table'    => 'phone_avail',
             'hashref'  => { 'exportnum'   => $self->exportnum,
                             'countrycode' => '1', # vitelity is US/CA only now
-                            'state'       => $opt{'state'},
                             'npa'         => $opt{'areacode'},
                           },
             'order_by' => 'ORDER BY nxx',
@@ -133,7 +134,7 @@
       }
 
       foreach my $did ( @dids ) {
-        $did =~ /^(\d{3})(\d{3})(\d{4})$/ or die "unparsable did $did\n";
+	$did =~ /^(\d{3})(\d{3})(\d{4}),/ or die "unparsable did $did\n";
         my($npa, $nxx, $station) = ($1, $2, $3);
         $npa{$npa}++;
 



More information about the freeside-commits mailing list