mirror of
https://github.com/frappe/books.git
synced 2025-02-04 13:08:29 +00:00
Added ability to hide and show side bar items
This commit is contained in:
parent
b44b651695
commit
4efe6552f9
@ -52,6 +52,7 @@
|
|||||||
<div v-if="group.items && isActiveGroup(group)">
|
<div v-if="group.items && isActiveGroup(group)">
|
||||||
<div
|
<div
|
||||||
v-for="item in group.items"
|
v-for="item in group.items"
|
||||||
|
v-show="item.visible"
|
||||||
:key="item.label"
|
:key="item.label"
|
||||||
class="
|
class="
|
||||||
mt-1
|
mt-1
|
||||||
@ -114,7 +115,6 @@ export default {
|
|||||||
},
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
this.companyName = await sidebarConfig.getTitle();
|
this.companyName = await sidebarConfig.getTitle();
|
||||||
const { country } = await frappe.getSingle('AccountingSettings');
|
|
||||||
this.groups = sidebarConfig.groups.filter((group) => {
|
this.groups = sidebarConfig.groups.filter((group) => {
|
||||||
if (
|
if (
|
||||||
group.route === '/get-started' &&
|
group.route === '/get-started' &&
|
||||||
@ -125,16 +125,6 @@ export default {
|
|||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
if (country !== 'India') {
|
|
||||||
this.groups.forEach((group) => {
|
|
||||||
if (group.title === 'Reports') {
|
|
||||||
group.items = group.items.filter(
|
|
||||||
(item) => !item.label.toLowerCase().includes('gst')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
this.setActiveGroup();
|
this.setActiveGroup();
|
||||||
router.afterEach(() => {
|
router.afterEach(() => {
|
||||||
this.setActiveGroup();
|
this.setActiveGroup();
|
||||||
|
@ -27,11 +27,13 @@ const config = {
|
|||||||
label: _('Invoices'),
|
label: _('Invoices'),
|
||||||
route: '/list/SalesInvoice',
|
route: '/list/SalesInvoice',
|
||||||
doctype: 'SalesInvoice',
|
doctype: 'SalesInvoice',
|
||||||
|
visible: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: _('Customers'),
|
label: _('Customers'),
|
||||||
route: '/list/Customer',
|
route: '/list/Customer',
|
||||||
doctype: 'Customer',
|
doctype: 'Customer',
|
||||||
|
visible: 1,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -44,11 +46,13 @@ const config = {
|
|||||||
label: _('Bills'),
|
label: _('Bills'),
|
||||||
route: '/list/PurchaseInvoice',
|
route: '/list/PurchaseInvoice',
|
||||||
doctype: 'PurchaseInvoice',
|
doctype: 'PurchaseInvoice',
|
||||||
|
visible: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: _('Suppliers'),
|
label: _('Suppliers'),
|
||||||
route: '/list/Supplier',
|
route: '/list/Supplier',
|
||||||
doctype: 'Supplier',
|
doctype: 'Supplier',
|
||||||
|
visible: 1,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -61,16 +65,19 @@ const config = {
|
|||||||
label: _('Items'),
|
label: _('Items'),
|
||||||
route: '/list/Item',
|
route: '/list/Item',
|
||||||
doctype: 'Item',
|
doctype: 'Item',
|
||||||
|
visible: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: _('Payments'),
|
label: _('Payments'),
|
||||||
route: '/list/Payment',
|
route: '/list/Payment',
|
||||||
doctype: 'Payment',
|
doctype: 'Payment',
|
||||||
|
visible: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: _('Journal Entry'),
|
label: _('Journal Entry'),
|
||||||
route: '/list/JournalEntry',
|
route: '/list/JournalEntry',
|
||||||
doctype: 'JournalEntry',
|
doctype: 'JournalEntry',
|
||||||
|
visible: 1,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -82,26 +89,40 @@ const config = {
|
|||||||
{
|
{
|
||||||
label: _('General Ledger'),
|
label: _('General Ledger'),
|
||||||
route: '/report/general-ledger',
|
route: '/report/general-ledger',
|
||||||
|
visible: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: _('Profit And Loss'),
|
label: _('Profit And Loss'),
|
||||||
route: '/report/profit-and-loss',
|
route: '/report/profit-and-loss',
|
||||||
|
visible: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: _('Balance Sheet'),
|
label: _('Balance Sheet'),
|
||||||
route: '/report/balance-sheet',
|
route: '/report/balance-sheet',
|
||||||
|
visible: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: _('Trial Balance'),
|
label: _('Trial Balance'),
|
||||||
route: '/report/trial-balance',
|
route: '/report/trial-balance',
|
||||||
|
visible: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: _('GSTR1'),
|
label: _('GSTR1'),
|
||||||
route: '/report/gstr-1',
|
route: '/report/gstr-1',
|
||||||
|
visible: async () => {
|
||||||
|
const { country } = await frappe.getSingle('AccountingSettings');
|
||||||
|
if (country === 'India') return 1;
|
||||||
|
return 0;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: _('GSTR2'),
|
label: _('GSTR2'),
|
||||||
route: '/report/gstr-2',
|
route: '/report/gstr-2',
|
||||||
|
visible: async () => {
|
||||||
|
const { country } = await frappe.getSingle('AccountingSettings');
|
||||||
|
if (country === 'India') return 1;
|
||||||
|
return 0;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -113,15 +134,18 @@ const config = {
|
|||||||
{
|
{
|
||||||
label: _('Chart of Accounts'),
|
label: _('Chart of Accounts'),
|
||||||
route: '/chart-of-accounts',
|
route: '/chart-of-accounts',
|
||||||
|
visible: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: _('Taxes'),
|
label: _('Taxes'),
|
||||||
route: '/list/Tax',
|
route: '/list/Tax',
|
||||||
doctype: 'Tax',
|
doctype: 'Tax',
|
||||||
|
visible: 1,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: _('Settings'),
|
label: _('Settings'),
|
||||||
route: '/settings',
|
route: '/settings',
|
||||||
|
visible: 1,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user