From fd84e534d90c156046e98cd81a0b72cdae170408 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 7 Feb 2022 19:01:05 +1100 Subject: [PATCH] Add currency conversion column --- app/Models/Company.php | 1 + app/Models/Invoice.php | 1 + app/Transformers/CompanyTransformer.php | 1 + ...currency_conversion_to_companies_table.php | 30 +++++++++++++++++++ 4 files changed, 33 insertions(+) create mode 100644 database/migrations/2022_02_06_091629_add_client_currency_conversion_to_companies_table.php diff --git a/app/Models/Company.php b/app/Models/Company.php index ec7497f1ebd1..40dae5dc15a2 100644 --- a/app/Models/Company.php +++ b/app/Models/Company.php @@ -97,6 +97,7 @@ class Company extends BaseModel 'use_comma_as_decimal_place', 'report_include_drafts', 'client_registration_fields', + 'convert_rate_to_client', ]; protected $hidden = [ diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index 93ada7f481c5..00dbe7962327 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -90,6 +90,7 @@ class Invoice extends BaseModel 'subscription_id', 'auto_bill_enabled', 'uses_inclusive_taxes', + 'vendor_id', ]; protected $casts = [ diff --git a/app/Transformers/CompanyTransformer.php b/app/Transformers/CompanyTransformer.php index 9fcd7abf44f9..453f1c3c8978 100644 --- a/app/Transformers/CompanyTransformer.php +++ b/app/Transformers/CompanyTransformer.php @@ -166,6 +166,7 @@ class CompanyTransformer extends EntityTransformer 'use_comma_as_decimal_place' => (bool) $company->use_comma_as_decimal_place, 'report_include_drafts' => (bool) $company->report_include_drafts, 'client_registration_fields' => (array) $company->client_registration_fields, + 'convert_rate_to_client' => (bool) $company->convert_rate_to_client, ]; } diff --git a/database/migrations/2022_02_06_091629_add_client_currency_conversion_to_companies_table.php b/database/migrations/2022_02_06_091629_add_client_currency_conversion_to_companies_table.php new file mode 100644 index 000000000000..08134aba1e73 --- /dev/null +++ b/database/migrations/2022_02_06_091629_add_client_currency_conversion_to_companies_table.php @@ -0,0 +1,30 @@ +boolean('convert_rate_to_client')->default(true); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + + } +}