2018-07-15 11:41:27 +00:00
|
|
|
import frappe from 'frappejs';
|
2020-01-02 17:06:57 +00:00
|
|
|
import { openSettings } from '@/utils';
|
2018-07-15 11:41:27 +00:00
|
|
|
import { _ } from 'frappejs/utils';
|
2019-11-19 18:51:07 +00:00
|
|
|
import Icon from './components/Icon';
|
2019-10-24 11:49:22 +00:00
|
|
|
import router from './router';
|
2018-06-15 15:46:14 +00:00
|
|
|
|
2019-08-01 11:52:58 +00:00
|
|
|
const config = {
|
2019-07-16 09:14:44 +00:00
|
|
|
getTitle: async () => {
|
2019-11-19 18:51:07 +00:00
|
|
|
const { companyName } = await frappe.getSingle('AccountingSettings');
|
2019-08-01 11:52:58 +00:00
|
|
|
return companyName;
|
2018-06-04 11:00:46 +00:00
|
|
|
},
|
2018-07-15 11:41:27 +00:00
|
|
|
groups: [
|
2019-12-21 14:46:50 +00:00
|
|
|
{
|
|
|
|
title: _('Get Started'),
|
|
|
|
route: '/get-started',
|
|
|
|
icon: getIcon('general', '24', '5')
|
|
|
|
},
|
2018-07-15 11:41:27 +00:00
|
|
|
{
|
2019-10-03 13:46:12 +00:00
|
|
|
title: _('Dashboard'),
|
|
|
|
route: '/',
|
2019-11-19 18:51:07 +00:00
|
|
|
icon: getIcon('dashboard')
|
2019-10-03 13:46:12 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: _('Sales'),
|
2019-11-19 18:51:07 +00:00
|
|
|
icon: getIcon('sales'),
|
2019-10-24 11:49:22 +00:00
|
|
|
action() {
|
2019-11-19 18:51:07 +00:00
|
|
|
router.push('/list/SalesInvoice');
|
2019-10-24 11:49:22 +00:00
|
|
|
},
|
2018-07-15 11:41:27 +00:00
|
|
|
items: [
|
|
|
|
{
|
2020-02-03 13:58:44 +00:00
|
|
|
label: _('Invoices'),
|
2019-12-20 06:52:14 +00:00
|
|
|
route: '/list/SalesInvoice',
|
|
|
|
doctype: 'SalesInvoice'
|
2018-07-15 11:41:27 +00:00
|
|
|
},
|
|
|
|
{
|
2019-10-03 13:46:12 +00:00
|
|
|
label: _('Customers'),
|
2019-12-20 06:52:14 +00:00
|
|
|
route: '/list/Customer',
|
|
|
|
doctype: 'Customer'
|
2018-07-15 11:41:27 +00:00
|
|
|
},
|
2019-07-18 06:49:12 +00:00
|
|
|
{
|
2019-10-03 13:46:12 +00:00
|
|
|
label: _('Items'),
|
2019-12-20 06:52:14 +00:00
|
|
|
route: '/list/Item',
|
|
|
|
doctype: 'Item'
|
2019-07-18 06:49:12 +00:00
|
|
|
},
|
2019-11-19 18:51:07 +00:00
|
|
|
{
|
|
|
|
label: _('Journal Entry'),
|
2019-12-20 06:52:14 +00:00
|
|
|
route: '/list/JournalEntry',
|
|
|
|
doctype: 'JournalEntry'
|
2018-07-15 11:41:27 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2018-09-26 14:23:53 +00:00
|
|
|
{
|
2019-10-03 13:46:12 +00:00
|
|
|
title: _('Purchases'),
|
2019-11-19 18:51:07 +00:00
|
|
|
icon: getIcon('purchase'),
|
2019-10-24 11:49:22 +00:00
|
|
|
action() {
|
2019-11-19 18:51:07 +00:00
|
|
|
router.push('/list/PurchaseInvoice');
|
2019-10-24 11:49:22 +00:00
|
|
|
},
|
2018-09-26 14:23:53 +00:00
|
|
|
items: [
|
|
|
|
{
|
2020-02-03 13:58:44 +00:00
|
|
|
label: _('Bills'),
|
2019-12-20 06:52:14 +00:00
|
|
|
route: '/list/PurchaseInvoice',
|
|
|
|
doctype: 'PurchaseInvoice'
|
2018-09-26 14:23:53 +00:00
|
|
|
},
|
2019-07-19 13:24:31 +00:00
|
|
|
{
|
2019-10-03 13:46:12 +00:00
|
|
|
label: _('Suppliers'),
|
2019-12-20 06:52:14 +00:00
|
|
|
route: '/list/Supplier',
|
|
|
|
doctype: 'Supplier'
|
2019-07-19 13:24:31 +00:00
|
|
|
},
|
2018-09-26 14:23:53 +00:00
|
|
|
{
|
2019-10-03 13:46:12 +00:00
|
|
|
label: _('Items'),
|
2019-12-20 06:52:14 +00:00
|
|
|
route: '/list/Item',
|
|
|
|
doctype: 'Item'
|
2019-07-16 09:14:44 +00:00
|
|
|
},
|
2019-11-19 18:51:07 +00:00
|
|
|
{
|
|
|
|
label: _('Journal Entry'),
|
2019-12-20 06:52:14 +00:00
|
|
|
route: '/list/JournalEntry',
|
|
|
|
doctype: 'JournalEntry'
|
2018-09-26 14:23:53 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2018-07-15 11:41:27 +00:00
|
|
|
{
|
|
|
|
title: _('Reports'),
|
2019-11-19 18:51:07 +00:00
|
|
|
icon: getIcon('reports'),
|
2019-11-27 18:38:28 +00:00
|
|
|
action() {
|
|
|
|
router.push('/report/general-ledger');
|
|
|
|
},
|
2018-07-15 11:41:27 +00:00
|
|
|
items: [
|
|
|
|
{
|
2019-07-16 09:14:44 +00:00
|
|
|
label: _('General Ledger'),
|
|
|
|
route: '/report/general-ledger'
|
2018-09-29 07:23:46 +00:00
|
|
|
},
|
2019-08-20 08:57:27 +00:00
|
|
|
{
|
|
|
|
label: _('Profit And Loss'),
|
|
|
|
route: '/report/profit-and-loss'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: _('Balance Sheet'),
|
|
|
|
route: '/report/balance-sheet'
|
|
|
|
},
|
2019-07-18 06:49:12 +00:00
|
|
|
{
|
|
|
|
label: _('Trial Balance'),
|
|
|
|
route: '/report/trial-balance'
|
2018-07-15 11:41:27 +00:00
|
|
|
}
|
|
|
|
]
|
2018-10-10 10:32:56 +00:00
|
|
|
},
|
|
|
|
{
|
2019-12-23 08:26:41 +00:00
|
|
|
title: _('Setup'),
|
2019-11-19 18:51:07 +00:00
|
|
|
icon: getIcon('settings'),
|
2019-12-23 08:26:41 +00:00
|
|
|
items: [
|
|
|
|
{
|
|
|
|
label: _('Chart of Accounts'),
|
|
|
|
route: '/chart-of-accounts'
|
|
|
|
},
|
2020-01-02 17:09:03 +00:00
|
|
|
{
|
|
|
|
label: _('Taxes'),
|
|
|
|
route: '/list/Tax',
|
|
|
|
doctype: 'Tax'
|
|
|
|
},
|
2019-12-23 08:26:41 +00:00
|
|
|
{
|
|
|
|
label: _('Settings'),
|
|
|
|
action() {
|
|
|
|
openSettings();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
2018-07-15 11:41:27 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
2019-08-01 11:52:58 +00:00
|
|
|
|
2019-12-21 14:46:50 +00:00
|
|
|
function getIcon(name, size = '18', height = null) {
|
2019-11-19 18:51:07 +00:00
|
|
|
return {
|
|
|
|
name,
|
|
|
|
render(h) {
|
|
|
|
return h(Icon, {
|
2019-12-21 14:46:50 +00:00
|
|
|
props: Object.assign(
|
|
|
|
{
|
|
|
|
name,
|
|
|
|
size,
|
|
|
|
height
|
|
|
|
},
|
|
|
|
this.$attrs
|
|
|
|
)
|
2019-11-19 18:51:07 +00:00
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2019-08-01 11:52:58 +00:00
|
|
|
export default config;
|