add otaker to payment/refund search, RT#6407
[freeside.git] / httemplate / search / elements / cust_pay_or_refund.html
index acd5791..b1296d1 100755 (executable)
@@ -117,7 +117,6 @@ if ( $cgi->param('magic') ) {
   my $orderby;
   if ( $cgi->param('magic') eq '_date' ) {
 
-
     if ( $cgi->param('agentnum') && $cgi->param('agentnum') =~ /^(\d+)$/ ) {
       push @search, "agentnum = $1"; # $search{'agentnum'} = $1;
       my $agent = qsearchs('agent', { 'agentnum' => $1 } );
@@ -210,6 +209,10 @@ if ( $cgi->param('magic') ) {
       push @search, "cust_$thing.payinfo = '$1'";
     }
 
+    if ( $cgi->param('otaker') =~ /^(\w+)$/ ) {
+      push @search, "cust_$thing.otaker = '$1'";
+    }
+
     #for cust_pay_pending...  statusNOT=done
     if ( $cgi->param('statusNOT') =~ /^(\w+)$/ ) {
       push @search, "status != '$1'";
@@ -219,6 +222,13 @@ if ( $cgi->param('magic') ) {
     push @search, "_date >= $beginning ",
                   "_date <= $ending";
 
+    if ( $thing eq 'pay_void' ) {
+      my($v_beginning, $v_ending) =
+        FS::UI::Web::parse_beginning_ending($cgi, 'void');
+      push @search, "void_date >= $v_beginning ",
+                    "void_date <= $v_ending";
+    }
+
     push @search, FS::UI::Web::parse_lt_gt($cgi, $amount_field );
 
     $orderby = '_date';