This commit was manufactured by cvs2svn to create tag 'freeside_2_1_1'.
[freeside.git] / FS / FS / svc_pbx.pm
index adc45a7..d2760a5 100644 (file)
@@ -292,9 +292,6 @@ with the chosen prefix.
 
 =item disable_src => 1: No-op for svc_pbx CDR processing.
 
-=item by_svcnum => 1: Select CDRs where the svcnum field matches, instead of 
-title/charged_party.  Normally this field is set after processing.
-
 =back
 
 =cut
@@ -310,25 +307,19 @@ sub get_cdrs {
   
   my $for_update = $options{'for_update'} ? 'FOR UPDATE' : '';
 
-  if ( $options{'by_svcnum'} ) {
-    $hash{'svcnum'} = $self->svcnum;
-  }
-  else {
-    #matching by title
-    my $title = $self->title;
+  my $title = $self->title;
 
-    my $prefix = $options{'default_prefix'};
+  my $prefix = $options{'default_prefix'};
 
-    my @orwhere =  map " $_ = '$title'        ", @fields;
-    push @orwhere, map " $_ = '$prefix$title' ", @fields
-      if length($prefix);
-    if ( $prefix =~ /^\+(\d+)$/ ) {
-      push @orwhere, map " $_ = '$1$title' ", @fields
-    }
-
-    push @where, ' ( '. join(' OR ', @orwhere ). ' ) ';
+  my @orwhere =  map " $_ = '$title'        ", @fields;
+  push @orwhere, map " $_ = '$prefix$title' ", @fields
+    if length($prefix);
+  if ( $prefix =~ /^\+(\d+)$/ ) {
+    push @orwhere, map " $_ = '$1$title' ", @fields
   }
 
+  push @where, ' ( '. join(' OR ', @orwhere ). ' ) ';
+
   if ( $options{'begin'} ) {
     push @where, 'startdate >= '. $options{'begin'};
   }
@@ -336,8 +327,7 @@ sub get_cdrs {
     push @where, 'startdate < '.  $options{'end'};
   }
 
-  my $extra_sql = ( keys(%hash) ? ' AND ' : ' WHERE ' ). join(' AND ', @where )
-    if @where;
+  my $extra_sql = ( keys(%hash) ? ' AND ' : ' WHERE ' ). join(' AND ', @where );
 
   my @cdrs =
     qsearch( {