2
0
mirror of https://github.com/frappe/books.git synced 2024-11-14 01:14:03 +00:00
books/src/sidebarConfig.js

136 lines
2.8 KiB
JavaScript
Raw Normal View History

import frappe from 'frappejs';
import { openSettings } from './pages/Settings/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: _('Dashboard'),
route: '/',
icon: getIcon('dashboard')
},
{
title: _('Sales'),
icon: getIcon('sales'),
action() {
router.push('/list/SalesInvoice');
},
items: [
{
label: _('Invoice'),
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: _('Taxes'),
route: '/list/Tax',
doctype: 'Tax'
},
{
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: [
{
label: _('Bill'),
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: _('Taxes'),
route: '/list/Tax',
doctype: 'Tax'
},
{
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
},
{
title: _('Settings'),
icon: getIcon('settings'),
2019-10-19 14:26:13 +00:00
action() {
openSettings();
2019-10-19 14:26:13 +00:00
}
}
]
};
function getIcon(name) {
return {
name,
render(h) {
return h(Icon, {
props: Object.assign({
name,
size: '18',
}, this.$attrs)
});
}
};
}
export default config;