1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
<& elements/process.html,
#'debug' => 1,
'table' => 'part_fee',
'agent_virt' => 1,
'agent_null_right' => 'Edit global fee definitions',
'viewall_dir' => 'browse',
'process_o2m' => [
{
'table' => 'part_fee_msgcat',
'fields' => [ 'locale', 'itemdesc' ],
},
{
'table' => 'part_fee_usage',
'fields' => [ 'classnum',
'amount',
'percent'
],
},
],
'precheck_callback'=> \&precheck,
&>
<%init>
my $curuser = $FS::CurrentUser::CurrentUser;
my $acl_edit = $curuser->access_right('Edit fee definitions');
my $acl_edit_global = $curuser->access_right('Edit global fee definitions');
die "access denied"
unless $acl_edit or $acl_edit_global;
sub precheck {
my $cgi = shift;
if ( $cgi->param('basis') =~ /^(\w+)$/ ) {
my $basis = $1;
$cgi->param('percent', $cgi->param($basis.'_percent') );
}
''; #no error
}
</%init>
|