feat: add models fields labels.

This commit is contained in:
Ahmed Bouhuolia
2020-10-17 19:11:51 +02:00
parent 078098c593
commit bd2ce7ccee
7 changed files with 86 additions and 7 deletions

View File

@@ -125,33 +125,42 @@ export default class Expense extends TenantModel {
static get fields() {
return {
payment_date: {
label: 'Payment date',
column: 'payment_date',
},
payment_account: {
label: 'Payment account',
column: 'payment_account_id',
relation: 'accounts.id',
},
amount: {
label: 'Amount',
column: 'total_amount',
},
currency_code: {
label: 'Currency',
column: 'currency_code',
},
reference_no: {
label: 'Reference No.',
column: 'reference_no'
},
description: {
label: 'Description',
column: 'description',
},
published: {
label: 'Published',
column: 'published',
},
user: {
label: 'User',
column: 'user_id',
relation: 'users.id',
relationColumn: 'users.id',
},
created_at: {
label: 'Created at',
column: 'created_at',
},
};

View File

@@ -103,64 +103,83 @@ export default class Item extends TenantModel {
};
}
/**
* Item fields.
*/
static get fields() {
return {
type: {
label: 'Type',
column: 'type',
},
name: {
label: 'Name',
column: 'name',
},
sellable: {
label: 'Sellable',
column: 'sellable',
},
purchasable: {
label: 'Purchasable',
column: 'purchasable',
},
sell_price: {
label: 'Sell price',
column: 'sell_price'
},
cost_price: {
label: 'Cost price',
column: 'cost_price',
},
currency_code: {
label: 'Currency',
column: 'currency_code',
},
cost_account: {
label: 'Cost account',
column: 'cost_account_id',
relation: 'accounts.id',
},
sell_account: {
label: 'Sell account',
column: 'sell_account_id',
relation: 'accounts.id',
},
inventory_account: {
label: "Inventory account",
column: 'inventory_account_id',
relation: 'accounts.id',
},
sell_description: {
label: "Sell description",
column: 'sell_description',
},
purchase_description: {
label: "Purchase description",
column: 'purchase_description',
},
quantity_on_hand: {
label: "Quantity on hand",
column: 'quantity_on_hand',
},
note: {
label: 'Note',
column: 'note',
},
category: {
label: "Category",
column: 'category_id',
relation: 'categories.id',
},
user: {
label: 'User',
column: 'user_id',
relation: 'users.id',
relationColumn: 'users.id',
},
created_at: {
label: 'Created at',
column: 'created_at',
}
};

View File

@@ -42,40 +42,52 @@ export default class ItemCategory extends TenantModel {
};
}
/**
* Item category fields.
*/
static get fields() {
return {
name: {
label: 'Name',
column: 'name',
},
description: {
label: 'Description',
column: 'description',
},
parent_category_id: {
label: 'Parent category',
column: 'parent_category_id',
relation: 'items_categories.id',
relationColumn: 'items_categories.id',
},
user: {
label: 'User',
column: 'user_id',
relation: 'users.id',
relationColumn: 'users.id',
},
cost_account: {
label: 'Cost account',
column: 'cost_account_id',
relation: 'accounts.id',
},
sell_account: {
label: 'Sell account',
column: 'sell_account_id',
relation: 'accounts.id',
},
inventory_account: {
label: 'Inventory account',
column: 'inventory_account_id',
relation: 'accounts.id',
},
cost_method: {
label: 'Cost method',
column: 'cost_method',
},
created_at: {
label: 'Created at',
column: 'created_at',
},
};

View File

@@ -17,9 +17,6 @@ export default class ManualJournal extends TenantModel {
return ['createdAt', 'updatedAt'];
}
/**
*
*/
static get resourceable() {
return true;
}
@@ -67,32 +64,41 @@ export default class ManualJournal extends TenantModel {
static get fields() {
return {
date: {
label: 'Date',
column: 'date',
},
journal_number: {
label: 'Journal number',
column: 'journal_number',
},
reference: {
label: 'Reference No.',
column: 'reference',
},
status: {
label: 'Status',
column: 'status',
},
amount: {
label: 'Amount',
column: 'amount',
},
description: {
label: 'Description',
column: 'description',
},
user: {
label: 'User',
column: 'user_id',
relation: 'users.id',
relationColumn: 'users.id',
},
journal_type: {
label: 'Journal type',
column: 'journal_type',
},
created_at: {
label: 'Created at',
column: 'created_at',
},
};