Workaround for auto-bill w/archived user

This commit is contained in:
Hillel Coren 2018-01-10 22:19:29 +02:00
parent 303e17f6af
commit a11cf02463

View File

@ -150,6 +150,13 @@ class SendRecurringInvoices extends Command
if ($invoice->getAutoBillEnabled() && $invoice->client->autoBillLater()) { if ($invoice->getAutoBillEnabled() && $invoice->client->autoBillLater()) {
$this->info('Processing Autobill-delayed Invoice: ' . $invoice->id); $this->info('Processing Autobill-delayed Invoice: ' . $invoice->id);
// TODO don't skip
if ($invoice->user->trashed()) {
$this->info('Archived user: skipping');
continue;
}
Auth::loginUsingId($invoice->user_id); Auth::loginUsingId($invoice->user_id);
$this->paymentService->autoBillInvoice($invoice); $this->paymentService->autoBillInvoice($invoice);
Auth::logout(); Auth::logout();