From 944bd1207cc3dd39816934079cc30fc667d289ac Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 15 Oct 2020 08:16:20 +1100 Subject: [PATCH 1/2] Company entity options --- .../2020_10_14_201320_project_ids_to_entities.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/database/migrations/2020_10_14_201320_project_ids_to_entities.php b/database/migrations/2020_10_14_201320_project_ids_to_entities.php index d81d02e0e2fd..9d3af7e58eb5 100644 --- a/database/migrations/2020_10_14_201320_project_ids_to_entities.php +++ b/database/migrations/2020_10_14_201320_project_ids_to_entities.php @@ -21,6 +21,13 @@ class ProjectIdsToEntities extends Migration $table->longText('fields')->change(); }); + Schema::table('gateways', function (Blueprint $table) { + $table->boolean('mark_expenses_invoiceable')->default(0); + $table->boolean('mark_expenses_paid')->default(0); + $table->enum('use_credits_payment', ['always', 'off', 'optin'])->nullable(); + }); + + } /** From 460545882c3e53386c1459332c67d04802ca0a9e Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 15 Oct 2020 08:25:40 +1100 Subject: [PATCH 2/2] Additional fields for company model --- app/Models/Company.php | 3 +++ app/Transformers/CompanyTransformer.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/app/Models/Company.php b/app/Models/Company.php index 176c6139a651..9f149f806a01 100644 --- a/app/Models/Company.php +++ b/app/Models/Company.php @@ -85,6 +85,9 @@ class Company extends BaseModel protected $presenter = \App\Models\Presenters\CompanyPresenter::class; protected $fillable = [ + 'mark_expenses_invoiceable', + 'mark_expenses_paid', + 'use_credits_payment', 'enabled_item_tax_rates', 'fill_products', 'industry_id', diff --git a/app/Transformers/CompanyTransformer.php b/app/Transformers/CompanyTransformer.php index c935afef3791..51315c0e7b57 100644 --- a/app/Transformers/CompanyTransformer.php +++ b/app/Transformers/CompanyTransformer.php @@ -142,6 +142,9 @@ class CompanyTransformer extends EntityTransformer 'client_can_register' => (bool) $company->client_can_register, 'is_large' => (bool) $company->is_large, 'enable_shop_api' => (bool) $company->enable_shop_api, + 'mark_expenses_invoiceable'=> (bool) $company->mark_expenses_invoiceable, + 'mark_expenses_paid' => (bool) $company->mark_expenses_paid, + 'use_credits_payment' => (string) $company->use_credits_payment, ]; }