diff options
author | ivan <ivan> | 2010-03-16 01:00:40 +0000 |
---|---|---|
committer | ivan <ivan> | 2010-03-16 01:00:40 +0000 |
commit | 817ed80a2075a927546c11f737cdf39856a75f51 (patch) | |
tree | c802d0569cc82dc40abe93e156a5865154100eed /httemplate/search/cust_main-zip.html | |
parent | ac92d2d08f9d4ee8a63a0f59a99ff61ddcbc4e7a (diff) |
w/svc_whatever option on zip code distribution report, RT#7784
Diffstat (limited to 'httemplate/search/cust_main-zip.html')
-rw-r--r-- | httemplate/search/cust_main-zip.html | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/httemplate/search/cust_main-zip.html b/httemplate/search/cust_main-zip.html index 56df924bc..e87b21474 100644 --- a/httemplate/search/cust_main-zip.html +++ b/httemplate/search/cust_main-zip.html @@ -32,6 +32,17 @@ if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) { $agentnum = $1; push @where, "cust_main.agentnum = $agentnum"; } + +# select svcdb + +if ( $cgi->param('svcdb') =~ /^(\w+)$/ ) { + my $svcdb = $1; + push @where, "EXISTS( SELECT 1 FROM $svcdb LEFT JOIN cust_svc USING ( svcnum ) + LEFT JOIN cust_pkg USING ( pkgnum ) + WHERE cust_pkg.custnum = cust_main.custnum + )"; +} + my $where = scalar(@where) ? 'WHERE '. join(' AND ', @where) : ''; # bill zip vs ship zip |