diff options
author | mark <mark> | 2010-08-28 00:18:28 +0000 |
---|---|---|
committer | mark <mark> | 2010-08-28 00:18:28 +0000 |
commit | afedae91da04b21f86e3dc97fa83e3391969a993 (patch) | |
tree | 3697475fc88174e40a0f432cad0ceb8f57df7ff3 /httemplate/search | |
parent | fff0c848e4c9933934b8da41d23e45b204cac11b (diff) |
Filter invoice report by payby, RT#9263
Diffstat (limited to 'httemplate/search')
-rwxr-xr-x | httemplate/search/cust_bill.html | 12 | ||||
-rw-r--r-- | httemplate/search/report_cust_bill.html | 7 |
2 files changed, 17 insertions, 2 deletions
diff --git a/httemplate/search/cust_bill.html b/httemplate/search/cust_bill.html index 1e9ee8dcb..cf6ce4999 100755 --- a/httemplate/search/cust_bill.html +++ b/httemplate/search/cust_bill.html @@ -122,8 +122,16 @@ if ( $cgi->param('invnum') =~ /^\s*(FS-)?(\d+)\s*$/ ) { $search{'newest_percust'} = 1; $count_query = "SELECT COUNT(DISTINCT cust_bill.custnum), 'N/A', 'N/A'"; } - - my $extra_sql = ' WHERE '. FS::cust_bill->search_sql_where( \%search ); + + my $payby_sql = ''; + $payby_sql = ' AND (' . + join(' OR ', map { "cust_main.payby = '$_'" } $cgi->param('payby') ) . + ')' + if $cgi->param('payby'); + + my $extra_sql = ' WHERE '. + FS::cust_bill->search_sql_where( \%search ). + $payby_sql; unless ( $count_query ) { $count_query = 'SELECT COUNT(*), '. join(', ', diff --git a/httemplate/search/report_cust_bill.html b/httemplate/search/report_cust_bill.html index 00d566a62..b1a252e6c 100644 --- a/httemplate/search/report_cust_bill.html +++ b/httemplate/search/report_cust_bill.html @@ -25,6 +25,13 @@ field => 'owed', ) %> + <% include( '/elements/tr-select-payby.html', + label => 'Payment method:', + payby_type => 'cust', + multiple => 1, + all_selected => 1, + ) + %> <TR> <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="open" VALUE="1" CHECKED></TD> |