X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_main.cgi;h=d1239e30d9b3f611cdcea868250e48d844537740;hb=549ea5ca46ce948b5de2653404e72ab72b541272;hp=93f960f5c8bd5d96f18e2ad1802b1cb1ea1a4357;hpb=9b05a3660eabd3215bdebf9429eb490b41570436;p=freeside.git diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi index 93f960f5c..d1239e30d 100755 --- a/httemplate/search/cust_main.cgi +++ b/httemplate/search/cust_main.cgi @@ -83,6 +83,10 @@ % push @select, FS::TicketSystem->sql_num_customer_tickets. " as tickets"; % push @addl_headers, 'Tickets'; % push @addl_cols, 'tickets'; +% } elsif ( $query eq 'uspsunvalid' ) { +% $search{'country'} = 'US'; +% $sortby=\*custnum_sort; +% $orderby = "ORDER BY custnum"; % } else { % die "unknown browse field $query"; % } @@ -132,6 +136,10 @@ % $addl_qual .= ( $addl_qual ? ' AND ' : '' ). % $FS::CurrentUser::CurrentUser->agentnums_sql; % +% if ( $cgi->param('browse') && $cgi->param('browse') eq 'uspsunvalid' ) { +% $addl_qual .= ' AND ( length(zip) < 9 OR upper(address1) != address1 OR upper(city) != city ) '; +% } +% % if ( $addl_qual ) { % $qual .= ' AND ' if $qual; % $qual .= $addl_qual; @@ -204,7 +212,9 @@ % if ( $cgi->param('search_cust') ) { % $sortby = \*company_sort; % $orderby = "ORDER BY LOWER(company || ' ' || last || ' ' || first )"; -% push @cust_main, smart_search( 'search' => $cgi->param('search_cust') ); +% push @cust_main, smart_search( 'search' => scalar($cgi->param('search_cust')), +% 'no_fuzzy_on_exact' => 1, #pref? +% ); % } % % @cust_main = grep { $_->ncancelled_pkgs || ! $_->all_pkgs } @cust_main