improved tenant identification

This commit is contained in:
Denis Duliçi
2021-04-16 00:59:43 +03:00
parent 9635e6be5d
commit 2b07442260
126 changed files with 1719 additions and 999 deletions

View File

@ -47,12 +47,8 @@ class InvoiceReminder extends Command
$this->info('Sending invoice reminders for ' . $company->name . ' company.');
// Set company id
session(['company_id' => $company->id]);
// Override settings and currencies
Overrider::load('settings');
Overrider::load('currencies');
// Set company
$company->makeCurrent();
// Don't send reminders if disabled
if (!setting('schedule.send_invoice_reminder')) {
@ -70,9 +66,7 @@ class InvoiceReminder extends Command
}
}
// Unset company_id
session()->forget('company_id');
setting()->forgetAll();
Company::forgetCurrent();
}
protected function remind($day)