internationalization/localization, RT12515
[freeside.git] / httemplate / edit / process / cust_pay.cgi
index c8b0aa7..2c77e6b 100755 (executable)
@@ -11,7 +11,7 @@
 %  }
 %  if ( $link eq 'popup' ) {
 %    
-<% header('Payment entered') %>
+<% header(emt('Payment entered')) %>
     <SCRIPT TYPE="text/javascript">
       window.top.location.reload();
     </SCRIPT>
@@ -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;
@@ -52,6 +49,13 @@ my $new = new FS::cust_pay ( {
   #} 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>