1 <% include('/elements/header-popup.html', "Enter $title") %>
3 <% include('/elements/error.html') %>
5 <FORM ACTION="<% $p1 %>process/cust_main_county-expand.cgi" METHOD=POST>
7 <INPUT TYPE="hidden" NAME="taxnum" VALUE="<% $taxnum %>">
8 <INPUT TYPE="hidden" NAME="taxclass" VALUE="<% $taxclass |h %>">
10 <TEXTAREA NAME="expansion" COLS="50" ROWS="16"><% $expansion |h %></TEXTAREA>
13 <INPUT TYPE="submit" VALUE="Add <% $title %>">
21 my($taxnum, $expansion, $taxclass);
22 my($query) = $cgi->keywords;
23 if ( $cgi->param('error') ) {
24 $taxnum = $cgi->param('taxnum');
25 $expansion = $cgi->param('expansion');
26 $taxclass = $cgi->param('taxclass');
28 $query =~ /^(taxclass)?(\d+)$/
29 or die "Illegal taxnum (query $query)";
30 $taxclass = $1 ? 'taxclass' : '';
35 my $cust_main_county = qsearchs('cust_main_county',{'taxnum'=>$taxnum})
36 or die "cust_main_county.taxnum $taxnum not found";
40 die "Can't expand entry!" if $cust_main_county->taxclass;
42 $title = 'Tax Classes';
44 # prepopuplate with other tax classes... which should really have a primary
45 # key of their own... also this could be more efficient in the error case...
46 my $sth = dbh->prepare("SELECT DISTINCT taxclass FROM cust_main_county")
48 $sth->execute or die $sth->errstr;
49 my %taxclasses = map { $_->[0] => 1 } @{$sth->fetchall_arrayref};
50 $expansion ||= join("\n", grep $_, keys %taxclasses );
53 die "Can't expand entry!" if $cust_main_county->county;
55 if ( $cust_main_county->state ) {
58 $title = 'States/Provinces';