summaryrefslogtreecommitdiff
path: root/bin/standardize-locations
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2013-10-04 15:25:20 -0700
committerMark Wells <mark@freeside.biz>2013-10-04 15:25:20 -0700
commit7d967f5ac6929fddc08cc077bcd44ea48a3937f2 (patch)
tree985256b6f9970c6ff148d587900fc421dfa11561 /bin/standardize-locations
parent5d1f486c543c2e61cea6c050bed86c0c9815085e (diff)
improvements to TomTom address standardization, #13763
Diffstat (limited to 'bin/standardize-locations')
-rwxr-xr-xbin/standardize-locations25
1 files changed, 25 insertions, 0 deletions
diff --git a/bin/standardize-locations b/bin/standardize-locations
new file mode 100755
index 000000000..6e5fd3c16
--- /dev/null
+++ b/bin/standardize-locations
@@ -0,0 +1,25 @@
+#!/usr/bin/perl -w
+
+use strict;
+use FS::UID 'adminsuidsetup';
+use FS::Conf;
+use FS::queue;
+
+my $user = shift or die "usage:\n standardize-locations user";
+adminsuidsetup($user);
+my $conf = FS::Conf->new;
+my $method = $conf->config('address_standardize_method')
+ or die "No address standardization method configured.\n";
+if ($method eq 'usps') {
+ # we're not supposed to do this
+ # (allow it anyway with a warning?)
+ die "USPS standardization does not allow batch processing.\n";
+}
+my $job = FS::queue->new({
+ job => 'FS::cust_location::process_standardize'
+});
+my $error = $job->insert('_JOB');
+die $error if $error;
+print "Address standardization job scheduled.\n";
+
+1;