diff options
| author | levinse <levinse> | 2011-05-04 05:44:27 +0000 | 
|---|---|---|
| committer | levinse <levinse> | 2011-05-04 05:44:27 +0000 | 
| commit | 3e01db10352a025538da91ec103b2c2ce562b11b (patch) | |
| tree | 071166d9deb7d7be4ebd98bd897add2234efe930 | |
| parent | bb582ac8b4f2aee6dc4554a13acddcd8becfafe9 (diff) | |
add USPS-unvalidated customer addresses report, RT12402
| -rw-r--r-- | httemplate/elements/menu.html | 2 | ||||
| -rwxr-xr-x | httemplate/search/cust_main.cgi | 8 | 
2 files changed, 10 insertions, 0 deletions
| diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html index 6c704be42..947165627 100644 --- a/httemplate/elements/menu.html +++ b/httemplate/elements/menu.html @@ -100,6 +100,8 @@ tie my %report_customers_lists, 'Tie::IxHash',  ;  $report_customers_lists{'by active trouble tickets'} = [ $fsurl. 'search/cust_main.cgi?browse=tickets', '' ]    if $conf->config('ticket_system'); +$report_customers_lists{'with USPS-unvalidated addresses'} = [ $fsurl. 'search/cust_main.cgi?browse=uspsunvalid', '' ] +  if $conf->config('usps_webtools-userid') && $conf->config('usps_webtools-password');  tie my %report_customers_search, 'Tie::IxHash';  $report_customers_search{'by ordering employee'} = [ $fsurl. 'search/cust_main-otaker.cgi' ] diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi index 8fbf6364c..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; | 
