diff options
author | ivan <ivan> | 2005-11-10 12:47:31 +0000 |
---|---|---|
committer | ivan <ivan> | 2005-11-10 12:47:31 +0000 |
commit | 24df1738d4227d02c2ade9c1c83099503b91a1aa (patch) | |
tree | e7778242fa546ed0a43a4d9fd1f7655a37a98860 /httemplate/search/cust_bill_event.cgi | |
parent | f96e5f4b8a63bee2eb32b2ffe5797ec66f00f3d7 (diff) |
add part_bill_event.payby selection to failed invoice event search
Diffstat (limited to 'httemplate/search/cust_bill_event.cgi')
-rw-r--r-- | httemplate/search/cust_bill_event.cgi | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/httemplate/search/cust_bill_event.cgi b/httemplate/search/cust_bill_event.cgi index a21fb1912..d82a83368 100644 --- a/httemplate/search/cust_bill_event.cgi +++ b/httemplate/search/cust_bill_event.cgi @@ -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; |