push @where, "cust_bill._date >= $beginning",
"cust_bill._date <= $ending";
}
push @where, "cust_bill._date >= $beginning",
"cust_bill._date <= $ending";
}
- # taxclass
- if ( $cgi->param('taxclassNULL') ) {
- push @where, 'cust_main_county.taxclass IS NULL';
- }
+ # taxclass
+ if ( $cgi->param('taxclassNULL') ) {
+ push @where, 'cust_main_county.taxclass IS NULL';
+ }
- # taxname
- if ( $cgi->param('taxnameNULL') ) {
- push @where, 'cust_main_county.taxname IS NULL OR '.
- 'cust_main_county.taxname = \'Tax\'';
- } elsif ( $cgi->param('taxname') ) {
- push @where, 'cust_main_county.taxname = '.
- dbh->quote($cgi->param('taxname'));
- }
+ # taxname
+ if ( $cgi->param('taxnameNULL') ) {
+ push @where, 'cust_main_county.taxname IS NULL OR '.
+ 'cust_main_county.taxname = \'Tax\'';
+ } elsif ( $cgi->param('taxname') ) {
+ push @where, 'cust_main_county.taxname = '.
+ dbh->quote($cgi->param('taxname'));
+ }
- # itemdesc, for breakdown from the vendor tax report
- 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'));
+ # itemdesc, for breakdown from the vendor tax report
+ 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'));
+ }
JOIN cust_credit USING (crednum)
LEFT JOIN reason USING (reasonnum)
LEFT JOIN access_user USING (usernum)
JOIN cust_credit USING (crednum)
LEFT JOIN reason USING (reasonnum)
LEFT JOIN access_user USING (usernum)
GROUP BY billpkgnum, billpkgtaxlocationnum, reason.reason,
access_user.username";
GROUP BY billpkgnum, billpkgtaxlocationnum, reason.reason,
access_user.username";
JOIN cust_credit USING (crednum)
LEFT JOIN reason USING (reasonnum)
LEFT JOIN access_user USING (usernum)
JOIN cust_credit USING (crednum)
LEFT JOIN reason USING (reasonnum)
LEFT JOIN access_user USING (usernum)
GROUP BY billpkgnum, reason.reason, access_user.username";
$join_pkg .= " LEFT JOIN ($credit_sub) AS item_credit USING (billpkgnum)";
}
GROUP BY billpkgnum, reason.reason, access_user.username";
$join_pkg .= " LEFT JOIN ($credit_sub) AS item_credit USING (billpkgnum)";
}