summaryrefslogtreecommitdiff
path: root/httemplate/search
diff options
context:
space:
mode:
authorDavid Houghton <houghton@freeside.biz>2014-09-10 12:09:40 -0400
committerDavid Houghton <houghton@freeside.biz>2014-09-10 15:18:34 -0400
commit6912944a9959e4046b095fbd378f5545c2caca9e (patch)
tree8b7e0b36b88ff45906a5d533d8c4eb5fed485838 /httemplate/search
parent7b714ce82744920c03ac8275f59a98b085e644d7 (diff)
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.
Diffstat (limited to 'httemplate/search')
-rw-r--r--httemplate/search/cdr.html19
-rw-r--r--httemplate/search/report_cdr.html5
2 files changed, 24 insertions, 0 deletions
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
@@ -258,6 +258,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
@@ -148,6 +148,11 @@
</TR>
<TR>
+ <TD ALIGN="right">Acct Code (one per-line):</TD>
+ <TD><TEXTAREA NAME="accountcode"></TEXTAREA></TD>
+ </TR>
+
+ <TR>
<TH CLASS="background" COLSPAN=2>&nbsp;</TH>
</TR>