projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git.freeside.biz:/home/git/freeside
[freeside.git]
/
httemplate
/
search
/
cust_main-zip.html
diff --git
a/httemplate/search/cust_main-zip.html
b/httemplate/search/cust_main-zip.html
index
56df924
..
c317dc3
100644
(file)
--- a/
httemplate/search/cust_main-zip.html
+++ b/
httemplate/search/cust_main-zip.html
@@
-5,7
+5,7
@@
'count_query' => $count_sql,
'header' => [ 'Zip code', 'Customers', ],
#'fields' => [ 'zip', 'num_cust', ],
'count_query' => $count_sql,
'header' => [ 'Zip code', 'Customers', ],
#'fields' => [ 'zip', 'num_cust', ],
- 'links' => [ '', sub { 'somewhere'; } ],
+
#
'links' => [ '', sub { 'somewhere'; } ],
)
%>
<%init>
)
%>
<%init>
@@
-32,6
+32,17
@@
if ( $cgi->param('agentnum') =~ /^(\d+)$/ ) {
$agentnum = $1;
push @where, "cust_main.agentnum = $agentnum";
}
$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
my $where = scalar(@where) ? 'WHERE '. join(' AND ', @where) : '';
# bill zip vs ship zip