searching for voided payments by void date as well, RT#5786
authorivan <ivan>
Mon, 27 Jul 2009 09:59:06 +0000 (09:59 +0000)
committerivan <ivan>
Mon, 27 Jul 2009 09:59:06 +0000 (09:59 +0000)
httemplate/search/elements/cust_pay_or_refund.html
httemplate/search/report_cust_pay.html

index acd5791..874bd8a 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 } );
@@ -219,6 +218,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';
index a9695ac..dd2358a 100644 (file)
@@ -3,7 +3,13 @@
 <FORM ACTION="<% $void ? 'cust_pay_void.html' : 'cust_pay.cgi' %>" METHOD="GET">
 <INPUT TYPE="hidden" NAME="magic" VALUE="_date">
 
-<TABLE>
+<TABLE BGCOLOR="#cccccc" CELLSPACING=0>
+
+  <TR>
+    <TH BGCOLOR="#e8e8e8" COLSPAN=2 ALIGN="left">
+      <FONT SIZE="+1">Search options</FONT>
+    </TH>
+  </TR>
 
   <TR>
     <TD ALIGN="right">Payments of type: </TD>
              )
   %>
 
-  <% include( '/elements/tr-input-beginning_ending.html' ) %>
+  <TR>
+    <TD ALIGN="right" VALIGN="center">Payment</TD>
+    <TD>
+      <TABLE>
+        <% include( '/elements/tr-input-beginning_ending.html',
+                      layout   => 'horiz',
+                  )
+        %>
+      </TABLE>
+    </TD>
+  </TR>
+
+% if ( $void ) {
+    <TR>
+      <TD ALIGN="right" VALIGN="center">Voided</TD>
+      <TD>
+        <TABLE>
+          <% include( '/elements/tr-input-beginning_ending.html',
+                        prefix => 'void',
+                        layout => 'horiz',
+                    )
+          %>
+        </TABLE>
+      </TD>
+    </TR>
+% }
 
   <% include( '/elements/tr-input-lessthan_greaterthan.html',
                 'label' => 'Amount',