Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: QBD direct bug fixes #1085

Merged
merged 3 commits into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/core/models/db/task-log.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ export type TaskLogGetParams = {
type__in?: string[];
expense_group_ids?: number[];
task_type?: string[];
export_log_id__in?: number[];
export_log__id?: number[];
};
3 changes: 2 additions & 1 deletion src/app/core/models/enum/enum.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,8 @@ export enum AccountingExportStatus {
COMPLETE = 'COMPLETE',
IN_PROGRESS = 'IN_PROGRESS',
ENQUEUED = 'ENQUEUED',
EXPORT_QUEUED = 'EXPORT_QUEUED'
EXPORT_QUEUED = 'EXPORT_QUEUED',
ERROR = 'ERROR'
}

export enum AccountingExportType {
Expand Down
2 changes: 1 addition & 1 deletion src/app/core/services/common/dashboard.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class DashboardService {
}

if (expenseGroupIds.length) {
const expenseKey = appName === AppName.INTACCT ? 'expense_group_ids' : appName === AppName.QBD_DIRECT ? 'export_log_id__in' : 'expense_group_id__in';
const expenseKey = appName === AppName.INTACCT ? 'expense_group_ids' : appName === AppName.QBD_DIRECT ? 'export_log__id' : 'expense_group_id__in';
apiParams[expenseKey] = expenseGroupIds;
}

Expand Down
8 changes: 5 additions & 3 deletions src/app/core/services/common/export-log.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ import { Injectable } from '@angular/core';
import { ApiService } from './api.service';
import { UserService } from '../misc/user.service';
import { WorkspaceService } from './workspace.service';
import { environment } from 'src/environments/environment';
import { SkipExportLogResponse } from '../../models/intacct/db/expense-group.model';
import { AppName, FyleReferenceType, TaskLogState } from '../../models/enum/enum.model';
import { AccountingExportStatus, AppName, TaskLogState } from '../../models/enum/enum.model';
import { Observable } from 'rxjs';
import { AccountingExport } from '../../models/db/accounting-export.model';
import { SelectedDateFilter } from '../../models/qbd/misc/qbd-date-filter.model';
import { ExpenseGroupParam, ExpenseGroupResponse, SkipExportParam } from '../../models/db/expense-group.model';

Expand Down Expand Up @@ -87,6 +85,10 @@ export class ExportLogService {
if (appName === AppName.NETSUITE) {
return this.apiService.get(`/workspaces/${this.workspaceId}/fyle/expense_groups/v2/`, params);
} else if (appName === AppName.QBD_DIRECT) {
if (params.status__in?.includes(AccountingExportStatus.FAILED)) {
params.status__in = AccountingExportStatus.ERROR;
}

return this.apiService.get(`/workspaces/${this.workspaceId}/export_logs/`, params);
}
return this.apiService.get(`/workspaces/${this.workspaceId}/fyle/expense_groups/`, params);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export class QbdDirectDashboardComponent implements OnInit {
EMPLOYEE_MAPPING: null,
CATEGORY_MAPPING: null
};
this.accountingExportSummary = AccountingExportSummaryModel.parseAPIResponseToAccountingSummary(responses[1]);
this.accountingExportSummary = AccountingExportSummaryModel.parseAPIResponseToAccountingSummaryForQbdDirect(responses[1]);
this.failedExpenseGroupCount = res.results.filter(task => task.status === TaskLogState.FAILED || task.status === TaskLogState.FATAL).length;

this.exportableAccountingExportIds = res.results.filter(task => task.status === TaskLogState.FAILED || task.status === TaskLogState.FATAL).map(taskLog => taskLog.expense_group);
Expand Down Expand Up @@ -143,7 +143,7 @@ export class QbdDirectDashboardComponent implements OnInit {
this.accountingExportSummary = AccountingExportSummaryModel.parseAPIResponseToAccountingSummaryForQbdDirect(responses[1]);
}
this.destinationFieldMap = {
EMPLOYEE: responses[3].employee_field_mapping,
EMPLOYEE: responses[4].employee_field_mapping,
CATEGORY: 'ACCOUNT'
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ <h4 class="tw-text-16-px tw-pb-4-px tw-font-500 tw-text-text-tertiary">Enter com
</div>
<div *ngIf="!isLoading && showDownloadLink && !isStepCompleted" class="tw-flex tw-flex-col tw-justify-center tw-items-center tw-h-[400px] tw-text-center">
<div class="tw-text-center">
<app-svg-icon svgSource="check-circle-outline-extra-large" [width]="'40px'" [height]="'40px'" [isTextColorAllowed]="true" [styleClasses]="'tw-text-success-toast tw-pr-6-px'"></app-svg-icon>
<app-svg-icon svgSource="check-circle-outline-extra-large" [width]="'40px'" [height]="'40px'" [isTextColorAllowed]="true" [styleClasses]="'tw-text-success-toast'"></app-svg-icon>
</div>
<div>
<p class="tw-text-text-tertiary tw-text-16-px tw-font-500 tw-py-4-px">Your download will begin</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ <h4 class="tw-text-14-px tw-text-text-tertiary tw-font-500 tw-pb-4-px">Click on
</div>
<div *ngIf="!isLoading && !isStepCompleted && connectionStatus === qbdConnectionStatus.SUCCESS && showSection && !isStepCompleted" class="tw-flex tw-flex-col tw-justify-center tw-items-center tw-h-[400px] tw-text-center">
<div class="tw-text-center">
<app-svg-icon svgSource="check-circle-outline" [width]="'24px'" [height]="'24px'" [isTextColorAllowed]="true" [styleClasses]="'tw-text-success-toast tw-pr-6-px'"></app-svg-icon>
<app-svg-icon svgSource="check-circle-outline-extra-large" [width]="'40px'" [height]="'40px'" [isTextColorAllowed]="true" [styleClasses]="'tw-text-success-toast'"></app-svg-icon>
</div>
<div>
<p class="tw-pt-4-px tw-text-text-tertiary tw-text-16-px tw-font-500">Success!</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ const ICON_MAPPING = {
'check-circle-outline-small': 'grv-checkmark-encircled-small',
'check-circle-outline': 'grv-checkmark-encircled',
'check-circle-outline-medium': 'grv-checkmark-encircled-medium',
'check-circle-outline-extra-large': 'grv-checkmark-encircled-extra-large',
'check-medium': 'grv-checkmark-medium',
'check': 'grv-checkmark',
'check-large': 'grv-checkmark-large',
Expand Down
2 changes: 1 addition & 1 deletion src/assets/icons/check-circle-outline-extra-large.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/assets/icons/co/grv-checkmark-encircled-extra-large.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/icons/eye-medium.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/sprites/sprite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading