modify backdated payment application behaviour, RT11870
[freeside.git] / httemplate / edit / process / cust_pay.cgi
index 0cd4089..38f1616 100755 (executable)
@@ -7,7 +7,8 @@
 %  if ( $cgi->param('apply') eq 'yes' ) {
 %    my $cust_main = qsearchs('cust_main', { 'custnum' => $linknum })
 %      or die "unknown custnum $linknum";
-%    $cust_main->apply_payments( 'manual' => 1 );
+%    $cust_main->apply_payments( 'manual' => 1,
+%                                'backdate_application' => ($_date < time-86400) );
 %  }
 %  if ( $link eq 'popup' ) {
 %    
@@ -50,8 +51,8 @@ my $new = new FS::cust_pay ( {
 } );
 
 my @rights = ('Post payment');
-push @rights, 'Post check payment' if $cust_pay->payby eq 'BILL';
-push @rights, 'Post cash payment'  if $cust_pay->payby eq 'CASH';
+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);