X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_main%2FSearch.pm;h=bfaf6217ced916e872566e1b10c826fa3f771160;hp=a0cf86f3681fc3d0a844658fdd7e4f7a4068fbdb;hb=adbca1f8b7f96efe7915ecc8c101ad1cb8c5f6f2;hpb=bb43c7254ddd543d50c230a36a86dd20771decaf diff --git a/FS/FS/cust_main/Search.pm b/FS/FS/cust_main/Search.pm index a0cf86f36..bfaf6217c 100644 --- a/FS/FS/cust_main/Search.pm +++ b/FS/FS/cust_main/Search.pm @@ -232,9 +232,9 @@ sub smart_search { #doesn't throw a wrench in the works) push @cust_main, qsearch( { - 'table' => 'cust_main', - 'hashref' => { %options }, - 'extra_sql' => + 'table' => 'cust_main', + 'hashref' => { %options }, + 'extra_sql' => ( keys(%options) ? ' AND ' : ' WHERE ' ). join(' AND ', " LOWER(first) = ". dbh->quote(lc($first)), @@ -242,7 +242,7 @@ sub smart_search { " LOWER(company) = ". dbh->quote(lc($company)), $agentnums_sql, ), - } ), + } ); #contacts? # probably not necessary for the "something a browser remembered" case @@ -383,6 +383,7 @@ sub smart_search { if ( $conf->exists('address1-search') && length($value) >= $min_len ) { push @cust_main, qsearch( { + select => 'cust_main.*', table => 'cust_main', addl_from => 'JOIN cust_location USING (custnum)', extra_sql => 'WHERE '. @@ -464,6 +465,7 @@ sub smart_search { my $mask_search = FS::payinfo_Mixin->mask_payinfo('CARD', $card_search); push @cust_main, qsearch({ + 'select' => 'cust_main.*', 'table' => 'cust_main', 'addl_from' => ' JOIN cust_payby USING (custnum)', 'hashref' => {},