Skip to content

Commit

Permalink
fix: hide card number and employee name as options for memo field (#1123
Browse files Browse the repository at this point in the history
)

* fix: hide card number and employee name as options for memo field

* updated conditions

* fix lint
  • Loading branch information
anishfyle committed Dec 13, 2024
1 parent 20171dc commit 025b4c6
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/app/core/models/common/advanced-settings.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ExportSettingGet } from "../intacct/intacct-configuration/export-settin
import { QBOExportSettingGet } from "../qbo/qbo-configuration/qbo-export-setting.model";
import { NetSuiteExportSettingGet } from "../netsuite/netsuite-configuration/netsuite-export-setting.model";
import { IntacctConfiguration } from "../db/configuration.model";

import { brandingConfig } from 'src/app/branding/branding-config';
export type EmailOption = {
email: string;
name: string;
Expand Down Expand Up @@ -87,11 +87,14 @@ export class AdvancedSettingsModel {
} 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', 'quickbooks online', 'sage intacct'].includes(appName.toLowerCase())) {
return defaultOptions; // Allow all options including 'card_number'

if (brandingConfig.brandId === 'co') {
return defaultOptions.filter(option => option !== 'card_number' && option !== 'employee_name');
}
return defaultOptions.filter(option => option !== 'card_number'); // Omit 'card_number' for other apps
if (cccExportType && ['netsuite', 'quickbooks online', 'sage intacct'].includes(appName.toLowerCase()) && brandingConfig.brandId === 'fyle') {
return defaultOptions;
}
return defaultOptions.filter(option => option !== 'card_number');

}

Expand Down

0 comments on commit 025b4c6

Please sign in to comment.