Skip to content

Commit

Permalink
Prod fixes of QBD direct
Browse files Browse the repository at this point in the history
  • Loading branch information
DhaaraniCIT committed Dec 12, 2024
1 parent 2f342c0 commit 7b671c9
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 34 deletions.
11 changes: 0 additions & 11 deletions commits.tsv

This file was deleted.

2 changes: 0 additions & 2 deletions src/app/branding/c1-branding-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,7 @@ export const c1KbArticles: KbArticle[string] = {
IMPORT_SETTING: `${brandingConfig.helpArticleDomain}/en/articles/9082146-configure-the-capital-one-sage-intacct-integration#h_78e1747002`,
EXPORT_SETTING: `${brandingConfig.helpArticleDomain}/en/articles/9082146-configure-the-capital-one-sage-intacct-integration#h_eebe5df4b7`,
ADVANCED_SETTING: `${brandingConfig.helpArticleDomain}/en/articles/9082146-configure-the-capital-one-sage-intacct-integration#h_498f2acc61`,
LANDING: `${brandingConfig.helpArticleDomain}/en/articles/9082146-configure-the-capital-one-sage-intacct-integration`,
CONNECTOR: `${brandingConfig.helpArticleDomain}/en/articles/9081356-generate-credentials-to-connect-with-sage-intacct`,
SKIP_EXPORT: `${brandingConfig.helpArticleDomain}/en/articles/9082146-configure-the-capital-one-sage-intacct-integration`,
HELPER_ARTICLE: `${brandingConfig.helpArticleDomain}/en/articles/7882821-how-to-skip-exporting-specific-expenses-from-fyle-to-sage-intacct`
}
}
Expand Down
12 changes: 5 additions & 7 deletions src/app/branding/fyle-branding-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const fyleKbArticles: KbArticle[string] = {
SAGE300: `${brandingConfig.helpArticleDomain}/en/articles/8948413-how-to-set-up-the-fyle-sage-300-cre-integration`,
BUSINESS_CENTRAL: `${brandingConfig.helpArticleDomain}/en/articles/8911018-how-to-configure-the-fyle-dynamics-365-business-central-integration`,
XERO: `${brandingConfig.helpArticleDomain}/en/articles/6721333-how-to-set-up-the-fyle-xero-integration`,
QBD_DIRECT: `${brandingConfig.helpArticleDomain}/en/collections/215867-integrations-with-fyle#quickbooks-desktop`
QBD_DIRECT: `${brandingConfig.helpArticleDomain}/en/articles/10259583-quickbooks-desktop-integration-beta`
},
onboardingArticles: {
INTACCT: {
Expand Down Expand Up @@ -126,12 +126,10 @@ export const fyleKbArticles: KbArticle[string] = {
ADVANCED_SETTING: `${brandingConfig.helpArticleDomain}/en/articles/6721333-how-to-set-up-the-fyle-xero-integration#h_d95b791edd`
},
QBD_DIRECT: {
IMPORT_SETTING: `${brandingConfig.helpArticleDomain}/en/articles/8394683-how-to-configure-the-fyle-sage-intacct-integration#h_85f929716c`,
EXPORT_SETTING: `${brandingConfig.helpArticleDomain}/en/articles/8394683-how-to-configure-the-fyle-sage-intacct-integration#h_6492c5038d`,
ADVANCED_SETTING: `${brandingConfig.helpArticleDomain}/en/articles/8394683-how-to-configure-the-fyle-sage-intacct-integration#h_3f6718633c`,
LANDING: `${brandingConfig.helpArticleDomain}/en/articles/8394683-how-to-configure-the-fyle-sage-intacct-integration`,
CONNECTOR: `${brandingConfig.helpArticleDomain}/en/articles/8394683-how-to-configure-the-fyle-sage-intacct-integration#h_38e0c9bea6`,
SKIP_EXPORT: `${brandingConfig.helpArticleDomain}/en/articles/7882821-how-to-skip-exporting-specific-expenses-from-fyle-to-sage-intacct`,
IMPORT_SETTING: `${brandingConfig.helpArticleDomain}/en/articles/10259583-quickbooks-desktop-integration-beta#h_a170c7d562`,
EXPORT_SETTING: `${brandingConfig.helpArticleDomain}/en/articles/10259583-quickbooks-desktop-integration-beta#h_1366df4107`,
ADVANCED_SETTING: `${brandingConfig.helpArticleDomain}/en/articles/10259583-quickbooks-desktop-integration-beta#h_b3850646c0`,
CONNECTOR: `${brandingConfig.helpArticleDomain}/en/articles/10259583-quickbooks-desktop-integration-beta#h_d3cc42849a`,
HELPER_ARTICLE: `${brandingConfig.helpArticleDomain}/en/articles/7882821-how-to-skip-exporting-specific-expenses-from-fyle-to-sage-intacct`
}
}
Expand Down
2 changes: 0 additions & 2 deletions src/app/core/models/branding/kb-article.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ export type KbArticle = {
IMPORT_SETTING: string;
EXPORT_SETTING: string;
ADVANCED_SETTING: string;
LANDING: string;
CONNECTOR: string;
SKIP_EXPORT: string;
HELPER_ARTICLE: string;
},
INTACCT: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { DestinationFieldMap, DashboardModel } from 'src/app/core/models/db/dash
import { AccountingGroupedErrors, AccountingGroupedErrorStat, Error, ErrorResponse } from 'src/app/core/models/db/error.model';
import { AppName, AccountingErrorType, QbdDirectTaskLogType, ReimbursableImportState, CCCImportState, AppUrl, TaskLogState } from 'src/app/core/models/enum/enum.model';
import { QbdDirectTaskResponse, QbdDirectTaskLog } from 'src/app/core/models/qbd-direct/db/qbd-direct-task-log.model';
import { QbdDirectImportSettingModel } from 'src/app/core/models/qbd-direct/qbd-direct-configuration/qbd-direct-import-settings.model';
import { AccountingExportService } from 'src/app/core/services/common/accounting-export.service';
import { DashboardService } from 'src/app/core/services/common/dashboard.service';
import { WorkspaceService } from 'src/app/core/services/common/workspace.service';
Expand Down Expand Up @@ -151,7 +152,7 @@ export class QbdDirectDashboardComponent implements OnInit {

this.importCodeFields = responses[5].import_settings?.import_code_fields;

this.chartOfAccounts = responses[5].import_settings.chart_of_accounts;
this.chartOfAccounts = responses[5].import_settings.import_account_as_category ? responses[5].import_settings.chart_of_accounts : QbdDirectImportSettingModel.getChartOfAccountTypesList();

const queuedTasks: QbdDirectTaskLog[] = responses[2].results.filter((task: QbdDirectTaskLog) => this.exportLogProcessingStates.includes(task.status));
this.failedExpenseGroupCount = responses[2].results.filter((task: QbdDirectTaskLog) => task.status === TaskLogState.ERROR || task.status === TaskLogState.FATAL).length;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { MappingSetting } from 'src/app/core/models/db/mapping-setting.model';
import { FyleField, AppName, AccountingField, QBDReimbursableExpensesObject, QBDCorporateCreditCardExpensesObject, NameInJournalEntry } from 'src/app/core/models/enum/enum.model';
import { QbdDirectDestinationAttribute } from 'src/app/core/models/qbd-direct/db/qbd-direct-destination-attribuite.model';
import { QbdDirectExportSettingGet } from 'src/app/core/models/qbd-direct/qbd-direct-configuration/qbd-direct-export-settings.model';
import { QbdDirectImportSettingModel } from 'src/app/core/models/qbd-direct/qbd-direct-configuration/qbd-direct-import-settings.model';
import { IntegrationsToastService } from 'src/app/core/services/common/integrations-toast.service';
import { MappingService } from 'src/app/core/services/common/mapping.service';
import { WorkspaceService } from 'src/app/core/services/common/workspace.service';
Expand Down Expand Up @@ -106,7 +107,7 @@ export class QbdDirectBaseMappingComponent implements OnInit {
this.cccExpenseObject = responses[0].credit_card_expense_export_type;
this.employeeFieldMapping = (responses[0].employee_field_mapping as unknown as FyleField);
this.nameInJE = responses[0].name_in_journal_entry;
this.chartOfAccounts = responses[1].import_settings.chart_of_accounts;
this.chartOfAccounts = responses[1].import_settings.import_account_as_category ? responses[1].import_settings.chart_of_accounts : QbdDirectImportSettingModel.getChartOfAccountTypesList();

this.destinationField = this.getDestinationField(responses[0], responses[2].results);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ export class QbdDirectOnboardingConnectorComponent implements OnInit {
) { }

triggerDownload(filePath: string) {
const normalizedPath = filePath.replace(/\\\\/g, "\\");
const filePathRegex = /^(\/?|\.?\/?|[a-zA-Z]:\\)([a-zA-Z0-9_-]+[\\/])*[a-zA-Z0-9 _-]+\.qbw$/;
this.isCompanyPathInvalid = filePathRegex.test(normalizedPath);
// No empty input test, test for non whitespaces like spaces, tabs, etc.
const filePathRegex = /^\s*\S.*$/;
this.isCompanyPathInvalid = filePathRegex.test(filePath);
this.isDownloadfileLoading = true;
this.qbdDirectConnectorService.postQbdDirectConntion({file_location: normalizedPath}).subscribe((connectionResponse: QbdConnectorGet) => {
this.qbdDirectConnectorService.postQbdDirectConntion({file_location: filePath}).subscribe((connectionResponse: QbdConnectorGet) => {
this.password = connectionResponse.password;
this.xmlFileContent = connectionResponse.qwc;
this.triggerManualDownload();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
[contentText]="brandingContent.contentText"
[showSyncButton]="isOnboarding"
[appName]="appName.QBD_DIRECT"
[redirectLink]="redirectLink"
(refreshDimension)="refreshDimensions()">
</app-configuration-step-header>
</div>
Expand Down Expand Up @@ -88,6 +89,12 @@
[placeholder]="'Select top memo type'"
[formControllerName]="'topMemoStructure'">
</app-configuration-multi-select>
<div class="tw-p-24-px">
<p class="tw-text-12-px tw-mb-12-px tw-text-text-muted">{{brandingContent.previewDescriptionFieldLabel}}</p>
<div class="tw-bg-input-read-only-bg tw-rounded-4-px tw-text-14-px tw-py-8-px tw-px-8-px tw-border-input-read-only-border tw-border-solid">
<span>{{ topMemoPreviewText }}</span>
</div>
</div>

<app-configuration-multi-select
[form]="advancedSettingsForm"
Expand All @@ -114,8 +121,7 @@
[label]="brandingContent.skipExportLabel"
[subLabel]="brandingContent.skipExportSubLabel"
[formControllerName]="'skipExport'"
[iconPath]="'list'"
[redirectLink]="skipExportRedirectLink">
[iconPath]="'list'">
</app-configuration-toggle-field>
<div *ngIf="advancedSettingsForm.value.skipExport">
<app-configuration-skip-export
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export class QbdDirectAdvancedSettingsComponent implements OnInit {

employeeMapping: EmployeeFieldMapping;

redirectLink = brandingKbArticles.onboardingArticles.QBD_DIRECT.ADVANCED_SETTING;

AutoMapEmployeeOptions = AutoMapEmployeeOptions;

Expand All @@ -77,8 +78,6 @@ export class QbdDirectAdvancedSettingsComponent implements OnInit {

readonly brandingFeatureConfig = brandingFeatureConfig;

skipExportRedirectLink: string = brandingKbArticles.onboardingArticles.QBD_DIRECT.SKIP_EXPORT;

qbdDirectExportSettings: QbdDirectExportSettingGet;

expenseFilters: ExpenseFilterResponse;
Expand All @@ -93,6 +92,8 @@ export class QbdDirectAdvancedSettingsComponent implements OnInit {

isImportVendorAsMerchantPresent: boolean;

topMemoPreviewText: string;

constructor(
private advancedSettingsService: QbdDirectAdvancedSettingsService,
private exportSettingsService: QbdDirectExportSettingsService,
Expand Down Expand Up @@ -198,6 +199,15 @@ export class QbdDirectAdvancedSettingsComponent implements OnInit {
});
}

private createTopMemoStructureWatcher(): void {
this.memoStructure = this.advancedSettingsForm.value.topMemoStructure;
this.topMemoPreviewText = QbdDirectAdvancedSettingsModel.formatMemoPreview(this.memoStructure, this.defaultTopMemoOptions)[0];
this.advancedSettingsForm.controls.topMemoStructure.valueChanges.subscribe((memoChanges) => {
this.memoStructure = memoChanges;
this.topMemoPreviewText = QbdDirectAdvancedSettingsModel.formatMemoPreview(this.memoStructure, this.defaultTopMemoOptions)[0];
});
}

private scheduledWatcher() {
if (this.advancedSettingsForm.controls.exportSchedule.value) {
this.helper.markControllerAsRequired(this.advancedSettingsForm, 'exportScheduleFrequency');
Expand All @@ -216,6 +226,7 @@ export class QbdDirectAdvancedSettingsComponent implements OnInit {
this.createMemoStructureWatcher();
this.scheduledWatcher();
this.skipExportWatcher();
this.createTopMemoStructureWatcher();
}

private getSettingsAndSetupForm(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ <h5 *ngIf="formControllerName === 'cccExportType' && brandingConfig.brandId ===
<span *ngIf="brandingConfig.brandId === 'co'"> in {{uiExposedAppName}}</span>
</div>
<div *ngIf="!showExportPreview && isDisabled && isDisableTextRequired" class="sub-text tw-text-pretty">
<span *ngIf="!((formControllerName === 'reimbursableExportGroup' || formControllerName === 'creditCardExportGroup') && appName === AppName.QBD_DIRECT && form.controls.creditCardExportType.value !== 'CREDIT_CARD_PURCHASE' && form.controls.reimbursableExportType.value !== 'BILL')">Auto-selected based on your export module</span>
<span *ngIf="(formControllerName === 'reimbursableExportGroup' || formControllerName === 'creditCardExportGroup') && appName === AppName.QBD_DIRECT && form.controls.creditCardExportType.value !== 'CREDIT_CARD_PURCHASE' && form.controls.reimbursableExportType.value !== 'BILL'"> Auto-selected when your default credit account is set to an Accounts Payable account</span>
<span *ngIf="(appName === AppName.QBD_DIRECT && form.controls.creditCardExportType.value === 'CREDIT_CARD_PURCHASE' && formControllerName === 'creditCardExportGroup') || (appName !== AppName.QBD_DIRECT)">Auto-selected based on your export module</span>
<span *ngIf="(formControllerName === 'reimbursableExportGroup' && form.controls.reimbursableExportType.value !== 'BILL' && appName === AppName.QBD_DIRECT) || (appName === AppName.QBD_DIRECT && form.controls.creditCardExportType.value !== 'CREDIT_CARD_PURCHASE' && formControllerName === 'creditCardExportGroup')"> Auto-selected when your default credit account is set to an Accounts Payable account</span>
</div>
<div *ngIf="brandingConfig.brandId !== 'co' && form.controls[formControllerName].value==='spent_at' && isOnboarding && form.get('cccExportType')?.value && form.get('cccExportGroup')?.value === 'REPORT'" class="sub-text">
<span>Using the Spend Date may lead to multiple single line<br>item entries.</span>
Expand Down

0 comments on commit 7b671c9

Please sign in to comment.