From: Ivan Kohler Date: Tue, 17 Jan 2017 16:57:54 +0000 (-0800) Subject: script to reset svc_broadband coordinates, RT#74147 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=71df2acf44b4f4c87b52195465f6403e4c7419d2;ds=sidebyside script to reset svc_broadband coordinates, RT#74147 --- 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;