1 % if ( $conf->exists('enable_taxclasses') ) {
3 <SELECT NAME="<% $opt{'element_name'} || $opt{'field'} || '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="<% $opt{'element_name'} || $opt{'field'} || 'taxclass' %>" VALUE="<% $selected_taxclass %>">
26 my $selected_taxclass = $opt{'curr_value'}; # || $opt{'value'} necessary?
28 my $conf = new FS::Conf;
30 unless ( $opt{'taxclasses'} ) {
32 #my $sth = dbh->prepare('SELECT DISTINCT taxclass FROM cust_main_county')
33 my $sth = dbh->prepare("SELECT taxclass FROM part_pkg_taxclass WHERE disabled IS NULL OR disabled = '' OR taxclass = ?")
35 $sth->execute($selected_taxclass) or die $sth->errstr;
36 my %taxclasses = map { $_->[0] => 1 } @{$sth->fetchall_arrayref};
37 @{ $opt{'taxclasses'} } = grep $_, keys %taxclasses;