Skip to content

Commit

Permalink
fix: Do not show pending transactions to add to report (#3122)
Browse files Browse the repository at this point in the history
  • Loading branch information
suyashpatil78 authored Jun 28, 2024
1 parent 30c5ab6 commit 278a72e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/app/fyle/my-expenses/my-expenses.page.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@ describe('MyExpensesPage', () => {
'getDeleteDialogBody',
'restrictPendingTransactionsEnabled',
'doesExpenseHavePendingCardTransaction',
'getReportableExpenses',
]);
const utilityServiceSpy = jasmine.createSpyObj('UtilityService', [
'canShowOptInAfterExpenseCreation',
Expand Down Expand Up @@ -2914,6 +2915,10 @@ describe('MyExpensesPage', () => {
queryParams: { report_id: 'is.null', state: 'in.(COMPLETE,DRAFT)', q: 'Bus:*' },
});
expect(sharedExpenseService.excludeCCCExpenses).toHaveBeenCalledOnceWith(apiExpenses1);
expect(sharedExpenseService.getReportableExpenses).toHaveBeenCalledOnceWith(
component.selectedElements,
component.restrictPendingTransactionsEnabled
);
expect(component.cccExpenses).toBe(0);
expect(component.selectedElements).toEqual([...apiExpenses1]);
expect(component.allExpensesCount).toBe(2);
Expand Down
5 changes: 4 additions & 1 deletion src/app/fyle/my-expenses/my-expenses.page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1626,7 +1626,10 @@ export class MyExpensesPage implements OnInit {
}
this.allExpensesCount = this.selectedElements.length;
this.isReportableExpensesSelected =
this.sharedExpenseService.getReportableExpenses(this.selectedElements).length > 0;
this.sharedExpenseService.getReportableExpenses(
this.selectedElements,
this.restrictPendingTransactionsEnabled
).length > 0;
this.setExpenseStatsOnSelect();
});
}
Expand Down

0 comments on commit 278a72e

Please sign in to comment.