X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Fcust_pay.cgi;h=9e5f3d3f705bfc27a86e29e500ab467596ed763e;hp=06f5e64d5224828b65431fe33a456dbe82397d89;hb=d7759b49c2ff3b220ab328767645bfed85d18f31;hpb=8f43e32350b7f8a0925959f747f7296b9b42c09e diff --git a/httemplate/edit/process/cust_pay.cgi b/httemplate/edit/process/cust_pay.cgi index 06f5e64d5..9e5f3d3f7 100755 --- a/httemplate/edit/process/cust_pay.cgi +++ b/httemplate/edit/process/cust_pay.cgi @@ -39,11 +39,18 @@ $cgi->param('link') =~ /^(custnum|invnum|popup)$/ 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, _date => $_date, + no_auto_apply => ($cgi->param('apply') eq 'never') ? 'Y' : '', map { $_, scalar($cgi->param($_)); } qw( paid payby payinfo paybatch @@ -51,6 +58,8 @@ my $new = new FS::cust_pay ( { bank depositor account teller ) #} fields('cust_pay') + # gatewaynum, processor, auth, order_number + # are for realtime payments only, and can't be entered manually } ); my @rights = ('Post payment'); @@ -60,6 +69,6 @@ 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 ); +my $error = $new->insert( 'manual' => 1 );