X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_bill_pkg.cgi;h=4c5e90f6a94c715a630c7e2a56f931fc2e87e5a6;hb=ecd1baba392d971b49a50f133349f85aaec548a0;hp=744286a685036e634ac98286b1870f8029778d93;hpb=eedfe58ba50912dbfb490aa47930bbc0ab9e3ac9;p=freeside.git diff --git a/httemplate/search/cust_bill_pkg.cgi b/httemplate/search/cust_bill_pkg.cgi index 744286a68..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. @@ -294,6 +294,10 @@ if ( $cgi->param('salesnum') =~ /^(\d+)$/ ) { push @where, "$cmp_salesnum = $salesnum"; + #because currently we're called from sales_pkg_class.html for a specific + # class (or empty class) but not for all classes + #will have to do something to distinguish if someone wants the sales report + # (report_cust_bill_pkg.html) to have a sales person dropdown $cgi->param('classnum', 0) unless $cgi->param('classnum'); } @@ -345,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') ) ; }