[freeside-commits] freeside/httemplate/search cust_bill_event.cgi, 1.8, 1.9 cust_bill_event.html, 1.6, 1.7

Ivan,,, ivan at wavetail.420.am
Thu Nov 10 04:47:33 PST 2005


Update of /home/cvs/cvsroot/freeside/httemplate/search
In directory wavetail:/tmp/cvs-serv17327

Modified Files:
	cust_bill_event.cgi cust_bill_event.html 
Log Message:
add part_bill_event.payby selection to failed invoice event search

Index: cust_bill_event.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_bill_event.cgi,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- cust_bill_event.cgi	28 Oct 2005 11:56:48 -0000	1.8
+++ cust_bill_event.cgi	10 Nov 2005 12:47:31 -0000	1.9
@@ -15,10 +15,16 @@
 
 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 @@
                  '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: cust_bill_event.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/search/cust_bill_event.html,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- cust_bill_event.html	2 Jun 2005 09:36:27 -0000	1.6
+++ cust_bill_event.html	10 Nov 2005 12:47:31 -0000	1.7
@@ -51,6 +51,33 @@
   });
 </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>



More information about the freeside-commits mailing list