X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_main.cgi;h=ba7d4e368bd4b95ce551edfd9bb6f03d81a68071;hb=83053569b3d965924e2e1d4f5b199609ec7c29af;hp=658069b08eb4915099e8f0d5b6d53115f64d959c;hpb=3a02c437eadd9a39f7e56056ca987a4846650209;p=freeside.git diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi index 658069b08..ba7d4e368 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' => $cgi->param('search_cust'), +% 'no_fuzzy_on_exact' => 1, #pref? +% ); % } % % @cust_main = grep { $_->ncancelled_pkgs || ! $_->all_pkgs } @cust_main @@ -270,7 +280,7 @@ % $cgi->param('offset', 0); % print qq!( hide!; % } -% print ' cancelled customers )'; +% print ' canceled customers )'; % } % % if ( $cgi->param('referral_custnum') ) { @@ -485,8 +495,7 @@ %# my $part_pkg = qsearchs( 'part_pkg', { pkgpart => $_->pkgpart } ); % my $part_pkg = $_->part_pkg; % -% my $pkg = $part_pkg->pkg; -% my $comment = $part_pkg->comment; +% my $pkg_comment = $part_pkg->pkg_comment(nopkgpart => 1); % my $show = $curuser->default_customer_view =~ /^(jumbo|packages)$/ % ? '' % : ';show=packages'; @@ -496,7 +505,7 @@ % #my(@cust_svc) = qsearch( 'cust_svc', { 'pkgnum' => $_->pkgnum } ); % my $rowspan = scalar(@cust_svc) || 1; % -% print $n1, qq!$pkg - $comment!; +% print $n1, qq!$pkg_comment!; % % my($n2)=''; % foreach my $cust_svc ( @cust_svc ) { @@ -635,7 +644,7 @@ % } % % if ( $last_type{'Fuzzy'} || $last_type{'All'} ) { -% push @cust_main, FS::cust_main->fuzzy_search( { 'last' => $last } ); +% push @cust_main, FS::cust_main::Search->fuzzy_search( { 'last' => $last } ); % } % % #if ($last_type{'Sound-alike'}) { @@ -682,7 +691,7 @@ % } % % if ( $company_type{'Fuzzy'} || $company_type{'All'} ) { -% push @cust_main, FS::cust_main->fuzzy_search( { 'company' => $company } ); +% push @cust_main, FS::cust_main::Search->fuzzy_search( { 'company' => $company } ); % } % % if ($company_type{'Sound-alike'}) {