blob: 89c869a962ccc808efb3b09996f1b106479f6fba (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#!/usr/bin/perl -w
use strict;
use FS::UID qw(adminsuidsetup);
use FS::Record qw( qsearchs );
use FS::cust_main;
my $user = shift or die "usage: cust_main-show_geocoding username custnum ...\n";
adminsuidsetup $user;
my @custnums = @ARGV;
while ( my $custnum = shift @custnums ) {
my $cust_main = qsearchs({
'table' => 'cust_main',
'hashref' => { 'custnum' => $custnum }
});
if ( !$cust_main ) {
warn "can't find custnum $custnum\n";
next;
}
my $output =
$cust_main->custnum. ': '. $cust_main->name. ': '.
'zip: '. $cust_main->zip. ', '.
'database geocode: '. $cust_main->get('geocode'). ', ';
$cust_main->set('geocode', '');
$output .= 'computed geocode: '. $cust_main->geocode('cch');
print "$output\n";
}
1;
|