X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Ftr-select-taxclass.html;h=22c560ea77896d56e8c352dcf297c1a269430c20;hb=51e2a2439d923d63a5a2321864c69f82272cd362;hp=7006b1ac7602ef30cb17f5c1eb4d0f28516b818f;hpb=fba0d3390b1d53199777735ea0366b450aa2576b;p=freeside.git diff --git a/httemplate/elements/tr-select-taxclass.html b/httemplate/elements/tr-select-taxclass.html index 7006b1ac7..22c560ea7 100644 --- a/httemplate/elements/tr-select-taxclass.html +++ b/httemplate/elements/tr-select-taxclass.html @@ -2,14 +2,18 @@ % || scalar(@{ $opt{'taxclasses'} }) == 0 % ) { - " VALUE="<% $selected_taxclass %>"> + % } else { - <% $opt{'label'} || 'Tax class: ' %> + <% $opt{'label'} || 'Tax class: ' %> - <% include( '/elements/select-taxclass.html', 'curr_value' => $selected_taxclass, %opt ) %> + <% include( '/elements/select-taxclass.html', + 'curr_value' => $selected_taxclass, + %opt + ) + %> @@ -23,9 +27,9 @@ my $selected_taxclass = $opt{'curr_value'}; # || $opt{'value'} necessary? unless ( $opt{'taxclasses'} ) { #my $sth = dbh->prepare('SELECT DISTINCT taxclass FROM cust_main_county') - my $sth = dbh->prepare('SELECT taxclass FROM part_pkg_taxclass') + my $sth = dbh->prepare("SELECT taxclass FROM part_pkg_taxclass WHERE disabled IS NULL OR disabled = '' OR taxclass = ?") or die dbh->errstr; - $sth->execute or die $sth->errstr; + $sth->execute($selected_taxclass) or die $sth->errstr; my %taxclasses = map { $_->[0] => 1 } @{$sth->fetchall_arrayref}; @{ $opt{'taxclasses'} } = grep $_, keys %taxclasses;