diff --git a/app/Console/Commands/SendRecurringInvoices.php b/app/Console/Commands/SendRecurringInvoices.php index 11a8e0cd93..e1b511856c 100644 --- a/app/Console/Commands/SendRecurringInvoices.php +++ b/app/Console/Commands/SendRecurringInvoices.php @@ -71,7 +71,7 @@ class SendRecurringInvoices extends Command foreach ($accounts as $account) { - if(!$account->is_disabled) + if(!$account->account_email_settings->is_disabled) $account->checkCounterReset(); } } @@ -97,7 +97,7 @@ class SendRecurringInvoices extends Command $account = $recurInvoice->account; - if($account->is_disabled){ + if($account->account_email_settings->is_disabled){ continue; } @@ -134,7 +134,7 @@ class SendRecurringInvoices extends Command foreach ($expenses as $expense) { $shouldSendToday = $expense->shouldSendToday(); - if (! $shouldSendToday || $expense->account->is_disabled) { + if (! $shouldSendToday || $expense->account->account_email_settings->is_disabled) { continue; } diff --git a/app/Console/Commands/SendReminders.php b/app/Console/Commands/SendReminders.php index 29591e9986..de24f72773 100644 --- a/app/Console/Commands/SendReminders.php +++ b/app/Console/Commands/SendReminders.php @@ -128,7 +128,7 @@ class SendReminders extends Command $this->info(date('r ') . $accounts->count() . ' accounts found with fees enabled'); foreach ($accounts as $account) { - if (! $account->hasFeature(FEATURE_EMAIL_TEMPLATES_REMINDERS) || $account->is_disabled) { + if (! $account->hasFeature(FEATURE_EMAIL_TEMPLATES_REMINDERS) || $account->account_email_settings->is_disabled) { continue; } @@ -155,7 +155,7 @@ class SendReminders extends Command $this->info(date('r ') . count($accounts) . ' accounts found with reminders enabled'); foreach ($accounts as $account) { - if (! $account->hasFeature(FEATURE_EMAIL_TEMPLATES_REMINDERS) || $account->is_disabled) { + if (! $account->hasFeature(FEATURE_EMAIL_TEMPLATES_REMINDERS) || $account->account_email_settings->is_disabled) { continue; } @@ -201,7 +201,7 @@ class SendReminders extends Command $account = $scheduledReport->account; $account->loadLocalizationSettings(); - if (! $account->hasFeature(FEATURE_REPORTS) || $account->is_disabled) { + if (! $account->hasFeature(FEATURE_REPORTS) || $account->account_email_settings->is_disabled) { continue; } diff --git a/app/Http/Controllers/ClientPortalController.php b/app/Http/Controllers/ClientPortalController.php index 4bb11aac9c..c83ff2d30b 100644 --- a/app/Http/Controllers/ClientPortalController.php +++ b/app/Http/Controllers/ClientPortalController.php @@ -68,14 +68,14 @@ class ClientPortalController extends BaseController $account = $invoice->account; /* Forward requests from V4 to V5 if the domain is set */ - if(strlen($account->forward_url_for_v5) >1){ + if(strlen($account->account_email_settings->forward_url_for_v5) >1){ if ($invoice->isType(INVOICE_TYPE_QUOTE)) $entity = 'quote'; else $entity = 'invoice'; - return redirect($account->forward_url_for_v5."/client/".$entity."/".$invitationKey); + return redirect($account->account_email_settings->forward_url_for_v5."/client/".$entity."/".$invitationKey); } if (request()->silent) { diff --git a/app/Http/Controllers/Migration/StepsController.php b/app/Http/Controllers/Migration/StepsController.php index 1ab40663cc..e7e4d76a68 100644 --- a/app/Http/Controllers/Migration/StepsController.php +++ b/app/Http/Controllers/Migration/StepsController.php @@ -101,17 +101,17 @@ class StepsController extends BaseController ->withInput(); } - $account = \Auth::user()->account; + $account_settings = \Auth::user()->account->account_email_settings; if(strlen($request->input('url')) == 0) { - $account->is_disabled = false; + $account_settings->is_disabled = false; } else { - $account->is_disabled = true; + $account_settings->is_disabled = true; } - $account->forward_url_for_v5 = rtrim($request->input('url'),'/'); - $account->save(); + $account_settings->forward_url_for_v5 = rtrim($request->input('url'),'/'); + $account_settings->save(); return back(); } diff --git a/database/migrations/2021_06_22_234707_add_forward_url_for_v5.php b/database/migrations/2021_06_22_234707_add_forward_url_for_v5.php index 7b033cb6ad..07ba155329 100644 --- a/database/migrations/2021_06_22_234707_add_forward_url_for_v5.php +++ b/database/migrations/2021_06_22_234707_add_forward_url_for_v5.php @@ -13,7 +13,7 @@ class AddForwardUrlForV5 extends Migration */ public function up() { - Schema::table('accounts', function ($table) { + Schema::table('account_email_settings', function ($table) { $table->text('forward_url_for_v5')->default(''); $table->boolean('is_disabled')->default(false); }); diff --git a/resources/views/accounts/management.blade.php b/resources/views/accounts/management.blade.php index 9acb3c80d7..1c920624b7 100644 --- a/resources/views/accounts/management.blade.php +++ b/resources/views/accounts/management.blade.php @@ -285,7 +285,7 @@