sales tax districts, #15089
[freeside.git] / httemplate / edit / cust_main_county.html
1 <% include('elements/edit.html',
2      'popup'  => 1,
3      'name'   => 'Tax rate', #Edit tax rate
4      'table'  => 'cust_main_county',
5      'labels' => { 'taxnum'   => 'Tax',
6                    'country'  => 'Country',
7                    'state'    => 'State',
8                    'county'   => 'County',
9                    'city'     => 'City',
10                    'district' => 'District',
11                    'taxclass' => 'Tax class',
12                    'taxname'  => 'Tax name',
13                    'tax'      => 'Tax rate',
14                    'setuptax' => 'This tax not applicable to setup fees',
15                    'recurtax' => 'This tax not applicable to recurring fees',
16                    'exempt_amount' => 'Monthly exemption per customer ($25 "Texas tax")',
17                  },
18      'fields' => \@fields,
19    )
20 %>
21 <%once>
22
23 my $conf = new FS::Conf;
24
25 </%once>
26 <%init>
27
28 die "access denied"
29   unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
30
31 my $taxnum;
32 if ( $cgi->param('error') ) {
33   $cgi->param('taxnum') =~ /^(\d+)$/
34     or die "no taxnum, but error: ". $cgi->param('error');
35   $taxnum = $1;
36 } else {
37   my($query) = $cgi->keywords;
38   $query =~ /^(\d+)$/ or die 'no taxnum';
39   $taxnum = $1;
40 }
41
42 my $cust_main_county = qsearchs('cust_main_county', { 'taxnum' => $taxnum })
43   or die "unknown taxnum $1";
44
45 my @fields = (
46   { field=>'country',  type=>'fixed-country', },
47   { field=>'state',    type=>'fixed-state', },
48   { field=>'county',   type=>'fixed', },
49   { field=>'city',     type=>'fixed', },
50 );
51
52 push @fields, { field=>'district', type=>'fixed', }
53   if $cust_main_county->district;
54
55 push @fields, { field=>'taxclass', type=>'fixed', }
56   if $conf->exists('enable_taxclasses');
57
58 push @fields,
59   'taxname',
60   { field=>'tax',      type=>'percentage', },
61
62   { type=>'tablebreak-tr-title', value=>'Exemptions' },
63   { field=>'setuptax', type=>'checkbox', value=>'Y', },
64   { field=>'recurtax', type=>'checkbox', value=>'Y', },
65   { field=>'exempt_amount', type=>'money', },
66 ;
67
68 </%init>