summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2017-01-17 08:57:56 -0800
committerIvan Kohler <ivan@freeside.biz>2017-01-17 08:57:56 -0800
commitdaed831fd026377530b224ef0d7ed9653a8eb763 (patch)
tree342927b196a77363e10fa910cc380d0b30ddd036
parent547ea96cf713d6eae7ae3797744e0f935e672d33 (diff)
script to reset svc_broadband coordinates, RT#74147
-rwxr-xr-xbin/svc_broadband.reset_coords31
1 files changed, 31 insertions, 0 deletions
diff --git a/bin/svc_broadband.reset_coords b/bin/svc_broadband.reset_coords
new file mode 100755
index 000000000..23b41fd99
--- /dev/null
+++ b/bin/svc_broadband.reset_coords
@@ -0,0 +1,31 @@
+#!/usr/bin/perl
+
+use strict;
+use Text::CSV_XS;
+use FS::UID qw( adminsuidsetup );
+use FS::Record qw( qsearch );
+use FS::svc_broadband;
+
+my $user = shift or die &usage;
+adminsuidsetup $user;
+
+foreach my $svc_broadband (
+ qsearch({
+ 'table' => 'svc_broadband',
+ 'hashref' => {},
+ #'extra_sql' => 'WHERE latitude IS NOT NULL OR longitude IS NOT NULL',
+ })
+) {
+ $svc_broadband->latitude('');
+ $svc_broadband->longitude('');
+ my $error = $svc_broadband->replace;
+ die $error if $error;
+}
+
+sub usage {
+ "Usage:
+ svc_broadband.reset_coords user
+";
+}
+
+1;