From 6c8038da13b063f4a304a4fef71afe157087fcfe Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 4 Jun 2023 16:50:53 +1000 Subject: [PATCH] Additional migrations for the company table --- app/Models/Company.php | 7 ++-- app/Transformers/CompanyTransformer.php | 2 ++ ...ect_and_task_columns_for_company_model.php | 32 +++++++++++++++++++ 3 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 database/migrations/2023_06_04_064713_project_and_task_columns_for_company_model.php diff --git a/app/Models/Company.php b/app/Models/Company.php index b062d01d4b..08714d252c 100644 --- a/app/Models/Company.php +++ b/app/Models/Company.php @@ -241,12 +241,12 @@ class Company extends BaseModel protected array $tax_coverage_countries = [ 'US', // //EU countries - // 'AT', // Austria + 'AT', // Austria // 'BE', // Belgium // 'BG', // Bulgaria // 'CY', // Cyprus // 'CZ', // Czech Republic - // 'DE', // Germany + 'DE', // Germany // 'DK', // Denmark // 'EE', // Estonia // 'ES', // Spain @@ -269,9 +269,12 @@ class Company extends BaseModel // 'SI', // Slovenia // 'SK', // Slovakia // //EU Countries + 'AU', // Australia ]; protected $fillable = [ + 'invoice_task_item_description', + 'invoice_task_project_header', 'invoice_task_hours', 'markdown_enabled', 'calculate_expense_tax_by_amount', diff --git a/app/Transformers/CompanyTransformer.php b/app/Transformers/CompanyTransformer.php index 4152fa1988..0d6241ca8c 100644 --- a/app/Transformers/CompanyTransformer.php +++ b/app/Transformers/CompanyTransformer.php @@ -201,6 +201,8 @@ class CompanyTransformer extends EntityTransformer 'tax_data' => $company->tax_data ?: new \stdClass, 'has_e_invoice_certificate' => $company->e_invoice_certificate ? true : false, 'has_e_invoice_certificate_passphrase' => $company->e_invoice_certificate_passphrase ? true : false, + 'invoice_task_project_header' => (bool) $company->invoice_task_project_header, + 'invoice_task_item_description' => (bool) $company->invoice_task_item_description, ]; } diff --git a/database/migrations/2023_06_04_064713_project_and_task_columns_for_company_model.php b/database/migrations/2023_06_04_064713_project_and_task_columns_for_company_model.php new file mode 100644 index 0000000000..4f98a9981b --- /dev/null +++ b/database/migrations/2023_06_04_064713_project_and_task_columns_for_company_model.php @@ -0,0 +1,32 @@ +boolean('invoice_task_project_header')->default(true); + $table->boolean('invoice_task_item_description')->default(true); + }); + + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + // + } +};