X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Ftr-select-taxclass.html;h=7006b1ac7602ef30cb17f5c1eb4d0f28516b818f;hb=9dc88f6c738f30ce1eb6339ba4b739b45555dea4;hp=a20dd17b505dfa24c3c3b16701d77984260f24c6;hpb=9509e5bfb7f9331303153cac24d7bfecbe2ea9f1;p=freeside.git diff --git a/httemplate/elements/tr-select-taxclass.html b/httemplate/elements/tr-select-taxclass.html index a20dd17b5..7006b1ac7 100644 --- a/httemplate/elements/tr-select-taxclass.html +++ b/httemplate/elements/tr-select-taxclass.html @@ -2,27 +2,29 @@ % || scalar(@{ $opt{'taxclasses'} }) == 0 % ) { - " VALUE="<% $taxclass %>"> + " VALUE="<% $selected_taxclass %>"> % } else { <% $opt{'label'} || 'Tax class: ' %> - <% include( '/elements/select-taxclass.html', $taxclass, %opt ) %> + <% include( '/elements/select-taxclass.html', 'curr_value' => $selected_taxclass, %opt ) %> % } <%init> -my( $taxclass, %opt ) = @_; +my( %opt ) = @_; my $conf = new FS::Conf; +my $selected_taxclass = $opt{'curr_value'}; # || $opt{'value'} necessary? unless ( $opt{'taxclasses'} ) { - my $sth = dbh->prepare('SELECT DISTINCT taxclass FROM cust_main_county') - or die dbh->errstr; + #my $sth = dbh->prepare('SELECT DISTINCT taxclass FROM cust_main_county') + my $sth = dbh->prepare('SELECT taxclass FROM part_pkg_taxclass') + or die dbh->errstr; $sth->execute or die $sth->errstr; my %taxclasses = map { $_->[0] => 1 } @{$sth->fetchall_arrayref}; @{ $opt{'taxclasses'} } = grep $_, keys %taxclasses;