diff options
| author | Mark Wells <mark@freeside.biz> | 2014-01-09 16:37:13 -0800 |
|---|---|---|
| committer | Mark Wells <mark@freeside.biz> | 2014-01-09 16:37:13 -0800 |
| commit | dd0bf7c0db2d97a33bedd324788ca550b54572fc (patch) | |
| tree | 5707f3f26cffac4260dd3c982c7698b5f61eb5b2 /httemplate/search/cust_bill_pkg.cgi | |
| parent | 3f5067134c948ce709324d88421d54217e14ca21 (diff) | |
sales report: fix filtering by report class, #25459, #24776
Diffstat (limited to 'httemplate/search/cust_bill_pkg.cgi')
| -rw-r--r-- | httemplate/search/cust_bill_pkg.cgi | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/httemplate/search/cust_bill_pkg.cgi b/httemplate/search/cust_bill_pkg.cgi index 6e110d64c..ab23e52a8 100644 --- a/httemplate/search/cust_bill_pkg.cgi +++ b/httemplate/search/cust_bill_pkg.cgi @@ -287,7 +287,9 @@ my $join_pkg = LEFT JOIN part_pkg USING (pkgpart)'; my $part_pkg = 'part_pkg'; -if ( $cgi->param('use_override') ) { #"Separate sub-packages from parents" +# "Separate sub-packages from parents" +my $use_override = $cgi->param('use_override') ? 1 : 0; +if ( $use_override ) { # still need the real part_pkg for tax applicability, # so alias this one $join_pkg .= " LEFT JOIN part_pkg AS override ON ( @@ -318,14 +320,16 @@ if ( $cgi->param('nottax') ) { } if ( grep { $_ eq 'report_optionnum' } $cgi->param ) { - my @nums = grep /^\w+$/, $cgi->param('report_optionnum'); - my $num = join(',', @nums); + my $num = join(',', grep /^[\d,]+$/, $cgi->param('report_optionnum')); + my $not_num = join(',', grep /^[\d,]+$/, $cgi->param('not_report_optionnum')); + my $all = $cgi->param('all_report_options') ? 1 : 0; push @where, # code reuse FTW - FS::Report::Table->with_report_option( $num, $cgi->param('use_override')); - } - - if ( $cgi->param('report_optionnum') =~ /^(\w+)$/ ) { - ; + FS::Report::Table->with_report_option( + report_optionnum => $num, + not_report_optionnum => $not_num, + use_override => $use_override, + all_report_options => $all, + ); } # taxclass |
