Skip to content

Commit

Permalink
fix: card num in memo
Browse files Browse the repository at this point in the history
  • Loading branch information
anishfyle committed Dec 11, 2024
1 parent 984aacb commit aabe8c5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/app/core/models/common/advanced-settings.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit aabe8c5

Please sign in to comment.