summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--httemplate/elements/menu.html2
-rwxr-xr-xhttemplate/search/cust_main.cgi8
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;