1 <%= include('/elements/header.html', "Tax Rate Listing", menubar(
2 'Edit tax rates' => $p. "edit/cust_main_county.cgi",
5 Click on <u>expand country</u> to specify a country's tax rates by state.
6 <BR>Click on <u>expand state</u> to specify a state's tax rates by county.
9 my $conf = new FS::Conf;
10 my $enable_taxclasses = $conf->exists('enable_taxclasses');
12 if ( $enable_taxclasses ) { %>
14 <BR>Click on <u>expand taxclasses</u> to specify tax classes
22 <TH><FONT SIZE=-1>Country</FONT></TH>
23 <TH><FONT SIZE=-1>State</FONT></TH>
25 <TH>Taxclass<BR><FONT SIZE=-1>(per-package classification)</FONT></TH>
26 <TH>Tax name<BR><FONT SIZE=-1>(printed on invoices)</FONT></TH>
27 <TH><FONT SIZE=-1>Tax</FONT></TH>
28 <TH><FONT SIZE=-1>Exemption</TH>
32 my @regions = sort { $a->country cmp $b->country
33 or $a->state cmp $b->state
34 or $a->county cmp $b->county
35 or $a->taxclass cmp $b->taxclass
36 } qsearch('cust_main_county',{});
39 #foreach $cust_main_county ( @regions ) {
40 for ( my $i=0; $i<@regions; $i++ ) {
41 my $cust_main_county = $regions[$i];
42 my $hashref = $cust_main_county->hashref;
46 <TD BGCOLOR="#ffffff"><%= $hashref->{country} %></TD>
56 for ( $j=1; $i+$j<@regions; $j++ ) {
57 last if $hashref->{country} ne $regions[$i+$j]->country
58 || $hashref->{state} ne $regions[$i+$j]->state
59 || $hashref->{tax} != $regions[$i+$j]->tax
60 || $hashref->{exempt_amount} != $regions[$i+$j]->exempt_amount
61 || $hashref->{setuptax} ne $regions[$i+$j]->setuptax
62 || $hashref->{recurtax} ne $regions[$i+$j]->recurtax;
66 if ( $j>1 && $i+$j+1 < @regions
67 && ( $hashref->{state} ne $regions[$i+$j+1]->state
68 || $hashref->{country} ne $regions[$i+$j+1]->country
71 || $hashref->{state} ne $regions[$i-1]->state
72 || $hashref->{country} ne $regions[$i-1]->country
82 <TD ROWSPAN=<%= $j %><%=
84 ? ' BGCOLOR="#ffffff">'. $hashref->{state}
85 : qq! BGCOLOR="#cccccc">(ALL) <FONT SIZE=-1>!.
86 qq!<A HREF="${p}edit/cust_main_county-expand.cgi?!. $hashref->{taxnum}.
87 qq!">expand country</A></FONT>!
90 <FONT SIZE=-1><A HREF="<%= $p %>edit/process/cust_main_county-collapse.cgi?<%= $hashref->{taxnum} %>">collapse state</A></FONT>
98 <TD<% if ( $hashref->{county} ) {
99 %> BGCOLOR="#ffffff"><%= $hashref->{county} %>
101 %> BGCOLOR="#cccccc">(ALL)
102 <% if ( $hashref->{state} ) { %>
103 <FONT SIZE=-1><A HREF="<%= $p %>edit/cust_main_county-expand.cgi?<%= $hashref->{taxnum} %>">expand state</A></FONT>
108 <TD<% if ( $hashref->{taxclass} ) {
109 %> BGCOLOR="#ffffff"><%= $hashref->{taxclass} %>
111 %> BGCOLOR="#cccccc">(ALL)
112 <% if ( $enable_taxclasses ) { %>
113 <FONT SIZE=-1><A HREF="<%= $p %>edit/cust_main_county-expand.cgi?taxclass<%= $hashref->{taxnum} %>">expand taxclasses</A></FONT>
118 <TD<% if ( $hashref->{taxname} ) {
119 %> BGCOLOR="#ffffff"><%= $hashref->{taxname} %>
121 %> BGCOLOR="#cccccc">Tax
125 <TD BGCOLOR="#ffffff"><%= $hashref->{tax} %>%</TD>
127 <TD BGCOLOR="#ffffff">
129 <% if ( $hashref->{exempt_amount} > 0 ) { %>
130 $<%= sprintf("%.2f", $hashref->{exempt_amount} ) %> per month<BR>
133 <% if ( $hashref->{setuptax} =~ /^Y$/i ) { %>
137 <% if ( $hashref->{recurtax} =~ /^Y$/i ) { %>
138 Recurring fee<BR>
149 <%= include('/elements/footer.html') %>