diff --git a/ayanova/src/api/initialize.js b/ayanova/src/api/initialize.js index 8f09593d..ce2ee74d 100644 --- a/ayanova/src/api/initialize.js +++ b/ayanova/src/api/initialize.js @@ -24,9 +24,10 @@ function initNavPanel() { let key = 0; let sub = []; - let t = window.$gz.translation.get; - let role = window.$gz.role.AUTHORIZATION_ROLES; + // let t = window.$gz.translation.get; + // let role = window.$gz.role.AUTHORIZATION_ROLES; let licenseState = window.$gz.store.state.globalSettings.licenseStatus; + let useInventory = window.$gz.store.state.globalSettings.useInventory; /*Service = 1, NotService = 2, Customer = 3, @@ -385,7 +386,7 @@ function initNavPanel() { } //INVENTORY - if (window.$gz.role.canOpen(window.$gz.type.Part)) { + if (useInventory && window.$gz.role.canOpen(window.$gz.type.PartInventory)) { sub.push({ title: "PartInventoryList", icon: "$ayiPallet", @@ -395,7 +396,10 @@ function initNavPanel() { } //PART REQUESTS - if (window.$gz.role.canOpen(window.$gz.type.WorkOrderItemPartRequest)) { + if ( + useInventory && + window.$gz.role.canOpen(window.$gz.type.WorkOrderItemPartRequest) + ) { sub.push({ title: "WorkOrderItemPartRequestList", icon: "$ayiPaperPlane", @@ -405,7 +409,7 @@ function initNavPanel() { } //PURCHASE ORDERS - if (window.$gz.role.canOpen(window.$gz.type.PurchaseOrder)) { + if (useInventory && window.$gz.role.canOpen(window.$gz.type.PurchaseOrder)) { sub.push({ title: "InventoryPurchaseOrders", icon: "$ayiShippingFast", @@ -415,31 +419,43 @@ function initNavPanel() { //NOTE: V7 HAD POITEMS, THAT MAY BE AN ANACHRONISM NOW SO NOT PUTTING HERE - //PURCHASE ORDER RECEIPTS - sub.push({ - title: "InventoryPurchaseOrderReceipts", - icon: "$ayiDollyFlatbed", - route: "/inv-purchase-order-receipts", - key: key++ - }); + //PURCHASE ORDER RECEIPTS -- DEPRECATED, just haven't removed yet until get to PO's + if (useInventory) { + sub.push({ + title: "InventoryPurchaseOrderReceipts", + icon: "$ayiDollyFlatbed", + route: "/inv-purchase-order-receipts", + key: key++ + }); + } //NOTE: V7 HAD PORECEIPTITEMS, THAT MAY BE AN ANACHRONISM NOW SO NOT PUTTING HERE //ADJUSTMENTS - sub.push({ - title: "PartInventoryTransactionList", - icon: "$ayiDolly", - route: "/inv-part-inventory-transactions", - key: key++ - }); + if ( + useInventory && + window.$gz.role.canOpen(window.$gz.type.PartInventory) + ) { + sub.push({ + title: "PartInventoryTransactionList", + icon: "$ayiDolly", + route: "/inv-part-inventory-transactions", + key: key++ + }); + } //WAREHOUSES - sub.push({ - title: "PartWarehouseList", - icon: "$ayiWarehouse", - route: "/inv-part-warehouses", - key: key++ - }); + if ( + useInventory && + window.$gz.role.canOpen(window.$gz.type.PartWarehouse) + ) { + sub.push({ + title: "PartWarehouseList", + icon: "$ayiWarehouse", + route: "/inv-part-warehouses", + key: key++ + }); + } } //**** INVENTORY (TOP GROUP)