[freeside-commits] freeside/FS/FS/cust_main Search.pm,1.3,1.4
Ivan,,,
ivan at wavetail.420.am
Sun Oct 31 12:12:54 PDT 2010
Update of /home/cvs/cvsroot/freeside/FS/FS/cust_main
In directory wavetail.420.am:/tmp/cvs-serv17329/FS/FS/cust_main
Modified Files:
Search.pm
Log Message:
add search on harcoded geocode customers w/cch, RT#10376
Index: Search.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main/Search.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -w -d -r1.3 -r1.4
--- Search.pm 31 Oct 2010 19:04:56 -0000 1.3
+++ Search.pm 31 Oct 2010 19:12:52 -0000 1.4
@@ -672,7 +672,7 @@
my $count_query = "SELECT COUNT(*) FROM cust_main $extra_sql";
- my $select = join(', ',
+ my @select = (
'cust_main.custnum',
FS::UI::Web::cust_sql_fields($params->{'cust_fields'}),
);
@@ -684,10 +684,10 @@
if ($dbh->{Driver}->{Name} eq 'Pg') {
- $select .= ", array_to_string(array(select pkg from cust_pkg left join part_pkg using ( pkgpart ) where cust_main.custnum = cust_pkg.custnum $pkgwhere),'|') as magic";
+ push @select, "array_to_string(array(select pkg from cust_pkg left join part_pkg using ( pkgpart ) where cust_main.custnum = cust_pkg.custnum $pkgwhere),'|') as magic";
}elsif ($dbh->{Driver}->{Name} =~ /^mysql/i) {
- $select .= ", GROUP_CONCAT(pkg SEPARATOR '|') as magic";
+ push @select, "GROUP_CONCAT(pkg SEPARATOR '|') as magic";
$addl_from .= " LEFT JOIN part_pkg using ( pkgpart )";
}else{
warn "warning: unknown database type ". $dbh->{Driver}->{Name}.
@@ -719,9 +719,13 @@
$c->set('geocode', '');
$c->geocode('cch'); #XXX only cch right now
};
-
+ push @select, 'geocode';
+ push @select, 'zip' unless grep { $_ eq 'zip' } @select;
+ push @select, 'ship_zip' unless grep { $_ eq 'ship_zip' } @select;
}
+ my $select = join(', ', @select);
+
my $sql_query = {
'table' => 'cust_main',
'select' => $select,
More information about the freeside-commits
mailing list