diff options
| -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>  | 
