3 %$cgi->param('taxnum') =~ /^(\d+)$/ or die "Illegal taxnum!";
5 %my $cust_main_county = qsearchs('cust_main_county',{'taxnum'=>$taxnum})
6 % or die ("Unknown taxnum!");
9 %if ( $cgi->param('delim') eq 'n' ) {
10 % @expansion=split(/\n/,$cgi->param('expansion'));
11 %} elsif ( $cgi->param('delim') eq 's' ) {
12 % @expansion=split(' ',$cgi->param('expansion'));
14 % die "Illegal delim!";
18 % unless ( /^\s*([\w\- ]+)\s*$/ ) {
19 % $cgi->param('error', "Illegal item in expansion");
20 % print $cgi->redirect(popurl(2). "cust_main_county-expand.cgi?". $cgi->query_string );
26 %foreach ( @expansion) {
27 % my(%hash)=$cust_main_county->hash;
28 % my($new)=new FS::cust_main_county \%hash;
29 % $new->setfield('taxnum','');
30 % if ( $cgi->param('taxclass') ) {
31 % $new->setfield('taxclass', $_);
32 % } elsif ( ! $cust_main_county->state ) {
33 % $new->setfield('state',$_);
35 % $new->setfield('county',$_);
37 % #if (datasrc =~ m/Pg/)
39 % # $new->setfield('tax',0.0);
41 % my($error)=$new->insert;
42 % die $error if $error;
45 %unless ( qsearch( 'cust_main', {
46 % 'state' => $cust_main_county->state,
47 % 'county' => $cust_main_county->county,
48 % 'country' => $cust_main_county->country,
52 % my($error)=($cust_main_county->delete);
53 % die $error if $error;
56 %print $cgi->redirect(popurl(3). "browse/cust_main_county.cgi");