mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 12:20:31 +00:00
feat: add models fields labels.
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
import { Inject, Service } from 'typedi';
|
||||
import { Router, Request, Response, NextFunction } from 'express';
|
||||
import { check, param, query, ValidationChain, matchedData } from 'express-validator';
|
||||
import { check, param, query, ValidationChain } from 'express-validator';
|
||||
import asyncMiddleware from 'api/middleware/asyncMiddleware';
|
||||
import ItemsService from 'services/Items/ItemsService';
|
||||
import BaseController from 'api/controllers/BaseController';
|
||||
import DynamicListingService from 'services/DynamicListing/DynamicListService';
|
||||
import { ServiceError } from 'exceptions';
|
||||
import { IItemDTO } from 'interfaces';
|
||||
import { Request } from 'express-validator/src/base';
|
||||
|
||||
@Service()
|
||||
export default class ItemsController extends BaseController {
|
||||
|
||||
@@ -45,4 +45,14 @@ export default {
|
||||
// config: true,
|
||||
},
|
||||
],
|
||||
manual_journals: [
|
||||
{
|
||||
key: 'journal_number_next',
|
||||
type: 'number',
|
||||
},
|
||||
{
|
||||
key: 'journal_number_prefix',
|
||||
type: 'string',
|
||||
},
|
||||
]
|
||||
};
|
||||
@@ -43,5 +43,29 @@
|
||||
"Credit": "Credit",
|
||||
"Interest": "Interest",
|
||||
"Depreciation": "Depreciation",
|
||||
"Payroll": "Payroll"
|
||||
"Payroll": "Payroll",
|
||||
"Type": "Type",
|
||||
"Name": "Name",
|
||||
"Sellable": "Sellable",
|
||||
"Purchasable": "Purchasable",
|
||||
"Sell price": "Sell price",
|
||||
"Cost price": "Cost price",
|
||||
"User": "User",
|
||||
"Category": "Category",
|
||||
"Note": "Note",
|
||||
"Quantity on hand": "Quantity on hand",
|
||||
"Purchase description": "Purchase description",
|
||||
"Sell description": "Sell description",
|
||||
"Sell account": "Sell account",
|
||||
"Cost account": "Cost account",
|
||||
"Inventory account": "Inventory account",
|
||||
"Payment date": "Payment date",
|
||||
"Payment account": "Payment account",
|
||||
"Amount": "Amount",
|
||||
"Reference No.": "Reference No.",
|
||||
"Published": "Published",
|
||||
"Journal number": "Journal number",
|
||||
"Status": "Status",
|
||||
"Journal type": "Journal type",
|
||||
"Date": "Date"
|
||||
}
|
||||
@@ -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',
|
||||
},
|
||||
};
|
||||
|
||||
@@ -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',
|
||||
}
|
||||
};
|
||||
|
||||
@@ -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',
|
||||
},
|
||||
};
|
||||
|
||||
@@ -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',
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user