mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fix for deleting last company in account
This commit is contained in:
parent
d35b5be0dd
commit
949061a213
@ -37,7 +37,7 @@ class RefundCancelledAccount implements ShouldQueue
|
||||
if(Ninja::isSelfHost() || $this->account->isFreeHostedClient())
|
||||
return;
|
||||
|
||||
$plan_details = $account->getPlanDetails();
|
||||
$plan_details = $this->account->getPlanDetails();
|
||||
|
||||
/* Trial user cancelling early.... */
|
||||
if($plan_details['trial_active'])
|
||||
|
@ -48,6 +48,6 @@ class CreateInvoiceActivity implements ShouldQueue
|
||||
$fields->company_id = $event->invoice->company_id;
|
||||
$fields->activity_type_id = Activity::CREATE_INVOICE;
|
||||
|
||||
$this->activity_repo->save($fields, $event->invoice);
|
||||
$this->activity_repo->save($fields, $event->invoice, $event->invoice->company->db);
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
namespace App\Repositories;
|
||||
|
||||
use App\Libraries\MultiDB;
|
||||
use App\Models\Activity;
|
||||
use App\Models\Backup;
|
||||
use App\Models\Client;
|
||||
@ -31,8 +32,11 @@ class ActivityRepository extends BaseRepository
|
||||
* @param stdClass $fields The fields
|
||||
* @param Collection $entity The entity that you wish to have backed up (typically Invoice, Quote etc etc rather than Payment)
|
||||
*/
|
||||
public function save($fields, $entity)
|
||||
public function save($fields, $entity, $db = null)
|
||||
{
|
||||
if($db)
|
||||
MultiDB::setDB($db);
|
||||
|
||||
$activity = new Activity();
|
||||
|
||||
$activity->is_system = app()->runningInConsole();
|
||||
|
@ -46,7 +46,6 @@
|
||||
"livewire/livewire": "^1.0",
|
||||
"maennchen/zipstream-php": "^1.2",
|
||||
"nwidart/laravel-modules": "^6.0",
|
||||
"omnipay/authorizenet": "3.x@dev",
|
||||
"omnipay/paypal": "^3.0",
|
||||
"omnipay/stripe": "^3.0",
|
||||
"predis/predis": "^1.1",
|
||||
|
@ -33,3 +33,5 @@ Route::post('password/reset', 'Auth\ResetPasswordController@reset')->name('passw
|
||||
Route::group(['middleware' => ['url_db']], function () {
|
||||
Route::get('/user/confirm/{confirmation_code}', 'UserController@confirm');
|
||||
});
|
||||
|
||||
Route::post('payment_webhook/{company_key}/{$gateway_id}');
|
Loading…
x
Reference in New Issue
Block a user