my @where = ( $agentnums_sql );
-push @where, "(duplicate IS NULL OR duplicate = '' )";
-
my($beginning, $ending) = FS::UI::Web::parse_beginning_ending($cgi);
push @where, "_date >= $beginning",
"_date <= $ending";
}
+if ($cgi->param('itemdesc')) {
+ if ($cgi->param('itemdesc') eq 'Tax') {
+ push @where, "(itemdesc='Tax' OR itemdesc is null)";
+ }else{
+ push @where, 'itemdesc='. dbh->quote($cgi->param('itemdesc'));
+ }
+}
push @where, 'pkgnum != 0' if $cgi->param('nottax');
push @where, 'pkgnum = 0' if $cgi->param('istax');