From c2d76442696ec1254dd1c4326f20371d217ed94d Mon Sep 17 00:00:00 2001 From: akshayitzme Date: Thu, 24 Oct 2024 09:51:45 +0530 Subject: [PATCH] feat: erpnextSync settings page --- src/pages/Settings/Settings.vue | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/pages/Settings/Settings.vue b/src/pages/Settings/Settings.vue index e8932c82..9b6de3f2 100644 --- a/src/pages/Settings/Settings.vue +++ b/src/pages/Settings/Settings.vue @@ -129,6 +129,7 @@ export default defineComponent({ ModelNameEnum.InventorySettings, ModelNameEnum.Defaults, ModelNameEnum.POSSettings, + ModelNameEnum.ERPNextSyncSettings, ModelNameEnum.PrintSettings, ModelNameEnum.SystemSettings, ].some((s) => this.fyo.singles[s]?.canSave); @@ -148,6 +149,7 @@ export default defineComponent({ [ModelNameEnum.InventorySettings]: this.t`Inventory`, [ModelNameEnum.Defaults]: this.t`Defaults`, [ModelNameEnum.POSSettings]: this.t`POS Settings`, + [ModelNameEnum.ERPNextSyncSettings]: this.t`ERPNext Sync`, [ModelNameEnum.SystemSettings]: this.t`System`, }; }, @@ -156,12 +158,15 @@ export default defineComponent({ !!this.fyo.singles.AccountingSettings?.enableInventory; const enablePOS = !!this.fyo.singles.InventorySettings?.enablePointOfSale; + const enableERPNextSync = + !!this.fyo.singles.AccountingSettings?.enableERPNextSync; return [ ModelNameEnum.AccountingSettings, ModelNameEnum.InventorySettings, ModelNameEnum.Defaults, ModelNameEnum.POSSettings, + ModelNameEnum.ERPNextSyncSettings, ModelNameEnum.PrintSettings, ModelNameEnum.SystemSettings, ] @@ -173,6 +178,11 @@ export default defineComponent({ if (s === ModelNameEnum.POSSettings && !enablePOS) { return false; } + + if (s === ModelNameEnum.ERPNextSyncSettings && !enableERPNextSync) { + return false; + } + return true; }) .map((s) => this.fyo.schemaMap[s]!);