+if ( $cgi->param('credbatch') =~ /^([\w\-\/\.\:]+)$/ ) {
+ push @search, "cust_credit.credbatch = '$1'";
+}
+
+# commission_salesnum
+if ( $cgi->param('commission_salesnum') =~ /^(\d+)$/ ) {
+ push @search, "commission_salesnum = $1";
+}
+
+# commission agentnum
+if ( $cgi->param('commission_agentnum') =~ /^(\d+)$/ ) {
+ push @search, "commission_agentnum = $1";
+}
+
+# commission_classnum
+if ( grep { $_ eq 'commission_classnum' } $cgi->param ) {
+ $cgi->param('commission_classnum') =~ /^(\d*)$/ or die 'guru meditation #13';
+ my $classnum = $1;
+ push @search, "part_pkg.classnum ". ( $classnum ? " = $classnum"
+ : " IS NULL " );
+
+ $addl_from .=
+ ' LEFT JOIN cust_pkg ON ( commission_pkgnum = cust_pkg.pkgnum ) '.
+ ' LEFT JOIN part_pkg USING ( pkgpart ) ';
+}
+