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

139 lines
3.1 KiB
JavaScript
Raw Normal View History

import frappe from 'frappejs';
2019-10-24 10:39:57 +00:00
import { remote } from 'electron';
import { _ } from 'frappejs/utils';
import DashboardIcon from './components/Icons/Dashboard';
import SalesIcon from './components/Icons/Sales';
import PurchasesIcon from './components/Icons/Purchases';
import ReportsIcon from './components/Icons/Reports';
import SettingsIcon from './components/Icons/Settings';
2019-10-24 10:39:57 +00:00
import theme from '@/theme';
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, country } = await frappe.getSingle(
'AccountingSettings'
);
// if (country === 'India') {
// config.groups[2].items.push(
// {
// label: _('GSTR 1'),
// route: '/report/gstr-1?transferType=B2B'
// },
// {
// label: _('GSTR 2'),
// route: '/report/gstr-2?transferType=B2B'
// },
// {
// label: _('GSTR 3B'),
// route: '/list/GSTR3B'
// }
// );
// }
return companyName;
2018-06-04 11:00:46 +00:00
},
groups: [
{
title: _('Dashboard'),
route: '/',
icon: DashboardIcon
},
{
title: _('Sales'),
icon: SalesIcon,
action() {
router.push('/list/SalesInvoice')
},
items: [
{
label: _('Invoice'),
route: '/list/SalesInvoice'
},
{
label: _('Payments'),
route: '/list/Payment'
},
{
label: _('Customers'),
2019-07-16 09:14:44 +00:00
route: '/list/Customer'
},
2019-07-18 06:49:12 +00:00
{
label: _('Items'),
route: '/list/Item'
2019-07-18 06:49:12 +00:00
},
{
label: _('Taxes'),
2019-07-16 09:14:44 +00:00
route: '/list/Tax'
}
]
},
2018-09-26 14:23:53 +00:00
{
title: _('Purchases'),
icon: PurchasesIcon,
action() {
router.push('/list/PurchaseInvoice')
},
2018-09-26 14:23:53 +00:00
items: [
{
label: _('Bill'),
route: '/list/PurchaseInvoice'
2018-09-26 14:23:53 +00:00
},
2019-07-19 13:24:31 +00:00
{
label: _('Suppliers'),
route: '/list/Supplier'
2019-07-19 13:24:31 +00:00
},
2018-09-26 14:23:53 +00:00
{
label: _('Items'),
route: '/list/Item'
2019-07-16 09:14:44 +00:00
},
{
label: _('Taxes'),
route: '/list/Tax'
2018-09-26 14:23:53 +00:00
}
]
},
{
title: _('Reports'),
icon: ReportsIcon,
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'),
2019-10-19 14:26:13 +00:00
icon: SettingsIcon,
action() {
2019-10-24 10:39:57 +00:00
let child = new remote.BrowserWindow({
parent: remote.getCurrentWindow(),
frame: false,
width: 460,
height: 577,
backgroundColor: theme.backgroundColor.gray['200'],
webPreferences: {
webSecurity: false,
nodeIntegration: true
}
});
child.loadURL('http://localhost:8000/#/settings');
2019-10-19 14:26:13 +00:00
}
}
]
};
export default config;