1 % if ( $conf->exists('enable_taxclasses') ) {
3 <SELECT NAME="taxclass">
5 % if ( $conf->exists('require_taxclasses') ) {
6 <OPTION VALUE="(select)">Select tax class
11 % foreach my $taxclass ( @{ $opt{'taxclasses'} } ) {
12 <OPTION VALUE="<% $taxclass %>"<% $taxclass eq $selected_taxclass ? ' SELECTED' : '' %>><% $taxclass %>
19 <INPUT TYPE="hidden" NAME="taxclass" VALUE="<% $selected_taxclass %>">
25 my( $selected_taxclass, %opt ) = @_;
26 my $conf = new FS::Conf;
28 unless ( $opt{'taxclasses'} ) {
30 my $sth = dbh->prepare('SELECT DISTINCT taxclass FROM cust_main_county')
32 $sth->execute or die $sth->errstr;
33 my %taxclasses = map { $_->[0] => 1 } @{$sth->fetchall_arrayref};
34 @{ $opt{'taxclasses'} } = grep $_, keys %taxclasses;