From 3e01db10352a025538da91ec103b2c2ce562b11b Mon Sep 17 00:00:00 2001 From: levinse Date: Wed, 4 May 2011 05:44:27 +0000 Subject: [PATCH] add USPS-unvalidated customer addresses report, RT12402 --- httemplate/elements/menu.html | 2 ++ httemplate/search/cust_main.cgi | 8 ++++++++ 2 files changed, 10 insertions(+) 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; -- 2.11.0