2018-07-15 11:41:27 +00:00
|
|
|
import frappe from 'frappejs';
|
|
|
|
import { _ } from 'frappejs/utils';
|
2019-07-16 09:14:44 +00:00
|
|
|
const path = require('path');
|
2018-06-15 15:46:14 +00:00
|
|
|
|
2018-07-15 11:41:27 +00:00
|
|
|
export default {
|
2019-07-16 09:14:44 +00:00
|
|
|
getTitle: async () => {
|
2018-07-15 11:41:27 +00:00
|
|
|
const accountingSettings = await frappe.getSingle('AccountingSettings');
|
|
|
|
return accountingSettings.companyName;
|
2018-06-04 11:00:46 +00:00
|
|
|
},
|
2019-07-16 09:14:44 +00:00
|
|
|
getDbName() {
|
|
|
|
if (localStorage.dbPath) {
|
|
|
|
const parts = localStorage.dbPath.split(path.sep);
|
|
|
|
return parts[parts.length - 1];
|
|
|
|
}
|
|
|
|
},
|
|
|
|
getGroups() {
|
|
|
|
return this.groups.map(g => g.title);
|
|
|
|
},
|
|
|
|
getItems(groupTitle) {
|
|
|
|
if (groupTitle)
|
|
|
|
return this.groups.filter(g => g.title === groupTitle)[0].items;
|
|
|
|
else return [];
|
|
|
|
},
|
2018-07-15 11:41:27 +00:00
|
|
|
groups: [
|
|
|
|
{
|
|
|
|
title: _('Masters'),
|
|
|
|
items: [
|
|
|
|
{
|
2019-07-16 09:14:44 +00:00
|
|
|
label: _('Chart Of Accounts'),
|
|
|
|
route: '/chartOfAccounts'
|
2018-07-15 11:41:27 +00:00
|
|
|
},
|
2019-07-18 10:45:44 +00:00
|
|
|
{
|
|
|
|
label: _('Accounts'),
|
|
|
|
route: '/list/Account'
|
|
|
|
},
|
2018-07-15 11:41:27 +00:00
|
|
|
{
|
2019-07-16 09:14:44 +00:00
|
|
|
label: _('Item'),
|
|
|
|
route: '/list/Item'
|
2018-07-15 11:41:27 +00:00
|
|
|
},
|
|
|
|
{
|
2019-07-16 09:14:44 +00:00
|
|
|
label: _('Customer'),
|
|
|
|
route: '/list/Customer'
|
2018-07-15 11:41:27 +00:00
|
|
|
},
|
2019-07-18 06:49:12 +00:00
|
|
|
{
|
|
|
|
label: _('Supplier'),
|
|
|
|
route: '/list/Supplier'
|
|
|
|
},
|
2018-07-15 11:41:27 +00:00
|
|
|
{
|
2019-07-16 09:14:44 +00:00
|
|
|
label: _('Tax'),
|
|
|
|
route: '/list/Tax'
|
2018-07-15 11:41:27 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
2018-09-26 14:23:53 +00:00
|
|
|
{
|
|
|
|
title: _('Transactions'),
|
|
|
|
items: [
|
|
|
|
{
|
2019-07-16 09:14:44 +00:00
|
|
|
label: _('Invoice'),
|
|
|
|
route: '/list/Invoice'
|
2018-09-26 14:23:53 +00:00
|
|
|
},
|
|
|
|
{
|
2019-07-16 09:14:44 +00:00
|
|
|
label: _('Journal Entry'),
|
|
|
|
route: '/list/JournalEntry'
|
|
|
|
},
|
|
|
|
{
|
|
|
|
label: _('Payment'),
|
|
|
|
route: '/list/Payment'
|
2018-09-26 14:23:53 +00:00
|
|
|
}
|
|
|
|
// {
|
2019-07-16 09:14:44 +00:00
|
|
|
// label: _('AccountingLedgerEntry'), route: '/list/AccountingLedgerEntry'
|
2018-09-26 14:23:53 +00:00
|
|
|
// },
|
|
|
|
]
|
|
|
|
},
|
2018-07-15 11:41:27 +00:00
|
|
|
{
|
|
|
|
title: _('Reports'),
|
|
|
|
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-07-18 06:49:12 +00:00
|
|
|
{
|
|
|
|
label: _('Trial Balance'),
|
|
|
|
route: '/report/trial-balance'
|
|
|
|
},
|
2018-09-29 07:23:46 +00:00
|
|
|
{
|
2019-07-16 09:14:44 +00:00
|
|
|
label: _('Sales Register'),
|
|
|
|
route: '/report/sales-register'
|
2019-02-18 05:42:04 +00:00
|
|
|
},
|
|
|
|
{
|
2019-07-16 09:14:44 +00:00
|
|
|
label: _('Bank Reconciliation'),
|
|
|
|
route: '/report/bank-reconciliation'
|
2019-02-18 05:42:04 +00:00
|
|
|
},
|
|
|
|
{
|
2019-07-16 09:14:44 +00:00
|
|
|
label: _('Goods and Service Tax'),
|
|
|
|
route: '/report/gst-taxes'
|
2018-07-15 11:41:27 +00:00
|
|
|
}
|
|
|
|
]
|
2018-10-10 10:32:56 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
title: _('Tools'),
|
|
|
|
items: [
|
|
|
|
{
|
2019-07-16 09:14:44 +00:00
|
|
|
label: _('Data Import'),
|
|
|
|
route: '/data-import'
|
2019-07-18 06:49:12 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
label: _('Settings'),
|
|
|
|
route: '/settings'
|
2018-10-10 10:32:56 +00:00
|
|
|
}
|
|
|
|
]
|
2018-07-15 11:41:27 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
};
|