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 1 commit
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
Loading