default to a session cookie instead of setting an explicit timeout, weird timezone...
[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                    'charge_prediscount' => 'Charge this tax prior to any discounts',
18                  },
19      'fields' => \@fields,
20    )
21 %>
22 <%once>
23
24 my $conf = new FS::Conf;
25
26 </%once>
27 <%init>
28
29 die "access denied"
30   unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
31
32 my $taxnum;
33 if ( $cgi->param('error') ) {
34   $cgi->param('taxnum') =~ /^(\d+)$/
35     or die "no taxnum, but error: ". $cgi->param('error');
36   $taxnum = $1;
37 } else {
38   my($query) = $cgi->keywords;
39   $query =~ /^(\d+)$/ or die 'no taxnum';
40   $taxnum = $1;
41 }
42
43 my $cust_main_county = qsearchs('cust_main_county', { 'taxnum' => $taxnum })
44   or die "unknown taxnum $1";
45
46 my @fields = (
47   { field=>'country',  type=>'fixed-country', },
48   { field=>'state',    type=>'fixed-state', },
49   { field=>'county',   type=>'fixed', },
50   { field=>'city',     type=>'fixed', },
51   { field=>'source',   type=>'hidden', },
52 );
53
54 push @fields, { field=>'district', type=>'fixed', }
55   if $cust_main_county->district;
56
57 push @fields, { field=>'taxclass', type=>'fixed', }
58   if $conf->exists('enable_taxclasses');
59
60 push @fields,
61   'taxname',
62   { field=>'tax',      type=>'percentage', },
63
64   { type=>'tablebreak-tr-title', value=>'Charging options' },
65   { field=>'charge_prediscount', type=>'checkbox', value=>'Y', },
66
67   { type=>'tablebreak-tr-title', value=>'Exemptions' },
68   { field=>'setuptax', type=>'checkbox', value=>'Y', },
69   { field=>'recurtax', type=>'checkbox', value=>'Y', },
70   { field=>'exempt_amount', type=>'money', },
71 ;
72
73 </%init>