Add convert currency properties to company table

This commit is contained in:
David Bomba 2022-12-07 13:48:38 +11:00
parent 54b9d3f65d
commit 02d30ee778
3 changed files with 35 additions and 0 deletions

View File

@ -126,6 +126,8 @@ class Company extends BaseModel
'report_include_deleted',
'invoice_task_lock',
'use_vendor_currency',
'convert_payment_currency',
'convert_expense_currency',
];
protected $hidden = [

View File

@ -190,6 +190,8 @@ class CompanyTransformer extends EntityTransformer
'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

@ -0,0 +1,31 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('companies', function (Blueprint $table) {
$table->boolean('convert_payment_currency')->default(false);
$table->boolean('convert_expense_currency')->default(false);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
}
};