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.
8 %my $conf = new FS::Conf;
9 %my $enable_taxclasses = $conf->exists('enable_taxclasses');
11 %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>
31 %my @regions = sort { $a->country cmp $b->country
32 % or $a->state cmp $b->state
33 % or $a->county cmp $b->county
34 % or $a->taxclass cmp $b->taxclass
35 % } qsearch('cust_main_county',{});
38 %#foreach $cust_main_county ( @regions ) {
39 %for ( my $i=0; $i<@regions; $i++ ) {
40 % my $cust_main_county = $regions[$i];
41 % my $hashref = $cust_main_county->hashref;
46 <TD BGCOLOR="#ffffff"><% $hashref->{country} %></TD>
55 % for ( $j=1; $i+$j<@regions; $j++ ) {
56 % last if $hashref->{country} ne $regions[$i+$j]->country
57 % || $hashref->{state} ne $regions[$i+$j]->state
58 % || $hashref->{tax} != $regions[$i+$j]->tax
59 % || $hashref->{exempt_amount} != $regions[$i+$j]->exempt_amount
60 % || $hashref->{setuptax} ne $regions[$i+$j]->setuptax
61 % || $hashref->{recurtax} ne $regions[$i+$j]->recurtax;
65 % if ( $j>1 && $i+$j+1 < @regions
66 % && ( $hashref->{state} ne $regions[$i+$j+1]->state
67 % || $hashref->{country} ne $regions[$i+$j+1]->country
70 % || $hashref->{state} ne $regions[$i-1]->state
71 % || $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>!
91 <FONT SIZE=-1><A HREF="<% $p %>edit/process/cust_main_county-collapse.cgi?<% $hashref->{taxnum} %>">collapse state</A></FONT>
101 % if ( $hashref->{county} ) {
103 BGCOLOR="#ffffff"><% $hashref->{county} %>
106 BGCOLOR="#cccccc">(ALL)
107 % if ( $hashref->{state} ) {
109 <FONT SIZE=-1><A HREF="<% $p %>edit/cust_main_county-expand.cgi?<% $hashref->{taxnum} %>">expand state</A></FONT>
116 % if ( $hashref->{taxclass} ) {
118 BGCOLOR="#ffffff"><% $hashref->{taxclass} %>
121 BGCOLOR="#cccccc">(ALL)
122 % if ( $enable_taxclasses ) {
124 <FONT SIZE=-1><A HREF="<% $p %>edit/cust_main_county-expand.cgi?taxclass<% $hashref->{taxnum} %>">expand taxclasses</A></FONT>
131 % if ( $hashref->{taxname} ) {
133 BGCOLOR="#ffffff"><% $hashref->{taxname} %>
136 BGCOLOR="#cccccc">Tax
141 <TD BGCOLOR="#ffffff"><% $hashref->{tax} %>%</TD>
143 <TD BGCOLOR="#ffffff">
144 % if ( $hashref->{exempt_amount} > 0 ) {
146 $<% sprintf("%.2f", $hashref->{exempt_amount} ) %> per month<BR>
148 % if ( $hashref->{setuptax} =~ /^Y$/i ) {
152 % if ( $hashref->{recurtax} =~ /^Y$/i ) {
154 Recurring fee<BR>
166 <% include('/elements/footer.html') %>
169 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');