diff options
| author | Ivan Kohler <ivan@freeside.biz> | 2013-09-07 02:05:53 -0700 |
|---|---|---|
| committer | Ivan Kohler <ivan@freeside.biz> | 2013-09-07 02:05:53 -0700 |
| commit | ecd1baba392d971b49a50f133349f85aaec548a0 (patch) | |
| tree | 0a27b879d9e90d594b158e79a5bbaafc89e2bcd8 /httemplate/search/cust_bill_pkg.cgi | |
| parent | 7c1409560cf16d68b3ba132d3e2698a83153b484 (diff) | |
select multiple package classes (or report classes) on sales report, RT#24776
Diffstat (limited to 'httemplate/search/cust_bill_pkg.cgi')
| -rw-r--r-- | httemplate/search/cust_bill_pkg.cgi | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/httemplate/search/cust_bill_pkg.cgi b/httemplate/search/cust_bill_pkg.cgi index 7ed320f72..4c5e90f6a 100644 --- a/httemplate/search/cust_bill_pkg.cgi +++ b/httemplate/search/cust_bill_pkg.cgi @@ -132,8 +132,8 @@ Filtering parameters: - classnum: Filter on package class. - report_optionnum: Filter on package report class. Can be a single report - class number, a comma-separated list, the word "multiple", or an empty - string (for "no report class"). + class number or a comma-separated list (where 0 is "no report class"), or the + word "multiple". - use_override: Apply "classnum" and "taxclass" filtering based on the override (bundle) pkgpart, rather than always using the true pkgpart. @@ -349,15 +349,22 @@ if ( $cgi->param('nottax') ) { # not specified: all classes # 0: empty class # N: classnum - if ( $cgi->param('classnum') =~ /^(\d+)$/ ) { - push @where, "COALESCE($part_pkg.classnum, 0) = $1"; + if ( grep { $_ eq 'classnum' } $cgi->param ) { + my @classnums = grep /^\d+$/, $cgi->param('classnum'); + push @where, "COALESCE($part_pkg.classnum, 0) IN ( ". + join(',', @classnums ). + ' )' + if @classnums; + } + + if ( grep { $_ eq 'report_optionnum' } $cgi->param ) { + my @nums = grep /^\w+$/, $cgi->param('report_optionnum'); + my $num = join(',', @nums); + push @where, # code reuse FTW + FS::Report::Table->with_report_option( $num, $cgi->param('use_override')); } if ( $cgi->param('report_optionnum') =~ /^(\w+)$/ ) { - # code reuse FTW - my $num = $1; - push @where, - FS::Report::Table->with_report_option( $1, $cgi->param('use_override') ) ; } |
