3 print header("Tax Rate Listing", menubar(
5 'Edit tax rates' => $p. "edit/cust_main_county.cgi",
7 Click on <u>expand country</u> to specify a country's tax rates by state.
8 <BR>Click on <u>expand state</u> to specify a state's tax rates by county.
11 print &table(), <<END;
13 <TH><FONT SIZE=-1>Country</FONT></TH>
14 <TH><FONT SIZE=-1>State</FONT></TH>
16 <TH><FONT SIZE=-1>Tax</FONT></TH>
20 my @regions = sort { $a->country cmp $b->country
21 or $a->state cmp $b->state
22 or $a->county cmp $b->county
23 } qsearch('cust_main_county',{});
26 #foreach $cust_main_county ( @regions ) {
27 for ( my $i=0; $i<@regions; $i++ ) {
28 my $cust_main_county = $regions[$i];
29 my $hashref = $cust_main_county->hashref;
32 <TD>$hashref->{country}</TD>
41 for ( $j=1; $i+$j<@regions; $j++ ) {
42 last if $hashref->{country} ne $regions[$i+$j]->country
43 || $hashref->{state} ne $regions[$i+$j]->state
44 || $hashref->{tax} != $regions[$i+$j]->tax;
48 if ( $j>1 && $i+$j+1 < @regions
49 && ( $hashref->{state} ne $regions[$i+$j+1]->state
50 || $hashref->{country} ne $regions[$i+$j+1]->country
53 || $hashref->{state} ne $regions[$i-1]->state
54 || $hashref->{country} ne $regions[$i-1]->country
62 print "<TD ROWSPAN=$j>", $hashref->{state}
64 : qq!(ALL) <FONT SIZE=-1>!.
65 qq!<A HREF="${p}edit/cust_main_county-expand.cgi?!. $hashref->{taxnum}.
66 qq!">expand country</A></FONT>!;
68 print qq! <FONT SIZE=-1><A HREF="${p}edit/process/cust_main_county-collapse.cgi?!. $hashref->{taxnum}. qq!">collapse state</A></FONT>! if $j>1;
76 if ( $hashref->{county} ) {
77 print $hashref->{county};
80 if ( $hashref->{state} ) {
81 print qq!<FONT SIZE=-1>!.
82 qq!<A HREF="${p}edit/cust_main_county-expand.cgi?!. $hashref->{taxnum}.
83 qq!">expand state</A></FONT>!;
89 <TD>$hashref->{tax}%</TD>