1 <% include('elements/edit.html',
3 'name' => 'Tax rate', #Edit tax rate
7 'value_callback' => $value_callback,
12 my $conf = new FS::Conf;
14 sub { my ( $field, $value ) = @_;
15 ( $field =~ /^(tax|excessrate|usetax|useexcessrate)$/ )
25 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
28 if ( $cgi->param('error') ) {
29 $cgi->param('taxnum') =~ /^(\d+)$/ or die 'error, but no taxnum';
32 my($query) = $cgi->keywords;
33 $query =~ /^(\d+)$/ or die 'no taxnum';
37 my $tax_rate = qsearchs('tax_rate', { 'taxnum' => $taxnum })
38 or die "unknown taxnum $1";
40 my $labels = { 'taxnum' => 'Tax',
41 'data_vendor' => 'Data vendor',
42 'geocode' => 'Vendor location code',
43 'location' => 'Tax auth loc code',
44 'taxclass_description' => 'Tax class',
45 'taxname' => 'Tax name',
46 'effective_date' => 'Effective date',
47 'tax' => 'Tax rate (1st bracket)',
48 'excessrate' => 'Tax rate (2nd bracket)',
49 'taxbase' => 'First bracket',
50 'taxmax' => 'Max tax',
51 'usetax' => 'Use tax rate (1st bracket)',
52 'useexcessrate' => 'Use tax rate (2nd bracket)',
53 'unittype_name' => 'Units',
54 'fee' => 'Fee per unit (1st bracket)',
55 'excessfee' => 'Fee per unit (2st bracket)',
56 'feebase' => 'Units in first bracket',
57 'feemax' => 'Max Units',
58 'maxtype_name' => 'Threshold accumulation',
59 'taxauth_name', => 'Tax authority',
60 'basetype_name' => 'Basis',
61 'passtype_name' => 'Passthru',
62 'passflag' => 'Passable',
63 'setuptax' => 'This tax not applicable to setup fees',
64 'recurtax' => 'This tax not applicable to recurring fees',
68 { type=>'tablebreak-tr-title', value=>'Location' },
69 { field=>'data_vendor', type=>'hidden',},
70 { field=>'geocode', type=>'fixed' },
71 { field=>'taxclassnum', type=>'hidden' } ,
72 { field=>'taxclass_description', type=>'fixed' } ,
73 { field=>'taxname', type=>'text' } ,
74 { field=>'effective_date', type=>'fixed' } ,
75 { field=>'location', type=>'text' },
76 { type=>'tablebreak-tr-title', value=>'Money based rates' },
77 { field=>'tax', type=>'percentage' } ,
78 { field=>'excessrate', type=>'percentage' } ,
79 { field=>'taxbase', type=>'money' } ,
80 { field=>'taxmax', type=>'money' } ,
81 { field=>'usetax', type=>'percentage' } ,
82 { field=>'useexcessrate', type=>'percentage' } ,
83 { type=>'tablebreak-tr-title', value=>'Service based rates' },
84 { field=>'unittype', type=>'hidden' } ,
85 { field=>'unittype_name', type=>'fixed' } ,
86 { field=>'fee', type=>'money' } ,
87 { field=>'excessfee', type=>'money' } ,
88 { field=>'feebase', type=>'text' } ,
89 { field=>'feemax', type=>'text' } ,
90 { type=>'tablebreak-tr-title', value=>'Taxation rules' },
91 { field=>'maxtype', type=>'hidden' } ,
92 { field=>'maxtype_name', type=>'fixed' } ,
93 { field=>'taxauth', type=>'hidden' } ,
94 { field=>'taxauth_name', type=>'fixed' } ,
95 { field=>'basetype', type=>'hidden' } ,
96 { field=>'basetype_name', type=>'fixed' } ,
97 { field=>'passtype', type=>'hidden' } ,
98 { field=>'passtype_name', type=>'fixed' } ,
99 { field=>'passflag', type=>'fixed' } ,
100 { field=>'setuptax', type=>'checkbox', value=>'Y' } ,
101 { field=>'recurtax', type=>'checkbox', value=>'Y' } ,
102 { field=>'disabled', type=>'checkbox', value=>'Y' } ,
103 { field=>'manual', type=>'hidden', value=>'Y' } ,