Skip to content

Commit

Permalink
fix: employee mapping field not populating on page load (#1165)
Browse files Browse the repository at this point in the history
* fix: employee mapping field not populating on page load

* fix: remove unused variable and fix employeeFieldMapping init

(cherry picked from commit 2fe9a46)
  • Loading branch information
JustARatherRidiculouslyLongUsername committed Jan 24, 2025
1 parent 544614b commit 5d5e784
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ export class QboExportSettingsComponent implements OnInit {

isImportItemsEnabled: boolean;

reimbursableExportTypes: SelectFormOption[];

creditCardExportTypes = QBOExportSettingModel.getCreditCardExportTypes();

cccExpenseStateOptions = QBOExportSettingModel.getCCCExpenseStateOptions();
Expand Down Expand Up @@ -498,7 +496,7 @@ return of(null);
]).subscribe(([exportSetting, workspaceGeneralSettings, destinationAttributes, bankAccounts, cccAccounts, accountsPayables, vendors]) => {

this.exportSettings = exportSetting;
this.employeeFieldMapping = workspaceGeneralSettings?.employee_field_mapping || EmployeeFieldMapping.EMPLOYEE;
this.employeeFieldMapping = workspaceGeneralSettings?.employee_field_mapping;
this.setLiveEntityExample(destinationAttributes);
this.bankAccounts = bankAccounts.results.map((option) => QBOExportSettingModel.formatGeneralMappingPayload(option));
this.cccAccounts = cccAccounts.results.map((option) => QBOExportSettingModel.formatGeneralMappingPayload(option));
Expand All @@ -508,13 +506,12 @@ return of(null);

this.isImportItemsEnabled = workspaceGeneralSettings?.import_items || false;

this.reimbursableExportTypes = QBOExportSettingModel.getReimbursableExportTypeOptions(this.employeeFieldMapping);
this.showNameInJournalOption = this.exportSettings.workspace_general_settings?.corporate_credit_card_expenses_object === QBOCorporateCreditCardExpensesObject.JOURNAL_ENTRY ? true : false;

this.addMissingOptions();
this.exportSettingForm = QBOExportSettingModel.mapAPIResponseToFormGroup(this.exportSettings, this.employeeFieldMapping);
this.employeeSettingForm = QBOExportSettingModel.createEmployeeSettingsForm(
this.existingEmployeeFieldMapping,
this.employeeFieldMapping,
workspaceGeneralSettings?.auto_map_employees || false
);
if (!this.brandingFeatureConfig.featureFlags.exportSettings.reimbursableExpenses) {
Expand Down

0 comments on commit 5d5e784

Please sign in to comment.