diff options
Diffstat (limited to 'httemplate/edit/process/cust_pay.cgi')
-rwxr-xr-x | httemplate/edit/process/cust_pay.cgi | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/httemplate/edit/process/cust_pay.cgi b/httemplate/edit/process/cust_pay.cgi index df506c677..d6bbf06b0 100755 --- a/httemplate/edit/process/cust_pay.cgi +++ b/httemplate/edit/process/cust_pay.cgi @@ -27,9 +27,6 @@ %} <%init> -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Post payment'); - $cgi->param('linknum') =~ /^(\d+)$/ or die "Illegal linknum: ". $cgi->param('linknum'); my $linknum = $1; @@ -47,11 +44,18 @@ my $new = new FS::cust_pay ( { map { $_, scalar($cgi->param($_)); } qw( paid payby payinfo paybatch - pkgnum + pkgnum discount_term ) #} fields('cust_pay') } ); +my @rights = ('Post payment'); +push @rights, 'Post check payment' if $new->payby eq 'BILL'; +push @rights, 'Post cash payment' if $new->payby eq 'CASH'; + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right(\@rights); + my $error = $new->insert( 'manual' => 1 ); </%init> |