+ if ( $opt{'pkg_classnum'} ) {
+ my $classnum = $opt{'pkg_classnum'};
+ $classnum = [ $classnum ] unless ref $classnum;
+ @$classnum = grep /^\d+$/, @$classnum;
+ if (@$classnum) {
+ my $in = 'IN ('. join(',', @$classnum). ')';
+ push @where,
+ "EXISTS(SELECT 1 FROM cust_pkg JOIN part_pkg USING (pkgpart) ".
+ "WHERE cust_pkg.custnum = cust_main.custnum ".
+ "AND part_pkg.classnum $in".
+ ")";
+ }
+ }