From: David Houghton Date: Wed, 10 Sep 2014 16:09:40 +0000 (-0400) Subject: ticket: 27309; add accountcode X-Git-Url: http://git.freeside.biz/gitweb/?a=commitdiff_plain;h=6912944a9959e4046b095fbd378f5545c2caca9e;p=freeside.git ticket: 27309; add accountcode I tested this as best I could. I worked with my fake data. I accounted for ' and blank lines, assuming terminal whitespace was irrelevant. --- diff --git a/httemplate/search/cdr.html b/httemplate/search/cdr.html index ca303d386..10b386383 100644 --- a/httemplate/search/cdr.html +++ b/httemplate/search/cdr.html @@ -257,6 +257,25 @@ 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; + if ( $v =~ /'/ ) { $v =~ s/'/\\'/g; $v = "E'$v'" } + elsif ( length $v ) { $v = "'$v'" } + length $v ? $v : () + } grep /\S/, split /\R/, $accountcode; + if (@accountcode) { + my $search = 'accountcode IN ( ' . join( ',', @accountcode ) . ' )'; + push @qsearch, $search; + push @search, $search; + } +} + ### # finish it up ### diff --git a/httemplate/search/report_cdr.html b/httemplate/search/report_cdr.html index 0e1693b9c..fe840ea0b 100644 --- a/httemplate/search/report_cdr.html +++ b/httemplate/search/report_cdr.html @@ -147,6 +147,11 @@ + + Acct Code (one per-line): + + +