[freeside-commits] freeside/bin expand-country,NONE,1.1

Ivan,,, ivan at wavetail.420.am
Fri Dec 15 00:37:17 PST 2006


Update of /home/cvs/cvsroot/freeside/bin
In directory wavetail:/tmp/cvs-serv21266/bin

Added Files:
	expand-country 
Log Message:
add a quick tool for adding states to old databases

--- NEW FILE: expand-country ---
#!/usr/bin/perl -w

use strict;
use Locale::SubCountry;
use FS::UID qw(adminsuidsetup);
use FS::Setup;
use FS::Record qw(qsearch);
use FS::cust_main_county;

my $user = shift or die &usage;
my $country = shift or die &usage;

adminsuidsetup($user);

my @country = qsearch('cust_main_county', { 'country' => $country } );
die "unknown country $country" unless (@country);
#die "$country already expanded" if scalar(@country) > 1;

foreach my $cust_main_county ( @country ) {
  my $error = $cust_main_county->delete;
  die $error if $error;
}

FS::Setup::_add_country($country);

sub usage {
  die "Usage:\n\n  expand-country user countrycode\n";
}




More information about the freeside-commits mailing list