mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
Fix delete company code
This commit is contained in:
parent
985356daf2
commit
d90ab5bb53
@ -1355,20 +1355,18 @@ class AccountController extends BaseController
|
||||
$account = Auth::user()->account;
|
||||
\Log::info("Canceled Account: {$account->name} - {$user->email}");
|
||||
|
||||
$company = $account->company;
|
||||
$refunded = $company->processRefund(Auth::user());
|
||||
$refunded = false;
|
||||
if (! $account->hasMultipleAccounts()) {
|
||||
$company = $account->company;
|
||||
$refunded = $company->processRefund(Auth::user());
|
||||
}
|
||||
|
||||
Document::scope()->each(function ($item, $key) {
|
||||
$item->delete();
|
||||
});
|
||||
|
||||
$this->accountRepo->unlinkAccount($account);
|
||||
|
||||
if ($account->hasMultipleAccounts()) {
|
||||
$account->forceDelete();
|
||||
} else {
|
||||
$account->company->forceDelete();
|
||||
}
|
||||
$account->forceDelete();
|
||||
|
||||
Auth::logout();
|
||||
Session::flush();
|
||||
|
Loading…
Reference in New Issue
Block a user