X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fcdr.html;h=778799b1fc21a293d8ed2345b46589a738624e95;hb=cabd4b54169356d298b05c826c3fd549c2fb22bf;hp=1b4604bbb3a1f762b7dd5ee537bd13c88092ad46;hpb=c13c6407510f6fd1783ce0fbd97800afa27c30b5;p=freeside.git

diff --git a/httemplate/search/cdr.html b/httemplate/search/cdr.html
index 1b4604bbb..778799b1f 100644
--- a/httemplate/search/cdr.html
+++ b/httemplate/search/cdr.html
@@ -10,7 +10,6 @@
                'links' => \@links,
                'html_form'   => qq!<FORM NAME="cdrForm" ACTION="$p/misc/cdr.cgi" METHOD="POST">!,
                'html_foot' => $html_foot,
-             )
 &>
 <%init>
 
@@ -258,6 +257,23 @@ if ( $cgi->param('acctid') =~ /\d/ ) {
   }
 }
 
+###
+# accountcode
+###
+
+if ( $cgi->param('accountcode') =~ /\S/ ) {
+  my $accountcode = $cgi->param('accountcode');
+  my @accountcode = map {
+    ( my $v = $_ ) =~ s/^\s+|\s+$//g;    # trim margin whitespace
+    length $v ? dbh->quote($v) : ()
+  } grep /\S/, split /\R/, $accountcode;    # collect non-trivial lines
+  if (@accountcode) {
+    my $search = 'accountcode IN ( ' . join( ',', @accountcode ) . ' )';
+    push @qsearch, $search;
+    push @search,  $search;
+  }
+}
+
 ###
 # finish it up
 ###