"same as billing address" box would uncheck itself on errors (only looked
[freeside.git] / httemplate / edit / cust_main_county.cgi
1 <!-- mason kludge -->
2 <%
3
4 print header("Edit tax rates", menubar(
5   'Main Menu' => popurl(2),
6 ));
7
8 print qq!<FONT SIZE="+1" COLOR="#ff0000">Error: !, $cgi->param('error'),
9       "</FONT>"
10   if $cgi->param('error');
11
12 print qq!<FORM ACTION="!, popurl(1),
13     qq!process/cust_main_county.cgi" METHOD=POST>!, &table(), <<END;
14       <TR>
15         <TH><FONT SIZE=-1>Country</FONT></TH>
16         <TH><FONT SIZE=-1>State</FONT></TH>
17         <TH><FONT SIZE=-1>County</FONT></TH>
18         <TH><FONT SIZE=-1>Taxclass</FONT></TH>
19         <TH><FONT SIZE=-1>Tax</FONT></TH>
20         <TH><FONT SIZE=-1>Exempt<BR>per<BR>month</TH>
21       </TR>
22 END
23
24 foreach my $cust_main_county ( sort {    $a->country cmp $b->country
25                                       or $a->state   cmp $b->state
26                                       or $a->county  cmp $b->county
27                                     } qsearch('cust_main_county',{}) ) {
28   my($hashref)=$cust_main_county->hashref;
29   print <<END;
30       <TR>
31         <TD BGCOLOR="#ffffff">$hashref->{country}</TD>
32 END
33
34   print "<TD", $hashref->{state}
35       ? ' BGCOLOR="#ffffff">'.$hashref->{state}
36       : ' BGCOLOR="#cccccc">(ALL)'
37     , "</TD>";
38
39   print "<TD", $hashref->{county}
40       ? ' BGCOLOR="#ffffff">'. $hashref->{county}
41       : ' BGCOLOR="#cccccc">(ALL)'
42     , "</TD>";
43
44   print "<TD", $hashref->{taxclass}
45       ? ' BGCOLOR="#ffffff">'. $hashref->{taxclass}
46       : ' BGCOLOR="#cccccc">(ALL)'
47     , "</TD>";
48
49   print qq!<TD><INPUT TYPE="text" NAME="tax!, $hashref->{taxnum},
50         qq!" VALUE="!, $hashref->{tax}, qq!" SIZE=6 MAXLENGTH=6>%</TD>!;
51   print qq!<TD>\$<INPUT TYPE="text" NAME="exempt_amount!, $hashref->{taxnum},
52         qq!" VALUE="!, $hashref->{exempt_amount}||0, qq!" SIZE=6></TD>!;
53   print '</TR>';
54
55 }
56
57 print <<END;
58     </TABLE>
59     <INPUT TYPE="submit" VALUE="Apply changes">
60     </FORM>
61     </CENTER>
62   </BODY>
63 </HTML>
64 END
65
66 %>