add part_bill_event.payby selection to failed invoice event search
authorivan <ivan>
Thu, 10 Nov 2005 12:47:31 +0000 (12:47 +0000)
committerivan <ivan>
Thu, 10 Nov 2005 12:47:31 +0000 (12:47 +0000)
httemplate/search/cust_bill_event.cgi
httemplate/search/cust_bill_event.html

index a21fb19..d82a833 100644 (file)
@@ -15,10 +15,16 @@ my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi);
 
 my $where = " WHERE cust_bill_event._date >= $beginning".
             "   AND cust_bill_event._date <= $ending";
-$where .= " AND statustext != '' ".
-          " AND statustext IS NOT NULL ".
-          " AND statustext != 'N/A' "
-  if $cgi->param('failed');
+
+if ( $cgi->param('failed') ) {
+  $where .= " AND statustext != '' ".
+            " AND statustext IS NOT NULL ".
+            " AND statustext != 'N/A' "
+}
+
+if ( $cgi->param('part_bill_event.payby') =~ /^(\w+)$/ ) {
+  $where .= " AND part_bill_event.payby = '$1' ";
+}
 
 my $sql_query = {
   'table'     => 'cust_bill_event',
@@ -38,7 +44,9 @@ my $sql_query = {
                  'LEFT JOIN cust_main       USING ( custnum   ) ',
 };
 
-my $count_sql = "select count(*) from cust_bill_event $where";
+my $count_sql = "SELECT COUNT(*) FROM cust_bill_event ".
+                "LEFT JOIN part_bill_event USING ( eventpart ) ".
+                $where;
 
 my $conf = new FS::Conf;
 
index 476d221..7bc428f 100755 (executable)
   });
 </SCRIPT>
       </TR>
+      <!--
+      <TR>
+        <TD ALIGN="right">Events: </TD>
+        <TD>
+          <SELECT NAME="eventpart">
+            <OPTION SELECTED VALUE=""><%= $cgi->param('failed') ? '(all failed events)' : '(all events)' %>
+            <% foreach my $part_bill_event ( qsearch( 'part_bill_event', {} ) ) { %>
+            <% } %>
+          </SELECT>
+        </TD>
+      </TR>
+      -->
+      <TR>
+        <TD ALIGN="right">Events for payment type: </TD>
+        <TD>
+          <SELECT NAME="part_bill_event.payby">
+            <OPTION SELECTED VALUE="">(all)
+            <OPTION VALUE="CARD">Credit card (automatic)
+            <OPTION VALUE="BILL">Billing
+            <OPTION VALUE="CHEK">Electronic check (automatic)
+            <OPTION VALUE="DCRD">Credit card (on-demand)
+            <OPTION VALUE="DCHK">Electronic check (on-demand)
+            <OPTION VALUE="LECB">Phone bill billing
+            <OPTION VALUE="COMP">Complimentary
+          </SELECT>
+        </TD>
+      </TR>
     </TABLE>
     <BR><INPUT TYPE="submit" VALUE="Get Report">
     </FORM>