From aabe8c5315229e412e55dac33a02319a10f4ed28 Mon Sep 17 00:00:00 2001 From: anishfyle Date: Wed, 11 Dec 2024 12:28:44 +0530 Subject: [PATCH] fix: card num in memo --- .../core/models/common/advanced-settings.model.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/app/core/models/common/advanced-settings.model.ts b/src/app/core/models/common/advanced-settings.model.ts index 55e91e272..ee8eab5c6 100644 --- a/src/app/core/models/common/advanced-settings.model.ts +++ b/src/app/core/models/common/advanced-settings.model.ts @@ -78,14 +78,16 @@ export class AdvancedSettingsModel { static getMemoOptions(exportSettings: ExportSettingGet | NetSuiteExportSettingGet | QBOExportSettingGet, appName: string): string[] { const defaultOptions = this.getDefaultMemoOptions(); let cccExportType: string | undefined; - - // Extract cccExportType based on the type of exportSettings + // Handle both configurations and configuration properties if ('configurations' in exportSettings) { - cccExportType = exportSettings.configurations.corporate_credit_card_expenses_object ?? undefined; + cccExportType = exportSettings.configurations?.corporate_credit_card_expenses_object ?? undefined; + } else if ('configuration' in exportSettings) { + cccExportType = exportSettings.configuration?.corporate_credit_card_expenses_object ?? undefined; + } else if ('workspace_general_settings' in exportSettings) { + cccExportType = exportSettings.workspace_general_settings?.corporate_credit_card_expenses_object ?? undefined; } - // Filter out options based on cccExportType and appName - if (cccExportType && ['netsuite', 'qbo', 'sage intacct'].includes(appName.toLowerCase())) { + if (cccExportType) { return defaultOptions; // Allow all options including 'card_number' } return defaultOptions.filter(option => option !== 'card_number'); // Omit 'card_number' for other apps