add USPS-unvalidated customer addresses report, RT12402
authorlevinse <levinse>
Wed, 4 May 2011 05:44:29 +0000 (05:44 +0000)
committerlevinse <levinse>
Wed, 4 May 2011 05:44:29 +0000 (05:44 +0000)
httemplate/elements/menu.html
httemplate/search/cust_main.cgi

index 6e65267..ffc3529 100644 (file)
@@ -88,6 +88,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' ]
index 8fbf636..ba7d4e3 100755 (executable)
 %      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";
 %    }
 %  $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;