[freeside-commits] freeside/FS/FS/cust_main Search.pm, 1.8.2.4, 1.8.2.5
Ivan,,,
ivan at wavetail.420.am
Sun Feb 12 12:53:15 PST 2012
Update of /home/cvs/cvsroot/freeside/FS/FS/cust_main
In directory wavetail.420.am:/tmp/cvs-serv19011
Modified Files:
Tag: FREESIDE_2_3_BRANCH
Search.pm
Log Message:
fix adv. customer search (i.e. no_censustract, RT#15381)
Index: Search.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main/Search.pm,v
retrieving revision 1.8.2.4
retrieving revision 1.8.2.5
diff -u -w -d -r1.8.2.4 -r1.8.2.5
--- Search.pm 31 Jan 2012 21:32:09 -0000 1.8.2.4
+++ Search.pm 12 Feb 2012 20:53:13 -0000 1.8.2.5
@@ -736,7 +736,7 @@
my $extra_sql = scalar(@where) ? ' WHERE '. join(' AND ', @where) : '';
- my $addl_from = 'LEFT JOIN cust_pkg USING ( custnum ) ';
+ my $pkg_join = 'LEFT JOIN cust_pkg USING ( custnum ) ';
my $count_query = "SELECT COUNT(*) FROM cust_main $extra_sql";
@@ -756,13 +756,13 @@
}elsif ($dbh->{Driver}->{Name} =~ /^mysql/i) {
push @select, "GROUP_CONCAT(part_pkg.pkg SEPARATOR '|') as magic";
- $addl_from .= " LEFT JOIN part_pkg using ( pkgpart )";
+ $pkg_join .= " LEFT JOIN part_pkg using ( pkgpart )";
}else{
warn "warning: unknown database type ". $dbh->{Driver}->{Name}.
"omitting packing information from report.";
}
- my $header_query = "SELECT COUNT(cust_pkg.custnum = cust_main.custnum) AS count FROM cust_main $addl_from $extra_sql $pkgwhere group by cust_main.custnum order by count desc limit 1";
+ my $header_query = "SELECT COUNT(cust_pkg.custnum = cust_main.custnum) AS count FROM cust_main $pkg_join $extra_sql $pkgwhere group by cust_main.custnum order by count desc limit 1";
my $sth = dbh->prepare($header_query) or die dbh->errstr;
$sth->execute() or die $sth->errstr;
@@ -797,7 +797,6 @@
my $sql_query = {
'table' => 'cust_main',
'select' => $select,
- 'addl_from' => $addl_from,
'hashref' => {},
'extra_sql' => $extra_sql,
'order_by' => $orderby,
More information about the freeside-commits
mailing list