[freeside-commits] freeside/bin cust_main-find_bogus_geocode, NONE, 1.1
Ivan,,,
ivan at wavetail.420.am
Sun Oct 31 12:22:05 PDT 2010
Update of /home/cvs/cvsroot/freeside/bin
In directory wavetail.420.am:/tmp/cvs-serv17827
Added Files:
cust_main-find_bogus_geocode
Log Message:
adding, RT#10376
--- NEW FILE: cust_main-find_bogus_geocode ---
#!/usr/bin/perl -w
use strict;
use FS::UID qw(adminsuidsetup);
use FS::Record qw( qsearch );
use FS::cust_main;
my $user = shift or die "usage: cust_main-find_bogus_geocode username\n";
adminsuidsetup $user;
my @cust_main = qsearch({
'table' => 'cust_main',
'extra_sql' => 'WHERE geocode IS NOT NULL',
});
foreach my $cust_main ( @cust_main ) {
my $db_geocode = $cust_main->geocode;
$cust_main->set('geocode', '');
my $calc_geocode = $cust_main->geocode('cch');
next unless $calc_geocode;
my $cust = $cust_main->custnum.': '. $cust_main->name. "\n";
if ( $db_geocode eq $calc_geocode ) {
warn "unnecessary geocode override for $cust";
} else {
warn "bogus geocode override $db_geocode overrides $calc_geocode for $cust";
}
}
1;
More information about the freeside-commits
mailing list