fix visual and other bugs
[freeside.git] / htdocs / browse / cust_main_county.cgi
1 #!/usr/bin/perl -Tw
2 #
3 # $Id: cust_main_county.cgi,v 1.3 1998-12-17 05:25:18 ivan Exp $
4 #
5 # ivan@sisd.com 97-dec-13
6 #
7 # Changes to allow page to work at a relative position in server
8 #       bmccane@maxbaud.net     98-apr-3
9 #
10 # lose background, FS::CGI ivan@sisd.com 98-sep-2
11 #
12 # $Log: cust_main_county.cgi,v $
13 # Revision 1.3  1998-12-17 05:25:18  ivan
14 # fix visual and other bugs
15 #
16 # Revision 1.2  1998/11/18 09:01:34  ivan
17 # i18n! i18n!
18 #
19
20 use strict;
21 use CGI;
22 use CGI::Carp qw(fatalsToBrowser);
23 use FS::UID qw(cgisuidsetup swapuid);
24 use FS::Record qw(qsearch qsearchs);
25 use FS::CGI qw(header menubar popurl table);
26 use FS::cust_main_county;
27
28 my($cgi) = new CGI;
29
30 &cgisuidsetup($cgi);
31
32 my($p) = popurl(2);
33
34 print $cgi->header, header("Tax Rate Listing", menubar(
35   'Main Menu' => $p,
36   'Edit tax rates' => $p. "edit/cust_main_county.cgi",
37 )),<<END;
38     Click on <u>expand country</u> to specify a country's tax rates by state.
39     <BR>Click on <u>expand state</u> to specify a state's tax rates by county.
40     <BR><BR>
41 END
42 print table, <<END;
43       <TR>
44         <TH><FONT SIZE=-1>Country</FONT></TH>
45         <TH><FONT SIZE=-1>State</FONT></TH>
46         <TH>County</TH>
47         <TH><FONT SIZE=-1>Tax</FONT></TH>
48       </TR>
49 END
50
51 my($cust_main_county);
52 foreach $cust_main_county ( qsearch('cust_main_county',{}) ) {
53   my($hashref)=$cust_main_county->hashref;
54   print <<END;
55       <TR>
56         <TD>$hashref->{country}</TD>
57 END
58   print "<TD>", $hashref->{state}
59       ? $hashref->{state}
60       : qq!(ALL) <FONT SIZE=-1>!.
61         qq!<A HREF="${p}edit/cust_main_county-expand.cgi?!. $hashref->{taxnum}.
62         qq!">expand country</A></FONT>!
63     , "</TD>";
64   print "<TD>";
65   if ( $hashref->{county} ) {
66     print $hashref->{county};
67   } else {
68     print "(ALL)";
69     if ( $hashref->{state} ) {
70       print qq!<FONT SIZE=-1>!.
71           qq!<A HREF="${p}edit/cust_main_county-expand.cgi?!. $hashref->{taxnum}.
72           qq!">expand state</A></FONT>!;
73     }
74   }
75   print "</TD>";
76
77   print <<END;
78         <TD>$hashref->{tax}%</TD>
79       </TR>
80 END
81
82 }
83
84 print <<END;
85     </TABLE>
86     </CENTER>
87   </BODY>
88 </HTML>
89 END
90