mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 22:30:31 +00:00
feat: optimize dynamic list service.
feat: inactive mode for accounts, items, customers and vendors services.
This commit is contained in:
@@ -42,68 +42,6 @@ export default class ItemCategory extends TenantModel {
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Item category fields.
|
||||
*/
|
||||
static get fields() {
|
||||
return {
|
||||
name: {
|
||||
label: 'Name',
|
||||
column: 'name',
|
||||
columnType: 'string'
|
||||
},
|
||||
description: {
|
||||
label: 'Description',
|
||||
column: 'description',
|
||||
columnType: 'string'
|
||||
},
|
||||
user: {
|
||||
label: 'User',
|
||||
column: 'user_id',
|
||||
relation: 'users.id',
|
||||
relationColumn: 'users.id',
|
||||
},
|
||||
cost_account: {
|
||||
label: 'Cost account',
|
||||
column: 'cost_account_id',
|
||||
relation: 'accounts.id',
|
||||
optionsResource: 'account'
|
||||
},
|
||||
sell_account: {
|
||||
label: 'Sell account',
|
||||
column: 'sell_account_id',
|
||||
relation: 'accounts.id',
|
||||
optionsResource: 'account'
|
||||
},
|
||||
inventory_account: {
|
||||
label: 'Inventory account',
|
||||
column: 'inventory_account_id',
|
||||
relation: 'accounts.id',
|
||||
optionsResource: 'account'
|
||||
},
|
||||
cost_method: {
|
||||
label: 'Cost method',
|
||||
column: 'cost_method',
|
||||
options: [{
|
||||
key: 'FIFO', label: 'First-in first-out (FIFO)',
|
||||
key: 'LIFO', label: 'Last-in first-out (LIFO)',
|
||||
key: 'average', label: 'Average rate',
|
||||
}],
|
||||
columnType: 'string',
|
||||
},
|
||||
count: {
|
||||
label: 'Count',
|
||||
column: 'count',
|
||||
sortQuery: this.sortCountQuery
|
||||
},
|
||||
created_at: {
|
||||
label: 'Created at',
|
||||
column: 'created_at',
|
||||
columnType: 'date',
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
static sortCountQuery(query, role) {
|
||||
query.orderBy('count', role.order);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user