2018-07-15 11:41:27 +00:00
|
|
|
import frappe from 'frappejs';
|
2019-10-24 10:39:57 +00:00
|
|
|
import { remote } from 'electron';
|
2018-07-15 11:41:27 +00:00
|
|
|
import { _ } from 'frappejs/utils';
|
2019-10-03 13:46:12 +00:00
|
|
|
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';
|
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-08-01 11:52:58 +00:00
|
|
|
const { companyName, country } = await frappe.getSingle(
|
|
|
|
'AccountingSettings'
|
|
|
|
);
|
2019-10-03 13:46:12 +00:00
|
|
|
// 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'
|
|
|
|
// }
|
|
|
|
// );
|
|
|
|
// }
|
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-10-03 13:46:12 +00:00
|
|
|
title: _('Dashboard'),
|
|
|
|
route: '/',
|
|
|
|
icon: DashboardIcon
|
|
|
|
},
|
|
|
|
{
|
|
|
|
title: _('Sales'),
|
|
|
|
icon: SalesIcon,
|
2019-10-24 11:49:22 +00:00
|
|
|
action() {
|
|
|
|
router.push('/list/SalesInvoice')
|
|
|
|
},
|
2018-07-15 11:41:27 +00:00
|
|
|
items: [
|
|
|
|
{
|
2019-10-03 13:46:12 +00:00
|
|
|
label: _('Invoice'),
|
|
|
|
route: '/list/SalesInvoice'
|
2018-07-15 11:41:27 +00:00
|
|
|
},
|
2019-10-29 20:53:19 +00:00
|
|
|
{
|
|
|
|
label: _('Payments'),
|
|
|
|
route: '/list/Payment'
|
|
|
|
},
|
2018-07-15 11:41:27 +00:00
|
|
|
{
|
2019-10-03 13:46:12 +00:00
|
|
|
label: _('Customers'),
|
2019-07-16 09:14:44 +00:00
|
|
|
route: '/list/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'),
|
|
|
|
route: '/list/Item'
|
2019-07-18 06:49:12 +00:00
|
|
|
},
|
2018-07-15 11:41:27 +00:00
|
|
|
{
|
2019-10-03 13:46:12 +00:00
|
|
|
label: _('Taxes'),
|
2019-07-16 09:14:44 +00:00
|
|
|
route: '/list/Tax'
|
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'),
|
|
|
|
icon: PurchasesIcon,
|
2019-10-24 11:49:22 +00:00
|
|
|
action() {
|
|
|
|
router.push('/list/PurchaseInvoice')
|
|
|
|
},
|
2018-09-26 14:23:53 +00:00
|
|
|
items: [
|
|
|
|
{
|
2019-10-03 13:46:12 +00:00
|
|
|
label: _('Bill'),
|
|
|
|
route: '/list/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'),
|
|
|
|
route: '/list/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'),
|
|
|
|
route: '/list/Item'
|
2019-07-16 09:14:44 +00:00
|
|
|
},
|
|
|
|
{
|
2019-10-03 13:46:12 +00:00
|
|
|
label: _('Taxes'),
|
|
|
|
route: '/list/Tax'
|
2018-09-26 14:23:53 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2018-07-15 11:41:27 +00:00
|
|
|
{
|
|
|
|
title: _('Reports'),
|
2019-10-03 13:46:12 +00:00
|
|
|
icon: ReportsIcon,
|
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-10-03 13:46:12 +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
|
|
|
}
|
2018-07-15 11:41:27 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|
2019-08-01 11:52:58 +00:00
|
|
|
|
|
|
|
export default config;
|