1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Move custom labels into single column on DB custom_fields

This commit is contained in:
David Bomba 2019-10-10 13:52:57 +11:00
parent fb150cc1b0
commit 84edb28652
3 changed files with 60 additions and 58 deletions

View File

@ -30,40 +30,39 @@ class CompanySettings extends BaseSettings
public $payment_terms = 1;
public $custom_label1 = '';
public $custom_label2 = '';
public $custom_label3 = '';
public $custom_label4 = '';
public $custom_value1 = '';
public $custom_value2 = '';
public $custom_value3 = '';
public $custom_value4 = '';
public $custom_client_label1 = '';
public $custom_client_label2 = '';
public $custom_client_label3 = '';
public $custom_client_label4 = '';
public $custom_client_contact_label1 = '';
public $custom_client_contact_label2 = '';
public $custom_client_contact_label3 = '';
public $custom_client_contact_label4 = '';
public $custom_invoice_label1 = '';
public $custom_invoice_label2 = '';
public $custom_invoice_label3 = '';
public $custom_invoice_label4 = '';
public $custom_product_label1 = '';
public $custom_product_label2 = '';
public $custom_product_label3 = '';
public $custom_product_label4 = '';
public $custom_task_label1 = '';
public $custom_task_label2 = '';
public $custom_task_label3 = '';
public $custom_task_label4 = '';
public $custom_expense_label1 = '';
public $custom_expense_label2 = '';
public $custom_expense_label3 = '';
public $custom_expense_label4 = '';
// public $custom_label1 = '';
// public $custom_label2 = '';
// public $custom_label3 = '';
// public $custom_label4 = '';
// public $custom_client_label1 = '';
// public $custom_client_label2 = '';
// public $custom_client_label3 = '';
// public $custom_client_label4 = '';
// public $custom_client_contact_label1 = '';
// public $custom_client_contact_label2 = '';
// public $custom_client_contact_label3 = '';
// public $custom_client_contact_label4 = '';
// public $custom_invoice_label1 = '';
// public $custom_invoice_label2 = '';
// public $custom_invoice_label3 = '';
// public $custom_invoice_label4 = '';
// public $custom_product_label1 = '';
// public $custom_product_label2 = '';
// public $custom_product_label3 = '';
// public $custom_product_label4 = '';
// public $custom_task_label1 = '';
// public $custom_task_label2 = '';
// public $custom_task_label3 = '';
// public $custom_task_label4 = '';
// public $custom_expense_label1 = '';
// public $custom_expense_label2 = '';
// public $custom_expense_label3 = '';
// public $custom_expense_label4 = '';
public $custom_invoice_taxes1 = false;
public $custom_invoice_taxes2 = false;
@ -200,38 +199,38 @@ class CompanySettings extends BaseSettings
'language_id' => 'string',
'show_currency_code' => 'bool',
'payment_terms' => 'integer',
'custom_label1' => 'string',
'custom_label2' => 'string',
'custom_label3' => 'string',
'custom_label4' => 'string',
'custom_value1' => 'string',
'custom_value2' => 'string',
'custom_value3' => 'string',
'custom_value4' => 'string',
'custom_client_label1' => 'string',
'custom_client_label2' => 'string',
'custom_client_label3' => 'string',
'custom_client_label4' => 'string',
'custom_client_contact_label1' => 'string',
'custom_client_contact_label2' => 'string',
'custom_client_contact_label3' => 'string',
'custom_client_contact_label4' => 'string',
'custom_invoice_label1' => 'string',
'custom_invoice_label2' => 'string',
'custom_invoice_label3' => 'string',
'custom_invoice_label4' => 'string',
'custom_product_label1' => 'string',
'custom_product_label2' => 'string',
'custom_product_label3' => 'string',
'custom_product_label4' => 'string',
'custom_task_label1' => 'string',
'custom_task_label2' => 'string',
'custom_task_label3' => 'string',
'custom_task_label4' => 'string',
'custom_expense_label1' => 'string',
'custom_expense_label2' => 'string',
'custom_expense_label3' => 'string',
'custom_expense_label4' => 'string',
// 'custom_label1' => 'string',
// 'custom_label2' => 'string',
// 'custom_label3' => 'string',
// 'custom_label4' => 'string',
// 'custom_client_label1' => 'string',
// 'custom_client_label2' => 'string',
// 'custom_client_label3' => 'string',
// 'custom_client_label4' => 'string',
// 'custom_client_contact_label1' => 'string',
// 'custom_client_contact_label2' => 'string',
// 'custom_client_contact_label3' => 'string',
// 'custom_client_contact_label4' => 'string',
// 'custom_invoice_label1' => 'string',
// 'custom_invoice_label2' => 'string',
// 'custom_invoice_label3' => 'string',
// 'custom_invoice_label4' => 'string',
// 'custom_product_label1' => 'string',
// 'custom_product_label2' => 'string',
// 'custom_product_label3' => 'string',
// 'custom_product_label4' => 'string',
// 'custom_task_label1' => 'string',
// 'custom_task_label2' => 'string',
// 'custom_task_label3' => 'string',
// 'custom_task_label4' => 'string',
// 'custom_expense_label1' => 'string',
// 'custom_expense_label2' => 'string',
// 'custom_expense_label3' => 'string',
// 'custom_expense_label4' => 'string',
'custom_invoice_taxes1' => 'bool',
'custom_invoice_taxes2' => 'bool',
'default_task_rate' => 'float',

View File

@ -61,6 +61,7 @@ class Company extends BaseModel
// 'id_number',
'size_id',
//'settings',
'custom_fields',
];
protected $hidden = [
@ -77,6 +78,7 @@ class Company extends BaseModel
protected $casts = [
'settings' => 'object',
'custom_fields' => 'object',
'updated_at' => 'timestamp',
'created_at' => 'timestamp',
'deleted_at' => 'timestamp',

View File

@ -150,6 +150,7 @@ class CreateUsersTable extends Migration
$table->string('start_of_week')->nullable();
$table->string('financial_year_start')->nullable();
$table->smallInteger('enable_modules')->default(0);
$table->text('custom_fields');
$table->text('settings');
$table->timestamps(6);