X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Freport_tax.html;h=f920adbac515f625e8a4c59997401df005fb1333;hb=95eca0cb6162ff4cb38ab946ed550eb27159690d;hp=00cb3e8272d65b7c8c82adda5fbd9bf3780f7942;hpb=d81ba2cb27849831d3946d408e9f39697f66702b;p=freeside.git diff --git a/httemplate/search/report_tax.html b/httemplate/search/report_tax.html index 00cb3e827..f920adbac 100755 --- a/httemplate/search/report_tax.html +++ b/httemplate/search/report_tax.html @@ -4,67 +4,49 @@
Tax group | -- - | -|
- | Show cities | -|
- | Show districts | -|
- | Show tax classes | -|
- | Show package classes | -|
+ | + <& /elements/radio.html, + 'field' => 'all', + 'value' => 1, + 'curr_value' => 1, + &> All taxes + <& /elements/radio.html, + 'field' => 'all', + 'value' => 0, + &> A specific tax + | +|
Deduct credited tax if it was @@ -81,6 +63,21 @@ + + <% include('/elements/footer.html') %> <%init> @@ -89,12 +86,26 @@ die "access denied" my $conf = new FS::Conf; -my $city_sql = "SELECT COUNT(*) FROM cust_main_county - WHERE city != '' AND city IS NOT NULL - LIMIT 1"; - -my $city_sth = dbh->prepare($city_sql) or die dbh->errstr; -$city_sth->execute or die $city_sth->errstr; -my $city = $city_sth->fetchrow_arrayref->[0]; +my $sth = dbh->prepare('SELECT DISTINCT(COALESCE(taxname, \'Tax\')) FROM cust_main_county'); +$sth->execute or die $sth->errstr; +my @taxnames = map { $_->[0] } @{ $sth->fetchall_arrayref }; + +$sth = dbh->prepare('SELECT DISTINCT(country) FROM cust_location'); +$sth->execute or die $sth->errstr; +my @countries = map { $_->[0] } @{ $sth->fetchall_arrayref }; + +my @breakdown; +if ( $conf->exists('enable_taxclasses') ) { + push @breakdown, 'taxclass'; +} +if ( FS::pkg_class->count() > 0 ) { + push @breakdown, 'pkgclass'; +} +if ( FS::cust_main_county->count("city is not null and city != ''") > 0 ) { + push @breakdown, 'city'; +} +if ( FS::cust_main_county->count("district is not null") > 0 ) { + push @breakdown, 'district'; +} %init> |