1 <% $cgi->redirect(popurl(3). "browse/cust_main_county.cgi?".
2 "country=". uri_escape($cgi->param('country')).";".
3 'state='. uri_escape($cgi->param('state')). ';'.
4 'county='. uri_escape($cgi->param('county'))
10 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
12 $cgi->param('taxnum') =~ /^(\d+)$/ or die "Illegal taxnum!";
14 my $cust_main_county = qsearchs('cust_main_county', { 'taxnum' => $taxnum } )
15 or die "Unknown taxnum $taxnum";
17 #really should do this in a .pm & start transaction
20 'country' => $cust_main_county->country,
21 'state' => $cust_main_county->state,
24 $search{'county'} = $cust_main_county->county
25 if $cust_main_county->city;
27 my $error = $cust_main_county->delete;
30 unless ( qsearch('cust_main_county', \%search) ) {
32 #if we're the last, clear our (state?)/county/city and reinsert
34 $cust_main_county->taxnum('');
35 if ( $cust_main_county->city ) {
36 $cust_main_county->city('');
37 } elsif ( $cust_main_county->county ) {
38 $cust_main_county->county('');
40 die "can't remove that";
43 my $error = $cust_main_county->insert;