4 print header("Tax Rate Listing", menubar(
6 'Edit tax rates' => $p. "edit/cust_main_county.cgi",
8 Click on <u>expand country</u> to specify a country's tax rates by state.
9 <BR>Click on <u>expand state</u> to specify a state's tax rates by county.
12 print &table(), <<END;
14 <TH><FONT SIZE=-1>Country</FONT></TH>
15 <TH><FONT SIZE=-1>State</FONT></TH>
17 <TH><FONT SIZE=-1>Tax</FONT></TH>
21 my @regions = sort { $a->country cmp $b->country
22 or $a->state cmp $b->state
23 or $a->county cmp $b->county
24 } qsearch('cust_main_county',{});
27 #foreach $cust_main_county ( @regions ) {
28 for ( my $i=0; $i<@regions; $i++ ) {
29 my $cust_main_county = $regions[$i];
30 my $hashref = $cust_main_county->hashref;
33 <TD>$hashref->{country}</TD>
42 for ( $j=1; $i+$j<@regions; $j++ ) {
43 last if $hashref->{country} ne $regions[$i+$j]->country
44 || $hashref->{state} ne $regions[$i+$j]->state
45 || $hashref->{tax} != $regions[$i+$j]->tax;
49 if ( $j>1 && $i+$j+1 < @regions
50 && ( $hashref->{state} ne $regions[$i+$j+1]->state
51 || $hashref->{country} ne $regions[$i+$j+1]->country
54 || $hashref->{state} ne $regions[$i-1]->state
55 || $hashref->{country} ne $regions[$i-1]->country
63 print "<TD ROWSPAN=$j>", $hashref->{state}
65 : qq!(ALL) <FONT SIZE=-1>!.
66 qq!<A HREF="${p}edit/cust_main_county-expand.cgi?!. $hashref->{taxnum}.
67 qq!">expand country</A></FONT>!;
69 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;
77 if ( $hashref->{county} ) {
78 print $hashref->{county};
81 if ( $hashref->{state} ) {
82 print qq!<FONT SIZE=-1>!.
83 qq!<A HREF="${p}edit/cust_main_county-expand.cgi?!. $hashref->{taxnum}.
84 qq!">expand state</A></FONT>!;
90 <TD>$hashref->{tax}%</TD>