Ticket 2916 Debian packages
[freeside.git] / bin / standardize-locations
1 #!/usr/bin/perl -w
2
3 use strict;
4 use FS::UID 'adminsuidsetup';
5 use FS::Conf;
6 use FS::queue;
7
8 my $user = shift or die "usage:\n  standardize-locations user";
9 adminsuidsetup($user);
10 my $conf = FS::Conf->new;
11 my $method = $conf->config('address_standardize_method')
12   or die "No address standardization method configured.\n";
13 if ($method eq 'usps') {
14   # we're not supposed to do this
15   # (allow it anyway with a warning?)
16   die "USPS standardization does not allow batch processing.\n";
17 }
18 my $job = FS::queue->new({
19   job => 'FS::cust_location::process_standardize'
20 });
21 my $error = $job->insert('_JOB');
22 die $error if $error;
23 print "Address standardization job scheduled.\n";
24
25 1;