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";
" ( state = $state OR $state = '' ) ",
" country = $country "
;
+ if ( $cgi->param('taxname') ) {
+ push @where, 'itemdesc = '. dbh->quote( $cgi->param('taxname') );
+ #} elsif ( $cgi->param('taxnameNULL') {
+ } else {
+ push @where, "( itemdesc IS NULL OR itemdesc = '' OR itemdesc = 'Tax' )";
+ }
+
push @where, ' taxclass = '. dbh->quote( $cgi->param('taxclass') )
if $cgi->param('taxclass');
}
+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');