'Customer payment rights' => [
'View payments',
{ rightname=>'Post payment', desc=>'Make check or cash payments.' },
+ { rightname=>'Backdate payment', desc=>'Enable payments to be posted for days other than today.' },
'Post check payment',
'Post cash payment',
'Post payment batch',
my %onetime = (
'List customers' => 'List all customers',
'List packages' => 'Summarize packages',
+ 'Post payment' => 'Backdate payment',
);
foreach my $old_acl ( keys %onetime ) {
<% mt('Payment') |h %>
<% ntable("#cccccc", 2) %>
+% if ( $FS::CurrentUser::CurrentUser->access_right(['Backdate payment']) ) {
<TR>
<TD ALIGN="right"><% mt('Date') |h %></TD>
<TD COLSPAN=2>
align: "BR"
});
</SCRIPT>
+% }
+% else {
+<TR>
+ <TD ALIGN="right"><% mt('Date') |h %></TD>
+ <TD COLSPAN=2>
+ <% time2str($date_format.' %r',$_date) %>
+ </TD>
+</TR>
+% }
<TR>
<TD ALIGN="right"><% mt('Amount') |h %></TD>
my $field = my $link = $1;
$field = 'custnum' if $field eq 'popup';
-my $_date = parse_datetime($cgi->param('_date'));
+my $_date;
+if ( $FS::CurrentUser::CurrentUser->access_right(['Backdate payment']) ) {
+ $_date = parse_datetime($cgi->param('_date'));
+}
+else {
+ $_date = time;
+}
my $new = new FS::cust_pay ( {
$field => $linknum,