summaryrefslogtreecommitdiff
path: root/httemplate/search/cust_bill_pkg.cgi
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/search/cust_bill_pkg.cgi')
-rw-r--r--httemplate/search/cust_bill_pkg.cgi16
1 files changed, 12 insertions, 4 deletions
diff --git a/httemplate/search/cust_bill_pkg.cgi b/httemplate/search/cust_bill_pkg.cgi
index cc0f97536..4779071a4 100644
--- a/httemplate/search/cust_bill_pkg.cgi
+++ b/httemplate/search/cust_bill_pkg.cgi
@@ -12,15 +12,23 @@ my $join_pkg = "
LEFT JOIN part_pkg USING ( pkgpart )
";
-my $where = "
- WHERE _date >= $beginning AND _date <= $ending
- AND payby != 'COMP'
-";
+my $where = " WHERE _date >= $beginning AND _date <= $ending ";
+
+$where .= " AND payby != 'COMP' "
+ unless $cgi->param('include_comp_cust');
if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
$where .= " AND agentnum = $1 ";
}
+if ( $cgi->param('classnum') =~ /^(\d+)$/ ) {
+ if ( $1 == 0 ) {
+ $where .= " AND classnum IS NULL ";
+ } else {
+ $where .= " AND classnum = $1 ";
+ }
+}
+
if ( $cgi->param('out') ) {
$where .= "