add ability to query ranges of duration & billable seconds to CDR report
authorivan <ivan>
Wed, 26 Mar 2008 02:27:07 +0000 (02:27 +0000)
committerivan <ivan>
Wed, 26 Mar 2008 02:27:07 +0000 (02:27 +0000)
httemplate/search/cdr.html
httemplate/search/report_cdr.html

index 0facc7f..8079b5b 100644 (file)
@@ -24,7 +24,6 @@ my $hashref = {};
 # and fixup $count_query
 
 my @search = ();
-my @qsearch = ();
 
 ###
 # freesidestatus
@@ -51,18 +50,22 @@ if ( $cgi->param('freesidestatus') eq 'NULL' ) {
 my $str2time_sql = str2time_sql;
 
 my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi);
-push @search,
-my @dsearch = ( "$str2time_sql calldate) >= $beginning ",
-                "$str2time_sql calldate) <= $ending"
-             );
-push @search, @dsearch;
-push @qsearch, @search;
+push @search, "$str2time_sql calldate) >= $beginning ",
+              "$str2time_sql calldate) <= $ending";
 
+###
+# duration / billsec
+###
+
+push @search, FS::UI::Web::parse_lt_gt($cgi, 'duration');
+push @search, FS::UI::Web::parse_lt_gt($cgi, 'billsec');
 
 ###
 # src/dest
 ###
 
+my @qsearch = @search;
+
 if ( $cgi->param('src') =~ /^\s*([\d\-\+\ ]+)\s*$/ ) {
   ( my $src = $1 ) =~ s/\D//g;
   $hashref->{'src'} = $src;
index 06f0b1a..1c19150 100644 (file)
@@ -2,7 +2,7 @@
 
 <FORM ACTION="cdr.html" METHOD="GET">
 
-<TABLE>
+<TABLE BGCOLOR="#cccccc" CELLSPACING=0>
   <TR>
     <TD ALIGN="right">Status: </TD>
     <TD>
     </TD>
   </TR>
 
+  <% include( '/elements/tr-input-lessthan_greaterthan.html',
+                'label' => 'Duration (sec)',
+                'field' => 'duration',
+            )
+  %>
+
+  <% include( '/elements/tr-input-lessthan_greaterthan.html',
+                'label' => 'Billable duration (sec)',
+                'field' => 'billsec',
+            )
+  %>
+
 </TABLE>
 
 <BR>