diff options
author | ivan <ivan> | 2006-05-08 10:01:54 +0000 |
---|---|---|
committer | ivan <ivan> | 2006-05-08 10:01:54 +0000 |
commit | 896ef9b1a5302dc2d96d351702be94184825cc91 (patch) | |
tree | d4d72a79c68e62aeb3489795e9bd2be2b7ddc44a /httemplate/search/cust_bill_pkg.cgi | |
parent | e65c6a26ca778166aec2b2d1dd3012ab84fa611a (diff) |
sales report per agent and package class looks good
Diffstat (limited to 'httemplate/search/cust_bill_pkg.cgi')
-rw-r--r-- | httemplate/search/cust_bill_pkg.cgi | 16 |
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 .= " |