X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fselect-taxclass.html;h=3c1558b72db8c0ba5b171273f0a5167a4754e078;hb=9509e5bfb7f9331303153cac24d7bfecbe2ea9f1;hp=e8889d59d8fa808801734996be9a50fa007e1288;hpb=673b9a458d9138523026963df6fa3b4683e09bae;p=freeside.git diff --git a/httemplate/elements/select-taxclass.html b/httemplate/elements/select-taxclass.html index e8889d59d..3c1558b72 100644 --- a/httemplate/elements/select-taxclass.html +++ b/httemplate/elements/select-taxclass.html @@ -1,42 +1,38 @@ -<% - my $conf = new FS::Conf; - my $selected_taxclass = scalar(@_) ? shift : ''; -%> - -<% if ( $conf->exists('enable_taxclasses') ) { %> +% if ( $conf->exists('enable_taxclasses') ) { -<% } else { %> +% } else { + + + +% } + +<%init> + +my( $selected_taxclass, %opt ) = @_; +my $conf = new FS::Conf; + +unless ( $opt{'taxclasses'} ) { + + my $sth = dbh->prepare('SELECT DISTINCT taxclass FROM cust_main_county') + or die dbh->errstr; + $sth->execute or die $sth->errstr; + my %taxclasses = map { $_->[0] => 1 } @{$sth->fetchall_arrayref}; + @{ $opt{'taxclasses'} } = grep $_, keys %taxclasses; - '; - -<% } %> - +} +