2
0
mirror of https://github.com/frappe/books.git synced 2024-12-26 12:28:12 +00:00
books/src/sidebarConfig.js

149 lines
3.1 KiB
JavaScript
Raw Normal View History

import frappe from 'frappejs';
2020-01-02 17:06:57 +00:00
import { openSettings } from '@/utils';
import { _ } from 'frappejs/utils';
import Icon from './components/Icon';
import router from './router';
2018-06-15 15:46:14 +00:00
const config = {
2019-07-16 09:14:44 +00:00
getTitle: async () => {
const { companyName } = await frappe.getSingle('AccountingSettings');
return companyName;
2018-06-04 11:00:46 +00:00
},
groups: [
{
title: _('Get Started'),
route: '/get-started',
icon: getIcon('general', '24', '5')
},
{
title: _('Dashboard'),
route: '/',
icon: getIcon('dashboard')
},
{
title: _('Sales'),
icon: getIcon('sales'),
action() {
router.push('/list/SalesInvoice');
},
items: [
{
2020-02-03 13:58:44 +00:00
label: _('Invoices'),
route: '/list/SalesInvoice',
doctype: 'SalesInvoice'
},
{
label: _('Customers'),
route: '/list/Customer',
doctype: 'Customer'
},
2019-07-18 06:49:12 +00:00
{
label: _('Items'),
route: '/list/Item',
doctype: 'Item'
2019-07-18 06:49:12 +00:00
},
{
label: _('Journal Entry'),
route: '/list/JournalEntry',
doctype: 'JournalEntry'
}
]
},
2018-09-26 14:23:53 +00:00
{
title: _('Purchases'),
icon: getIcon('purchase'),
action() {
router.push('/list/PurchaseInvoice');
},
2018-09-26 14:23:53 +00:00
items: [
{
2020-02-03 13:58:44 +00:00
label: _('Bills'),
route: '/list/PurchaseInvoice',
doctype: 'PurchaseInvoice'
2018-09-26 14:23:53 +00:00
},
2019-07-19 13:24:31 +00:00
{
label: _('Suppliers'),
route: '/list/Supplier',
doctype: 'Supplier'
2019-07-19 13:24:31 +00:00
},
2018-09-26 14:23:53 +00:00
{
label: _('Items'),
route: '/list/Item',
doctype: 'Item'
2019-07-16 09:14:44 +00:00
},
{
label: _('Journal Entry'),
route: '/list/JournalEntry',
doctype: 'JournalEntry'
2018-09-26 14:23:53 +00:00
}
]
},
{
title: _('Reports'),
icon: getIcon('reports'),
action() {
router.push('/report/general-ledger');
},
items: [
{
2019-07-16 09:14:44 +00:00
label: _('General Ledger'),
route: '/report/general-ledger'
},
{
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-10-10 10:32:56 +00:00
},
{
2019-12-23 08:26:41 +00:00
title: _('Setup'),
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();
}
}
]
}
]
};
function getIcon(name, size = '18', height = null) {
return {
name,
render(h) {
return h(Icon, {
props: Object.assign(
{
name,
size,
height
},
this.$attrs
)
});
}
};
}
export default config;