fix race condition where ->apply_payments_and_credits could double-apply in rare...
[freeside.git] / httemplate / edit / process / cust_main.cgi
index b270fc6..b27e722 100755 (executable)
 %  my $conf = new FS::Conf;
 %  if ( $conf->exists('backend-realtime') && ! $error ) {
 %
-%    my $berror = $new->bill;
-%    $new->apply_payments_and_credits;
-%    $berror ||= $new->collect( 'realtime' => 1 );
+%    my $berror =    $new->bill
+%                 || $new->apply_payments_and_credits
+%                 || $new->collect( 'realtime' => 1 );
 %    warn "Warning, error billing during backend-realtime: $berror" if $berror;
 %
 %  }