1 % if ( ! $conf->exists('enable_taxclasses')
2 % || scalar(@{ $opt{'taxclasses'} }) == 0
5 <INPUT TYPE="hidden" NAME="<% $opt{'element_name'} || $opt{'field'} || 'taxclass' %>" VALUE="<% $selected_taxclass %>">
10 <TD ALIGN="right"><% $opt{'label'} || 'Tax class: ' %></TD>
12 <% include( '/elements/select-taxclass.html', 'curr_value' => $selected_taxclass, %opt ) %>
20 my $conf = new FS::Conf;
21 my $selected_taxclass = $opt{'curr_value'}; # || $opt{'value'} necessary?
23 unless ( $opt{'taxclasses'} ) {
25 #my $sth = dbh->prepare('SELECT DISTINCT taxclass FROM cust_main_county')
26 my $sth = dbh->prepare('SELECT taxclass FROM part_pkg_taxclass')
28 $sth->execute or die $sth->errstr;
29 my %taxclasses = map { $_->[0] => 1 } @{$sth->fetchall_arrayref};
30 @{ $opt{'taxclasses'} } = grep $_, keys %taxclasses;