quick script to add armed forces USPS "state" abbrivations, RT#77312
authorIvan Kohler <ivan@freeside.biz>
Tue, 29 Aug 2017 18:33:18 +0000 (11:33 -0700)
committerIvan Kohler <ivan@freeside.biz>
Tue, 29 Aug 2017 18:33:18 +0000 (11:33 -0700)
bin/add-usps-af [new file with mode: 0755]

diff --git a/bin/add-usps-af b/bin/add-usps-af
new file mode 100755 (executable)
index 0000000..5aec110
--- /dev/null
@@ -0,0 +1,29 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use FS::UID qw( adminsuidsetup );
+use FS::Setup;
+
+adminsuidsetup(shift) or die "usage: add-usps-af username\n";
+
+  my %addl = (
+    'US' => {
+#      'FM' => 'Federated States of Micronesia',
+#      'MH' => 'Marshall Islands',
+#      'PW' => 'Palau',
+      'AA' => "Armed Forces Americas (except Canada)",
+      'AE' => "Armed Forces Europe / Canada / Middle East / Africa",
+      'AP' => "Armed Forces Pacific",
+    },
+  );
+
+  foreach my $country ( keys %addl ) {
+    foreach my $state ( keys %{ $addl{$country} } ) {
+      # $longname = $addl{$country}{$state};
+      FS::Setup::_add_locale( 'country'=>$country, 'state'=>$state);
+    }
+  }
+
+1;
+