1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Drop use_vendor_currency column from companies

This commit is contained in:
David Bomba 2022-12-14 13:20:32 +11:00
parent d61620bcf6
commit a25711b5eb
3 changed files with 6 additions and 2 deletions

View File

@ -127,7 +127,6 @@ class Company extends BaseModel
'invoice_task_project',
'report_include_deleted',
'invoice_task_lock',
'use_vendor_currency',
'convert_payment_currency',
'convert_expense_currency',
];

View File

@ -191,7 +191,6 @@ class CompanyTransformer extends EntityTransformer
'invoice_task_project' => (bool) $company->invoice_task_project,
'report_include_deleted' => (bool) $company->report_include_deleted,
'invoice_task_lock' => (bool) $company->invoice_task_lock,
'use_vendor_currency' => (bool) $company->use_vendor_currency,
'convert_payment_currency' => (bool) $company->convert_payment_currency,
'convert_expense_currency' => (bool) $company->convert_expense_currency,
];

View File

@ -14,6 +14,12 @@ return new class extends Migration
*/
public function up()
{
Schema::table('companies', function (Blueprint $table)
{
$table->dropColumn('use_vendor_currency');
});
Vendor::query()->whereNull('currency_id')->orWhere('currency_id', '')->cursor()->each(function ($vendor){
$vendor->currency_id = $vendor->company->settings->currency_id;