This commit was manufactured by cvs2svn to create branch
[freeside.git] / httemplate / search / cdr.html
index cfbc5ed..a557596 100644 (file)
@@ -70,10 +70,11 @@ my @search = ();
 ###
 
 my $str2time_sql = str2time_sql;
+my $closing      = str2time_sql_closing;
 
 my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi);
-push @search, "$str2time_sql calldate) >= $beginning ",
-              "$str2time_sql calldate) <= $ending";
+push @search, "$str2time_sql calldate $closing >= $beginning ",
+              "$str2time_sql calldate $closing <= $ending";
 
 ###
 # duration / billsec
@@ -125,7 +126,7 @@ foreach my $param ( grep /^termpart\d+status$/, $cgi->param ) {
     $search =
       "NOT EXISTS ( SELECT 1 FROM cdr_termination WHERE $where_term )";
 
-  } elsif ( $cgi->param('freesidestatus') =~ /^([\w ]+)$/ ) {
+  } elsif ( $status =~ /^([\w ]+)$/ ) {
 
     #false lazienss w/cdr_termination.pm (i should be a part_termination method)
     my $where_term =
@@ -187,6 +188,7 @@ if ( $cgi->param('cdrbatch') ) {
   my $cdr_batch =
     qsearchs('cdr_batch', { 'cdrbatch' => scalar($cgi->param('cdrbatch')) } );
   if ( $cdr_batch ) {
+    $hashref->{cdrbatchnum} = $cdr_batch->cdrbatchnum;
     push @search, 'cdrbatchnum = '. $cdr_batch->cdrbatchnum;
   } else {
     die "unknown cdrbatch ". $cgi->param('cdrbatch');