From dae72a4ab1dc0a1afaf8d4f2debb509ade36233c Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 25 Feb 2009 20:05:42 +0000 Subject: [PATCH] adding quick tool to change the "states" for japan --- bin/japan.pl | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 bin/japan.pl diff --git a/bin/japan.pl b/bin/japan.pl new file mode 100755 index 000000000..14e44e4ec --- /dev/null +++ b/bin/japan.pl @@ -0,0 +1,32 @@ +#!/usr/bin/perl + +use FS::UID qw( adminsuidsetup ); +use FS::Record qw( qsearch ); +use FS::cust_main_county; + +adminsuidsetup shift; + +my $country = 'JP'; + +foreach my $cust_main_county ( + qsearch('cust_main_county', { 'country' => $country } ) +) { + + if ( $cust_main_county->state =~ /\[([\w ]+)\]\s*$/ ) { + $cust_main_county->state($1); + my $error = $cust_main_county->replace; + die $error if $error; + } + +} + + +#use Locale::SubCountry; +# +##my $state = 'Tôkyô [Tokyo]'; +#my $state = 'Tottori'; +# +#my $lsc = new Locale::SubCountry 'JP'; +# +#print $lsc->code($state)."\n"; + -- 2.11.0