diff --git a/app/Console/Kernel.php b/app/Console/Kernel.php index 2307feb938..7e4cc49f59 100644 --- a/app/Console/Kernel.php +++ b/app/Console/Kernel.php @@ -45,27 +45,27 @@ class Kernel extends ConsoleKernel { //$schedule->job(new RecurringInvoicesCron)->hourly(); - $schedule->job(new VersionCheck)->daily(); + $schedule->job(new VersionCheck)->daily()->withoutOverlapping(); - $schedule->command('ninja:check-data')->daily(); + $schedule->command('ninja:check-data')->daily()->withoutOverlapping(); - $schedule->job(new ReminderJob)->daily(); + $schedule->job(new ReminderJob)->daily()->withoutOverlapping(); - $schedule->job(new CompanySizeCheck)->daily(); + $schedule->job(new CompanySizeCheck)->daily()->withoutOverlapping(); - $schedule->job(new UpdateExchangeRates)->daily(); + $schedule->job(new UpdateExchangeRates)->daily()->withoutOverlapping(); - $schedule->job(new RecurringInvoicesCron)->hourly(); + $schedule->job(new RecurringInvoicesCron)->hourly()->withoutOverlapping(); /* Run hosted specific jobs */ if (Ninja::isHosted()) { - $schedule->job(new AdjustEmailQuota())->daily(); - $schedule->job(new SendFailedEmails())->daily(); + $schedule->job(new AdjustEmailQuota())->daily()->withoutOverlapping(); + $schedule->job(new SendFailedEmails())->daily()->withoutOverlapping(); } /* Run queue's in shared hosting with this*/ if (Ninja::isSelfHost()) { $schedule->command('queue:work')->everyMinute()->withoutOverlapping(); - $schedule->command('queue:restart')->everyFiveMinutes(); //we need to add this as we are seeing cached queues mess up the system on first load. + $schedule->command('queue:restart')->everyFiveMinutes()->withoutOverlapping(); //we need to add this as we are seeing cached queues mess up the system on first load. } } diff --git a/app/Models/ClientContact.php b/app/Models/ClientContact.php index 91cba76ac5..b6403d9672 100644 --- a/app/Models/ClientContact.php +++ b/app/Models/ClientContact.php @@ -61,6 +61,7 @@ class ClientContact extends Authenticatable implements HasLocalePreference 'updated_at' => 'timestamp', 'created_at' => 'timestamp', 'deleted_at' => 'timestamp', + 'last_login' => 'timestamp', ]; protected $hidden = [ diff --git a/app/Models/RecurringInvoice.php b/app/Models/RecurringInvoice.php index a650ba3c7e..adedd9f8bb 100644 --- a/app/Models/RecurringInvoice.php +++ b/app/Models/RecurringInvoice.php @@ -99,6 +99,8 @@ class RecurringInvoice extends BaseModel 'amount', 'partial', 'frequency_id', + 'next_send_date', + 'remaining_cycles', ]; protected $casts = [ diff --git a/app/Transformers/RecurringInvoiceTransformer.php b/app/Transformers/RecurringInvoiceTransformer.php index 103679abc7..ffbb8c4503 100644 --- a/app/Transformers/RecurringInvoiceTransformer.php +++ b/app/Transformers/RecurringInvoiceTransformer.php @@ -136,6 +136,7 @@ class RecurringInvoiceTransformer extends EntityTransformer 'remaining_cycles' => (int) $invoice->remaining_cycles, 'recurring_dates' => (array) $invoice->recurringDates(), 'auto_bill' => (string) $invoice->auto_bill, + 'auto_bill_enabled' => (bool) $invoice->auto_bill_enabled, 'due_date_days' => (string) $invoice->due_date_days ?: '', ]; } diff --git a/database/migrations/2020_08_18_140557_add_is_public_to_documents_table.php b/database/migrations/2020_08_18_140557_add_is_public_to_documents_table.php index 8713851f8e..1be7ff6c48 100644 --- a/database/migrations/2020_08_18_140557_add_is_public_to_documents_table.php +++ b/database/migrations/2020_08_18_140557_add_is_public_to_documents_table.php @@ -48,7 +48,8 @@ class AddIsPublicToDocumentsTable extends Migration }); Schema::table('recurring_invoices', function ($table) { - $table->boolean('auto_bill')->default(0); + $table->string('auto_bill')->default('off'); + $table->boolean('auto_bill_enabled')->default(0); $table->unsignedInteger('design_id')->nullable(); $table->boolean('uses_inclusive_taxes')->default(0); $table->string('custom_surcharge1')->nullable();