From f46c67043683cd0eae28fec6d059558bb3f03011 Mon Sep 17 00:00:00 2001 From: Dhaarani <55541808+DhaaraniCIT@users.noreply.github.com> Date: Tue, 10 Sep 2024 13:28:56 +0530 Subject: [PATCH] revert qbo code prepend changes (#945) --- .../qbo-import-setting.model.ts | 9 ++++---- .../core/services/common/mapping.service.ts | 2 +- .../qbo-dashboard/qbo-dashboard.component.ts | 2 +- .../qbo-base-mapping.component.html | 1 - .../qbo-base-mapping.component.ts | 2 +- .../qbo-clone-settings.component.html | 4 ++-- .../qbo-clone-settings.component.ts | 23 ++++++++++--------- .../qbo-export-settings.component.ts | 2 +- .../qbo-import-settings.component.html | 6 ++--- .../qbo-import-settings.component.ts | 19 +++++++-------- 10 files changed, 36 insertions(+), 34 deletions(-) diff --git a/src/app/core/models/qbo/qbo-configuration/qbo-import-setting.model.ts b/src/app/core/models/qbo/qbo-configuration/qbo-import-setting.model.ts index 97b7bf108..a1aff99bf 100644 --- a/src/app/core/models/qbo/qbo-configuration/qbo-import-setting.model.ts +++ b/src/app/core/models/qbo/qbo-configuration/qbo-import-setting.model.ts @@ -10,7 +10,7 @@ export type QBOImportSettingWorkspaceGeneralSetting = { import_vendors_as_merchants: boolean, charts_of_accounts: string[], import_tax_codes: boolean, - import_code_fields: string[] + import_code_fields?: string[] } export type QBOImportSettingGeneralMapping = { @@ -54,7 +54,8 @@ export class QBOImportSettingModel extends ImportSettingsModel { defaultTaxCode: new FormControl(importSettings?.general_mappings?.default_tax_code?.id ? importSettings.general_mappings.default_tax_code : null), searchOption: new FormControl(''), importCodeFields: new FormControl( importSettings?.workspace_general_settings?.import_code_fields ? importSettings.workspace_general_settings.import_code_fields : null), - importCategoryCode: new FormControl(this.getImportCodeField(importCode, 'ACCOUNT', qboImportCodeFieldCodeConfig)) + // ImportCategoryCode: new FormControl(this.getImportCodeField(importCode, 'ACCOUNT', qboImportCodeFieldCodeConfig)) + importCategoryCode: new FormControl(null) }); } @@ -69,8 +70,8 @@ export class QBOImportSettingModel extends ImportSettingsModel { import_items: importSettingsForm.get('importItems')?.value, charts_of_accounts: importSettingsForm.get('chartOfAccountTypes')?.value, import_tax_codes: importSettingsForm.get('taxCode')?.value, - import_vendors_as_merchants: importSettingsForm.get('importVendorsAsMerchants')?.value, - import_code_fields: importSettingsForm.get('importCodeFields')?.value + import_vendors_as_merchants: importSettingsForm.get('importVendorsAsMerchants')?.value + // Import_code_fields: importSettingsForm.get('importCodeFields')?.value }, mapping_settings: mappingSettings, general_mappings: { diff --git a/src/app/core/services/common/mapping.service.ts b/src/app/core/services/common/mapping.service.ts index 3288a0e40..5eb2ddef5 100644 --- a/src/app/core/services/common/mapping.service.ts +++ b/src/app/core/services/common/mapping.service.ts @@ -180,7 +180,7 @@ export class MappingService { }; if (value) { - if (appName && ([AppName.SAGE300, AppName.QBO] as string[]).includes(appName)) { + if (appName && ([AppName.SAGE300] as string[]).includes(appName)) { params.value = value; } else { params.value__icontains = value; diff --git a/src/app/integrations/qbo/qbo-main/qbo-dashboard/qbo-dashboard.component.ts b/src/app/integrations/qbo/qbo-main/qbo-dashboard/qbo-dashboard.component.ts index 7da93d238..bda7c3d92 100644 --- a/src/app/integrations/qbo/qbo-main/qbo-dashboard/qbo-dashboard.component.ts +++ b/src/app/integrations/qbo/qbo-main/qbo-dashboard/qbo-dashboard.component.ts @@ -142,7 +142,7 @@ export class QboDashboardComponent implements OnInit { this.isLoading = false; - this.importCodeFields = responses[6].workspace_general_settings.import_code_fields; + this.importCodeFields = responses[6].workspace_general_settings?.import_code_fields; const queuedTasks: QBOTaskLog[] = responses[2].results.filter((task: QBOTaskLog) => task.status === TaskLogState.ENQUEUED || task.status === TaskLogState.IN_PROGRESS); this.failedExpenseGroupCount = responses[2].results.filter((task: QBOTaskLog) => task.status === TaskLogState.FAILED || task.status === TaskLogState.FATAL).length; diff --git a/src/app/integrations/qbo/qbo-main/qbo-mapping/qbo-base-mapping/qbo-base-mapping.component.html b/src/app/integrations/qbo/qbo-main/qbo-mapping/qbo-base-mapping/qbo-base-mapping.component.html index 216b0bdb2..3f96e4bb3 100644 --- a/src/app/integrations/qbo/qbo-main/qbo-mapping/qbo-base-mapping/qbo-base-mapping.component.html +++ b/src/app/integrations/qbo/qbo-main/qbo-mapping/qbo-base-mapping/qbo-base-mapping.component.html @@ -8,6 +8,5 @@ [appName]="AppName.QBO" [isCategoryMappingGeneric]="sourceField === FyleField.CATEGORY ? true : false" [displayName]="displayName" - [isMultiLineOption]="sourceField === FyleField.CATEGORY && brandingConfig.brandId !== 'co' ? true : false" (triggerAutoMapEmployee)="triggerAutoMapEmployees()"> diff --git a/src/app/integrations/qbo/qbo-main/qbo-mapping/qbo-base-mapping/qbo-base-mapping.component.ts b/src/app/integrations/qbo/qbo-main/qbo-mapping/qbo-base-mapping/qbo-base-mapping.component.ts index b9a067332..d74f4e698 100644 --- a/src/app/integrations/qbo/qbo-main/qbo-mapping/qbo-base-mapping/qbo-base-mapping.component.ts +++ b/src/app/integrations/qbo/qbo-main/qbo-mapping/qbo-base-mapping/qbo-base-mapping.component.ts @@ -87,7 +87,7 @@ export class QboBaseMappingComponent implements OnInit { this.destinationField = this.getDestinationField(responses[0], responses[1].results); - this.isMultiLineOption = responses[2].workspace_general_settings.import_code_fields?.includes(this.destinationField); + // This.isMultiLineOption = responses[2].workspace_general_settings.import_code_fields?.includes(this.destinationField); if (this.destinationField === AccountingField.ACCOUNT) { this.displayName = responses[0].import_items ? `${AccountingDisplayName.ITEM},${AccountingDisplayName.ACCOUNT}` : AccountingDisplayName.ACCOUNT; diff --git a/src/app/integrations/qbo/qbo-onboarding/qbo-clone-settings/qbo-clone-settings.component.html b/src/app/integrations/qbo/qbo-onboarding/qbo-clone-settings/qbo-clone-settings.component.html index 349c78d3c..4ad329515 100644 --- a/src/app/integrations/qbo/qbo-onboarding/qbo-clone-settings/qbo-clone-settings.component.html +++ b/src/app/integrations/qbo/qbo-onboarding/qbo-clone-settings/qbo-clone-settings.component.html @@ -311,7 +311,7 @@ [tooltipText]="'By default expense will be selected. Open the dropdown to select more as per your requirements'"> -
+
diff --git a/src/app/integrations/qbo/qbo-onboarding/qbo-clone-settings/qbo-clone-settings.component.ts b/src/app/integrations/qbo/qbo-onboarding/qbo-clone-settings/qbo-clone-settings.component.ts index d11b1f590..5fb3fc039 100644 --- a/src/app/integrations/qbo/qbo-onboarding/qbo-clone-settings/qbo-clone-settings.component.ts +++ b/src/app/integrations/qbo/qbo-onboarding/qbo-clone-settings/qbo-clone-settings.component.ts @@ -359,10 +359,11 @@ export class QboCloneSettingsComponent implements OnInit { if (!isImportCategoriesEnabled) { this.importSettingForm.controls.chartOfAccountTypes.setValue(['Expense']); this.importSettingForm.controls.importCategoryCode.clearValidators(); - this.importSettingForm.controls.importCategoryCode.setValue(ImportSettingsModel.getImportCodeField(this.cloneSetting.import_settings.workspace_general_settings.import_code_fields, DefaultImportFields.ACCOUNT, this.cloneQboImportCodeFieldCodeConfig)); - } if (isImportCategoriesEnabled) { - this.helperService.markControllerAsRequired(this.importSettingForm, 'importCategoryCode'); + // This.importSettingForm.controls.importCategoryCode.setValue(ImportSettingsModel.getImportCodeField(this.cloneSetting.import_settings.workspace_general_settings.import_code_fields, DefaultImportFields.ACCOUNT, this.cloneQboImportCodeFieldCodeConfig)); } + // If (isImportCategoriesEnabled) { + // This.helperService.markControllerAsRequired(this.importSettingForm, 'importCategoryCode'); + // } }); } @@ -433,14 +434,14 @@ export class QboCloneSettingsComponent implements OnInit { this.mappingService.getFyleFields('v1'), this.qboConnectorService.getQBOCredentials(), this.configurationService.getAdditionalEmails(), - this.qboImportSettingsService.getQBOFields(), - this.qboImportSettingsService.getImportCodeFieldConfig() - ]).subscribe(([cloneSetting, destinationAttributes, fyleFieldsResponse, qboCredentials, adminEmails, qboFields, qboImportCodeFieldCodeConfig]) => { + this.qboImportSettingsService.getQBOFields() + // This.qboImportSettingsService.getImportCodeFieldConfig() + ]).subscribe(([cloneSetting, destinationAttributes, fyleFieldsResponse, qboCredentials, adminEmails, qboFields]) => { const workspaceId = +this.workspaceService.getWorkspaceId(); this.workspaceService.setWorkspaceId(cloneSetting.workspace_id); - this.qboImportSettingsService.getImportCodeFieldConfig().subscribe((cloneQboImportCodeFieldCodeConfig) => { + // This.qboImportSettingsService.getImportCodeFieldConfig().subscribe((cloneQboImportCodeFieldCodeConfig) => { this.cloneSetting = cloneSetting; this.workspaceService.setWorkspaceId(workspaceId); @@ -487,9 +488,9 @@ export class QboCloneSettingsComponent implements OnInit { if (qboCredentials && qboCredentials.country !== 'US') { this.isTaxGroupSyncAllowed = true; } - this.qboImportCodeFieldCodeConfig = qboImportCodeFieldCodeConfig; - this.cloneQboImportCodeFieldCodeConfig = cloneQboImportCodeFieldCodeConfig; - this.importSettingForm = QBOImportSettingModel.mapAPIResponseToFormGroup(cloneSetting.import_settings, this.qboFields, cloneQboImportCodeFieldCodeConfig); + // This.qboImportCodeFieldCodeConfig = qboImportCodeFieldCodeConfig; + // This.cloneQboImportCodeFieldCodeConfig = cloneQboImportCodeFieldCodeConfig; + this.importSettingForm = QBOImportSettingModel.mapAPIResponseToFormGroup(cloneSetting.import_settings, this.qboFields, this.cloneQboImportCodeFieldCodeConfig); this.fyleFields = fyleFieldsResponse; this.fyleFields.push({ attribute_type: 'custom_field', display_name: 'Create a Custom Field', is_dependent: false }); this.setupImportSettingFormWatcher(); @@ -507,7 +508,7 @@ export class QboCloneSettingsComponent implements OnInit { this.setupAdvancedSettingFormWatcher(); this.isLoading = false; - }); + // }); }); } diff --git a/src/app/integrations/qbo/qbo-shared/qbo-export-settings/qbo-export-settings.component.ts b/src/app/integrations/qbo/qbo-shared/qbo-export-settings/qbo-export-settings.component.ts index a91eecc1e..afdcc655f 100644 --- a/src/app/integrations/qbo/qbo-shared/qbo-export-settings/qbo-export-settings.component.ts +++ b/src/app/integrations/qbo/qbo-shared/qbo-export-settings/qbo-export-settings.component.ts @@ -450,7 +450,7 @@ export class QboExportSettingsComponent implements OnInit { this.helperService.setOrClearValidators(this.exportSettings.workspace_general_settings.corporate_credit_card_expenses_object, exportSettingValidatorRule.creditCardExpense, this.exportSettingForm); } - this.isMultilineOption = brandingConfig.brandId !== 'co' ? true : false; + // This.isMultilineOption = brandingConfig.brandId !== 'co' ? true : false; this.setupCustomWatchers(); diff --git a/src/app/integrations/qbo/qbo-shared/qbo-import-settings/qbo-import-settings.component.html b/src/app/integrations/qbo/qbo-shared/qbo-import-settings/qbo-import-settings.component.html index da35b4a3d..254ae176a 100644 --- a/src/app/integrations/qbo/qbo-shared/qbo-import-settings/qbo-import-settings.component.html +++ b/src/app/integrations/qbo/qbo-shared/qbo-import-settings/qbo-import-settings.component.html @@ -22,7 +22,7 @@ [iconPath]="'arrow-tail-down'"> -
+
{{brandingContent.chartOfAccountTypes}} @@ -43,7 +43,7 @@
+
diff --git a/src/app/integrations/qbo/qbo-shared/qbo-import-settings/qbo-import-settings.component.ts b/src/app/integrations/qbo/qbo-shared/qbo-import-settings/qbo-import-settings.component.ts index 3f3f2c0e8..7411d8aaa 100644 --- a/src/app/integrations/qbo/qbo-shared/qbo-import-settings/qbo-import-settings.component.ts +++ b/src/app/integrations/qbo/qbo-shared/qbo-import-settings/qbo-import-settings.component.ts @@ -152,7 +152,7 @@ export class QboImportSettingsComponent implements OnInit { this.importSettingService.postImportSettings(importSettingPayload).subscribe(() => { this.isSaveInProgress = false; this.toastService.displayToastMessage(ToastSeverity.SUCCESS, 'Import settings saved successfully'); - this.updateImportCodeFieldConfig(); + // This.updateImportCodeFieldConfig(); if (this.isOnboarding) { this.workspaceService.setOnboardingState(QBOOnboardingState.ADVANCED_CONFIGURATION); this.router.navigate([`/integrations/qbo/onboarding/advanced_settings`]); @@ -220,10 +220,11 @@ export class QboImportSettingsComponent implements OnInit { if (!isImportCategoriesEnabled) { this.importSettingForm.controls.chartOfAccountTypes.setValue(['Expense']); this.importSettingForm.controls.importCategoryCode.clearValidators(); - this.importSettingForm.controls.importCategoryCode.setValue(ImportSettingsModel.getImportCodeField(this.importSettings.workspace_general_settings.import_code_fields, DefaultImportFields.ACCOUNT, this.qboImportCodeFieldCodeConfig)); - } if (isImportCategoriesEnabled) { - this.helper.markControllerAsRequired(this.importSettingForm, 'importCategoryCode'); + // This.importSettingForm.controls.importCategoryCode.setValue(ImportSettingsModel.getImportCodeField(this.importSettings.workspace_general_settings.import_code_fields, DefaultImportFields.ACCOUNT, this.qboImportCodeFieldCodeConfig)); } + // If (isImportCategoriesEnabled) { + // This.helper.markControllerAsRequired(this.importSettingForm, 'importCategoryCode'); + // } }); } @@ -268,9 +269,9 @@ export class QboImportSettingsComponent implements OnInit { this.workspaceService.getWorkspaceGeneralSettings(), this.qboConnectorService.getQBOCredentials(), this.mappingService.getDestinationAttributes(QBOField.TAX_CODE, 'v1', 'qbo'), - this.importSettingService.getQBOFields(), - this.importSettingService.getImportCodeFieldConfig() - ]).subscribe(([importSettingsResponse, fyleFieldsResponse, workspaceGeneralSettings, qboCredentials, taxCodes, qboFields, importCodeFieldConfig]) => { + this.importSettingService.getQBOFields() + // This.importSettingService.getImportCodeFieldConfig() + ]).subscribe(([importSettingsResponse, fyleFieldsResponse, workspaceGeneralSettings, qboCredentials, taxCodes, qboFields]) => { this.qboFields = qboFields; this.importSettings = importSettingsResponse; this.workspaceGeneralSettings = workspaceGeneralSettings; @@ -281,11 +282,11 @@ export class QboImportSettingsComponent implements OnInit { this.isTaxGroupSyncAllowed = true; } - this.qboImportCodeFieldCodeConfig = importCodeFieldConfig; + // This.qboImportCodeFieldCodeConfig = importCodeFieldConfig; this.importSettingForm = QBOImportSettingModel.mapAPIResponseToFormGroup(this.importSettings, this.qboFields, this.qboImportCodeFieldCodeConfig); this.fyleFields = fyleFieldsResponse; this.fyleFields.push({ attribute_type: 'custom_field', display_name: 'Create a Custom Field', is_dependent: false }); - this.updateImportCodeFieldConfig(); + // This.updateImportCodeFieldConfig(); this.setupFormWatchers(); this.initializeCustomFieldForm(false); this.isLoading = false;