From 6dd0a7c2ad1d29700b8f49f2fdb8068e39901db5 Mon Sep 17 00:00:00 2001 From: Viswas Haridas <37623357+JustARatherRidiculouslyLongUsername@users.noreply.github.com> Date: Thu, 12 Dec 2024 17:07:19 +0530 Subject: [PATCH] fix: business central beta bugfixes (#1122) * fix: initialize chart of accounts multiselect when there is no api response (#1110) * fix: remove the posted at date option for ccc expenses grouped by report (#1105) * fix: update login error flow and fix redirect url (#1117) * fix: restrict JE modules to group by expense only (#1113) * fix: restrict JE modules to group by expense only * fix: add a default bank account field for CCC expenses (#1114) * fix: remove validation temporarily (#1111) * fix: add a default bank account field for CCC expenses * fix: add missing options to bank accounts on page init * fix: dynamic content for xero customize settings (#1112) * fix: update sublabel key to avoid build fail (#1116) * fix: Prod fixes of QBD direct (#1118) * fix bugs (#1119) * refactor: capitalization * fix: only ccc exports not being saved (#1121) --------- Co-authored-by: Ashwin Thanaraj <37061471+ashwin1111@users.noreply.github.com> Co-authored-by: Nilesh Pant <58652823+NileshPant1999@users.noreply.github.com> Co-authored-by: Dhaarani <55541808+DhaaraniCIT@users.noreply.github.com> Co-authored-by: Anish Kr Singh <116036738+anishfyle@users.noreply.github.com> --------- Co-authored-by: Ashwin Thanaraj <37061471+ashwin1111@users.noreply.github.com> Co-authored-by: Nilesh Pant <58652823+NileshPant1999@users.noreply.github.com> Co-authored-by: Dhaarani <55541808+DhaaraniCIT@users.noreply.github.com> Co-authored-by: Anish Kr Singh <116036738+anishfyle@users.noreply.github.com> --------- Co-authored-by: Ashwin Thanaraj <37061471+ashwin1111@users.noreply.github.com> Co-authored-by: Nilesh Pant <58652823+NileshPant1999@users.noreply.github.com> Co-authored-by: Dhaarani <55541808+DhaaraniCIT@users.noreply.github.com> Co-authored-by: Anish Kr Singh <116036738+anishfyle@users.noreply.github.com> --- .../business-central-export-setting.model.ts | 5 ++ .../business-central-import-settings.model.ts | 2 +- src/app/core/models/enum/enum.model.ts | 3 +- ...-central-onboarding-landing.component.html | 6 +- ...ss-central-onboarding-landing.component.ts | 8 +- ...ess-central-export-settings.component.html | 18 +++-- ...iness-central-export-settings.component.ts | 78 +++++++++++++------ .../business-central.fixture.ts | 2 + 8 files changed, 82 insertions(+), 40 deletions(-) diff --git a/src/app/core/models/business-central/business-central-configuration/business-central-export-setting.model.ts b/src/app/core/models/business-central/business-central-configuration/business-central-export-setting.model.ts index 6fca3f7e9..d809fe8f8 100644 --- a/src/app/core/models/business-central/business-central-configuration/business-central-export-setting.model.ts +++ b/src/app/core/models/business-central/business-central-configuration/business-central-export-setting.model.ts @@ -15,6 +15,8 @@ export type BusinessCentralExportSetting = { credit_card_expense_date: ExportDateType, default_bank_account_name: string, default_bank_account_id: string, + default_ccc_bank_account_name: string, + default_ccc_bank_account_id: string, name_in_journal_entry: string, employee_field_mapping: string, auto_map_employees: string, @@ -184,6 +186,7 @@ export class BusinessCentralExportSettingModel { cccExportDate: new FormControl(exportSettings?.credit_card_expense_date ? exportSettings?.credit_card_expense_date.toLowerCase() : null), cccExportGroup: new FormControl(exportSettings?.credit_card_expense_grouped_by ? exportSettings?.credit_card_expense_grouped_by: null), defaultBankName: new FormControl(exportSettings?.default_bank_account_name ? findObjectByDestinationId(accounts, exportSettings?.default_bank_account_id) : null), + cccDefaultBankName: new FormControl(exportSettings?.default_ccc_bank_account_name ? findObjectByDestinationId(accounts, exportSettings?.default_ccc_bank_account_id) : null), reimbursableEmployeeMapping: new FormControl(exportSettings?.employee_field_mapping ? exportSettings?.employee_field_mapping : null, Validators.required), journalEntryNamePreference: new FormControl(exportSettings?.name_in_journal_entry ? exportSettings?.name_in_journal_entry : null), autoMapEmployee: new FormControl(exportSettings?.auto_map_employees ? exportSettings?.auto_map_employees : null), @@ -204,6 +207,8 @@ export class BusinessCentralExportSettingModel { credit_card_expense_date: exportSettingsForm.get('cccExportDate')?.value ? exportSettingsForm.get('cccExportDate')?.value.toUpperCase() : null, default_bank_account_name: exportSettingsForm.get('defaultBankName')?.value ? exportSettingsForm.get('defaultBankName')?.value.value : null, default_bank_account_id: exportSettingsForm.get('defaultBankName')?.value ? exportSettingsForm.get('defaultBankName')?.value.destination_id : null, + default_ccc_bank_account_name: exportSettingsForm.get('cccDefaultBankName')?.value ? exportSettingsForm.get('cccDefaultBankName')?.value.value : null, + default_ccc_bank_account_id: exportSettingsForm.get('cccDefaultBankName')?.value ? exportSettingsForm.get('cccDefaultBankName')?.value.destination_id : null, name_in_journal_entry: exportSettingsForm.get('journalEntryNamePreference')?.value ? exportSettingsForm.get('journalEntryNamePreference')?.value : null, employee_field_mapping: exportSettingsForm.get('reimbursableEmployeeMapping')?.value ? exportSettingsForm.get('reimbursableEmployeeMapping')?.value : null, auto_map_employees: exportSettingsForm.get('autoMapEmployee')?.value ? exportSettingsForm.get('autoMapEmployee')?.value : null, diff --git a/src/app/core/models/business-central/business-central-configuration/business-central-import-settings.model.ts b/src/app/core/models/business-central/business-central-configuration/business-central-import-settings.model.ts index 4a149bc2c..cc92f71c7 100644 --- a/src/app/core/models/business-central/business-central-configuration/business-central-import-settings.model.ts +++ b/src/app/core/models/business-central/business-central-configuration/business-central-import-settings.model.ts @@ -26,7 +26,7 @@ export class BusinessCentralImportSettingsModel extends ImportSettingsModel { const expenseFieldsArray = importSettings?.mapping_settings ? this.constructFormArray(importSettings.mapping_settings, businessCentralFields) : [] ; return new FormGroup({ importCategories: new FormControl(importSettings?.import_settings?.import_categories ?? false), - chartOfAccountTypes: new FormControl(importSettings?.import_settings.charts_of_accounts ? importSettings?.import_settings.charts_of_accounts : ['Expense']), + chartOfAccountTypes: new FormControl(importSettings?.import_settings?.charts_of_accounts ? importSettings?.import_settings?.charts_of_accounts : ['Expense']), importVendorAsMerchant: new FormControl(importSettings?.import_settings?.import_vendors_as_merchants ?? false ), expenseFields: new FormArray(expenseFieldsArray) }); diff --git a/src/app/core/models/enum/enum.model.ts b/src/app/core/models/enum/enum.model.ts index 861f6cf26..5104c7f28 100644 --- a/src/app/core/models/enum/enum.model.ts +++ b/src/app/core/models/enum/enum.model.ts @@ -702,9 +702,8 @@ export enum Sage300ExportSettingDestinationOptionKey { } export enum BCExportSettingDestinationOptionKey { - ACCOUNT = 'ACCOUNT', VENDOR = 'VENDOR', - REIMBURSABLE_BANK_ACCOUNT = 'REIMBURSABLE_BANK_ACCOUNT' + BANK_ACCOUNT = 'BANK_ACCOUNT' } export enum QbdDirectExportSettingDestinationOptionKey { diff --git a/src/app/integrations/business-central/business-central-onboarding/business-central-onboarding-landing/business-central-onboarding-landing.component.html b/src/app/integrations/business-central/business-central-onboarding/business-central-onboarding-landing/business-central-onboarding-landing.component.html index a8428cf09..264ebdc7a 100644 --- a/src/app/integrations/business-central/business-central-onboarding/business-central-onboarding-landing/business-central-onboarding-landing.component.html +++ b/src/app/integrations/business-central/business-central-onboarding/business-central-onboarding-landing/business-central-onboarding-landing.component.html @@ -1,4 +1,4 @@ -