all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
[freeside.git] / htdocs / browse / cust_main_county.cgi
1 #!/usr/bin/perl -Tw
2 #
3 # $Id: cust_main_county.cgi,v 1.4 1999-01-18 09:41:16 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.4  1999-01-18 09:41:16  ivan
14 # all $cgi->header calls now include ( '-expires' => 'now' ) for mod_perl
15 # (good idea anyway)
16 #
17 # Revision 1.3  1998/12/17 05:25:18  ivan
18 # fix visual and other bugs
19 #
20 # Revision 1.2  1998/11/18 09:01:34  ivan
21 # i18n! i18n!
22 #
23
24 use strict;
25 use CGI;
26 use CGI::Carp qw(fatalsToBrowser);
27 use FS::UID qw(cgisuidsetup swapuid);
28 use FS::Record qw(qsearch qsearchs);
29 use FS::CGI qw(header menubar popurl table);
30 use FS::cust_main_county;
31
32 my($cgi) = new CGI;
33
34 &cgisuidsetup($cgi);
35
36 my($p) = popurl(2);
37
38 print $cgi->header( '-expires' => 'now' ), header("Tax Rate Listing", menubar(
39   'Main Menu' => $p,
40   'Edit tax rates' => $p. "edit/cust_main_county.cgi",
41 )),<<END;
42     Click on <u>expand country</u> to specify a country's tax rates by state.
43     <BR>Click on <u>expand state</u> to specify a state's tax rates by county.
44     <BR><BR>
45 END
46 print table, <<END;
47       <TR>
48         <TH><FONT SIZE=-1>Country</FONT></TH>
49         <TH><FONT SIZE=-1>State</FONT></TH>
50         <TH>County</TH>
51         <TH><FONT SIZE=-1>Tax</FONT></TH>
52       </TR>
53 END
54
55 my($cust_main_county);
56 foreach $cust_main_county ( qsearch('cust_main_county',{}) ) {
57   my($hashref)=$cust_main_county->hashref;
58   print <<END;
59       <TR>
60         <TD>$hashref->{country}</TD>
61 END
62   print "<TD>", $hashref->{state}
63       ? $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>!
67     , "</TD>";
68   print "<TD>";
69   if ( $hashref->{county} ) {
70     print $hashref->{county};
71   } else {
72     print "(ALL)";
73     if ( $hashref->{state} ) {
74       print qq!<FONT SIZE=-1>!.
75           qq!<A HREF="${p}edit/cust_main_county-expand.cgi?!. $hashref->{taxnum}.
76           qq!">expand state</A></FONT>!;
77     }
78   }
79   print "</TD>";
80
81   print <<END;
82         <TD>$hashref->{tax}%</TD>
83       </TR>
84 END
85
86 }
87
88 print <<END;
89     </TABLE>
90     </CENTER>
91   </BODY>
92 </HTML>
93 END
94