combine ticket notification scrips, #15353
[freeside.git] / httemplate / search / report_tax.html
1 <% include('/elements/header.html', 'Tax Report' ) %>
2
3 <FORM ACTION="report_tax.cgi" METHOD="GET">
4
5 <TABLE>
6
7 % if ( $conf->config('tax-report_groups') ) {
8 %   my @lines = $conf->config('tax-report_groups');
9     
10   <TR>
11     <TD ALIGN="right">Tax group</TD>
12     <TD>
13       <SELECT NAME="report_group">
14
15         <OPTION VALUE="">all</OPTION>
16
17 %       foreach my $line ( @lines ) {
18 %         $line =~ /^\s*(.+)\s+(=|!=)\s+(.*)\s*$/ #or next;
19 %           or do { warn "bad report_group line: $line\n"; next; };
20 %         my($label, $op, $value) = ($1, $2, $3);
21
22           <OPTION VALUE="<% "$op $value" %>"><% $label %></OPTION>
23 %       }
24
25       </SELECT>
26     </TD>
27   </TR>
28
29 % }
30
31  <% include( '/elements/tr-select-agent.html', 'disable_empty'=>0 ) %>
32
33  <% include( '/elements/tr-input-beginning_ending.html' ) %>
34
35 %    if ( $city ) {
36    <TR>
37      <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="show_cities" VALUE="1"></TD>
38      <TD>Show cities</TD>
39    </TR>
40 % } 
41
42 %    if ( $conf->exists('enable_taxclasses') ) {
43    <TR>
44      <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="show_taxclasses" VALUE="1"></TD>
45      <TD>Show tax classes</TD>
46    </TR>
47 % } 
48
49 % my @pkg_class = qsearch('pkg_class', {});
50 % if ( @pkg_class ) {
51    <TR>
52      <TD ALIGN="right"><INPUT TYPE="checkbox" NAME="show_pkgclasses" VALUE="1"></TD>
53      <TD>Show package classes</TD>
54    </TR>
55 % } 
56
57 </TABLE>
58
59 <BR><INPUT TYPE="submit" VALUE="Get Report">
60
61 </FORM>
62
63 <% include('/elements/footer.html') %>
64 <%init>
65
66 die "access denied"
67   unless $FS::CurrentUser::CurrentUser->access_right('Financial reports');
68
69 my $conf = new FS::Conf;
70
71 my $city_sql = "SELECT COUNT(*) FROM cust_main_county
72                   WHERE city != '' AND city IS NOT NULL
73                   LIMIT 1";
74
75 my $city_sth = dbh->prepare($city_sql) or die dbh->errstr;
76 $city_sth->execute or die $city_sth->errstr;
77 my $city = $city_sth->fetchrow_arrayref->[0];
78
79 </%init>