diff --git a/app/Jobs/Util/Import.php b/app/Jobs/Util/Import.php index f7ec841a1e6e..c2e999ec62ff 100644 --- a/app/Jobs/Util/Import.php +++ b/app/Jobs/Util/Import.php @@ -232,6 +232,7 @@ class Import implements ShouldQueue $account = $this->company->account; $account->default_company_id = $this->company->id; + $account->is_migrated = true; $account->save(); //company size check diff --git a/app/Jobs/Util/SystemLogger.php b/app/Jobs/Util/SystemLogger.php index 3775eda3faf6..360fa83e75d8 100644 --- a/app/Jobs/Util/SystemLogger.php +++ b/app/Jobs/Util/SystemLogger.php @@ -49,15 +49,19 @@ class SystemLogger implements ShouldQueue public function handle() :void { - if(!$this->company) + if(!$this->company){ + nlog("SystemLogger:: No company"); return; + } MultiDB::setDb($this->company->db); $client_id = $this->client ? $this->client->id : null; - if(!$this->client && !$this->company->owner()) + if(!$this->client && !$this->company->owner()){ + nlog("SystemLogger:: could not find client and/or company owner"); return; + } $user_id = $this->client ? $this->client->user_id : $this->company->owner()->id; @@ -71,9 +75,16 @@ class SystemLogger implements ShouldQueue 'type_id' => $this->type_id, ]; - if(!$this->log) + if(!$this->log){ + nlog("SystemLogger:: no log to store"); return; + } SystemLog::create($sl); } + + public function failed($e) + { + nlog($e->getMessage()); + } } diff --git a/app/Mail/MigrationCompleted.php b/app/Mail/MigrationCompleted.php index 31c1bf10a144..09fa1c8319f2 100644 --- a/app/Mail/MigrationCompleted.php +++ b/app/Mail/MigrationCompleted.php @@ -3,9 +3,11 @@ namespace App\Mail; use App\Models\Company; +use App\Utils\Ninja; use Illuminate\Bus\Queueable; use Illuminate\Mail\Mailable; use Illuminate\Queue\SerializesModels; +use Illuminate\Support\Facades\App; class MigrationCompleted extends Mailable { @@ -33,6 +35,11 @@ class MigrationCompleted extends Mailable */ public function build() { + + App::forgetInstance('translator'); + $t = app('translator'); + $t->replace(Ninja::transformTranslations($this->company->settings)); + $data['settings'] = $this->company->settings; $data['company'] = $this->company->fresh(); $data['whitelabel'] = $this->company->account->isPaid() ? true : false; diff --git a/app/Transformers/AccountTransformer.php b/app/Transformers/AccountTransformer.php index c26b35d73e0f..7891d5baf114 100644 --- a/app/Transformers/AccountTransformer.php +++ b/app/Transformers/AccountTransformer.php @@ -82,6 +82,7 @@ class AccountTransformer extends EntityTransformer 'disable_auto_update' => (bool) config('ninja.disable_auto_update'), 'emails_sent' => (int) $account->emailsSent(), 'email_quota' => (int) $account->getDailyEmailLimit(), + 'is_migrated' => (bool) $account->is_migrated, ]; }