From 6f84e07c101481dd8076b9162c616ccf4df7f3b4 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 21 Oct 2020 08:15:11 +1100 Subject: [PATCH] Fixes for schema, fixes for recurring invoice markViewed() --- app/Models/RecurringInvoiceInvitation.php | 4 ++-- app/Models/Vendor.php | 2 ++ .../2020_10_19_101823_project_name_unique_removal.php | 9 +++++++++ resources/views/index/index.blade.php | 2 ++ 4 files changed, 15 insertions(+), 2 deletions(-) diff --git a/app/Models/RecurringInvoiceInvitation.php b/app/Models/RecurringInvoiceInvitation.php index 1fe75fe74af1..3b54b32ad9a5 100644 --- a/app/Models/RecurringInvoiceInvitation.php +++ b/app/Models/RecurringInvoiceInvitation.php @@ -76,13 +76,13 @@ class RecurringInvoiceInvitation extends BaseModel public function markViewed() { - $this->viewed_date = Carbon::now(); + $this->viewed_date = now(); $this->save(); } public function markOpened() { - $this->opened_date = Carbon::now(); + $this->opened_date = now(); $this->save(); } diff --git a/app/Models/Vendor.php b/app/Models/Vendor.php index 9ab0d05dfa00..7538b3ed5f10 100644 --- a/app/Models/Vendor.php +++ b/app/Models/Vendor.php @@ -64,6 +64,8 @@ class Vendor extends BaseModel // 'contacts', ]; + protected $presenter = \App\Models\Presenters\VendorPresenter::class; + public function getEntityType() { return self::class; diff --git a/database/migrations/2020_10_19_101823_project_name_unique_removal.php b/database/migrations/2020_10_19_101823_project_name_unique_removal.php index de411b87d721..22ea62bd6c61 100644 --- a/database/migrations/2020_10_19_101823_project_name_unique_removal.php +++ b/database/migrations/2020_10_19_101823_project_name_unique_removal.php @@ -28,6 +28,8 @@ class ProjectNameUniqueRemoval extends Migration Schema::table('companies', function (Blueprint $table) { $table->boolean('invoice_expense_documents')->default(false); + $table->boolean('auto_start_tasks')->default(false); + }); Schema::create('task_statuses', function (Blueprint $table) { @@ -44,6 +46,13 @@ class ProjectNameUniqueRemoval extends Migration $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade')->onUpdate('cascade'); $table->foreign('user_id')->references('id')->on('users')->onDelete('cascade')->onUpdate('cascade'); }); + + Schema::table('tasks', function (Blueprint $table) { + $table->decimal('rate', 16, 4)->default(0); + $table->renameColumn('task_status_id', 'status_id'); + $table->renameColumn('task_status_sort_order', 'sort_order'); + + }); } /** diff --git a/resources/views/index/index.blade.php b/resources/views/index/index.blade.php index efdde9ef8226..dfbae0aa309a 100644 --- a/resources/views/index/index.blade.php +++ b/resources/views/index/index.blade.php @@ -1,6 +1,8 @@ + + Invoice Ninja