11b8e43cd1bb88199809293f3041b9b65134ed80
[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                    'taxclass' => 'Tax class',
11                    'taxname'  => 'Tax name',
12                    'tax'      => 'Tax rate',
13                    'setuptax' => 'This tax not applicable to setup fees',
14                    'recurtax' => 'This tax not applicable to recurring fees',
15                    'exempt_amount' => 'Monthly exemption per customer ($25 "Texas tax")',
16                  },
17      'fields' => \@fields,
18    )
19 %>
20 <%once>
21
22 my $conf = new FS::Conf;
23
24 </%once>
25 <%init>
26
27 die "access denied"
28   unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
29
30 my $taxnum;
31 if ( $cgi->param('error') ) {
32   $cgi->param('taxnum') =~ /^(\d+)$/
33     or die "no taxnum, but error: ". $cgi->param('error');
34   $taxnum = $1;
35 } else {
36   my($query) = $cgi->keywords;
37   $query =~ /^(\d+)$/ or die 'no taxnum';
38   $taxnum = $1;
39 }
40
41 my $cust_main_county = qsearchs('cust_main_county', { 'taxnum' => $taxnum })
42   or die "unknown taxnum $1";
43
44 my @fields = (
45   { field=>'country',  type=>'fixed-country', },
46   { field=>'state',    type=>'fixed-state', },
47   { field=>'county',   type=>'fixed', },
48   { field=>'city',     type=>'fixed', },
49 );
50
51 push @fields, { field=>'taxclass', type=>'fixed', }
52   if $conf->exists('enable_taxclasses');
53
54 push @fields,
55   'taxname',
56   { field=>'tax',      type=>'percentage', },
57
58   { type=>'tablebreak-tr-title', value=>'Exemptions' },
59   { field=>'setuptax', type=>'checkbox', value=>'Y', },
60   { field=>'recurtax', type=>'checkbox', value=>'Y', },
61   { field=>'exempt_amount', type=>'money', },
62 ;
63
64 </%init>