add -t flag to bulk void for payment type, RT#73413
[freeside.git] / bin / expand-country
1 #!/usr/bin/perl -w
2
3 use strict;
4 use Locale::SubCountry;
5 use FS::UID qw(adminsuidsetup);
6 use FS::Setup;
7 use FS::Record qw(qsearch);
8 use FS::cust_main_county;
9
10 my $user = shift or die &usage;
11 my $country = shift or die &usage;
12
13 adminsuidsetup($user);
14
15 my @country = qsearch('cust_main_county', { 'country' => $country } );
16 die "unknown country $country" unless (@country);
17 #die "$country already expanded" if scalar(@country) > 1;
18
19 foreach my $cust_main_county ( @country ) {
20   my $error = $cust_main_county->delete;
21   die $error if $error;
22 }
23
24 FS::Setup::_add_country($country);
25
26 sub usage {
27   die "Usage:\n\n  expand-country user countrycode\n";
28 }
29