diff --git a/src/app/core/mock-data/transaction.data.ts b/src/app/core/mock-data/transaction.data.ts index 736f7890e9..f1e1b7579f 100644 --- a/src/app/core/mock-data/transaction.data.ts +++ b/src/app/core/mock-data/transaction.data.ts @@ -186,6 +186,14 @@ export const txnData: Transaction = deepFreeze({ skip_reimbursement: false, }); +export const txnDataCleaned: Partial = deepFreeze({ + source: 'MOBILE_DASHCAM_BULK', + txn_dt: new Date('2023-02-08T17:00:00.000Z'), + currency: 'INR', + source_account_id: 'acc5APeygFjRd', + skip_reimbursement: false, +}); + export const txnData2: Transaction = deepFreeze({ created_at: new Date('2023-02-08T06:47:48.414Z'), updated_at: new Date('2023-02-08T06:47:48.414Z'), diff --git a/src/app/core/services/transaction.service.spec.ts b/src/app/core/services/transaction.service.spec.ts index 234556808f..6fe02a94e5 100644 --- a/src/app/core/services/transaction.service.spec.ts +++ b/src/app/core/services/transaction.service.spec.ts @@ -41,6 +41,7 @@ import { txnData, txnData2, txnData4, + txnDataCleaned, txnDataPayload, txnList, upsertTxnParam, @@ -1100,9 +1101,14 @@ describe('TransactionService', () => { const mockFileObject = cloneDeep(fileObjectData1); spyOn(transactionService, 'upsert').and.returnValue(of(txnData2)); + expensesService.createFromFile.and.returnValue(of({ data: [expenseData] })); transactionService.createTxnWithFiles({ ...txnData }, of(mockFileObject)).subscribe((res) => { expect(res).toEqual(txnData2); - expect(transactionService.upsert).toHaveBeenCalledOnceWith({ ...txnData, file_ids: [fileObjectData1[0].id] }); + expect(expensesService.createFromFile).toHaveBeenCalledOnceWith(mockFileObject[0].id, 'MOBILE_DASHCAM_BULK'); + expect(transactionService.upsert).toHaveBeenCalledOnceWith({ + ...txnDataCleaned, + id: expenseData.id, + }); done(); }); }); diff --git a/src/app/core/services/transaction.service.ts b/src/app/core/services/transaction.service.ts index 19e676c614..77e7c9ed7d 100644 --- a/src/app/core/services/transaction.service.ts +++ b/src/app/core/services/transaction.service.ts @@ -195,16 +195,22 @@ export class TransactionService { ): Observable> { return fileUploads$.pipe( switchMap((fileObjs) => { - // txn contains only source key when capturing receipt - if (txn.hasOwnProperty('source') && Object.keys(txn).length === 1) { - const fileIds = fileObjs.map((fileObj) => fileObj.id); - if (fileIds.length > 0) { - return this.expensesService - .createFromFile(fileIds[0], txn.source) - .pipe(map((result) => this.transformExpense(result.data[0]).tx)); - } + const fileIds = fileObjs.map((fileObj) => fileObj.id); + const isReceiptUpload = txn.hasOwnProperty('source') && Object.keys(txn).length === 1; + const isAmountPresent = !!txn.amount; + if ((isReceiptUpload || !isAmountPresent) && fileIds.length > 0) { + return this.expensesService.createFromFile(fileIds[0], txn.source).pipe( + switchMap((result) => { + // capture receipt flow: patching the expense in case of amount not present + if (!isReceiptUpload && !isAmountPresent) { + txn.id = result.data[0].id; + return this.upsert(this.cleanupExpensePayload(txn)); + } else { + return of(this.transformExpense(result.data[0]).tx); + } + }) + ); } else { - const fileIds = fileObjs.map((fileObj) => fileObj.id); txn.file_ids = fileIds; return this.upsert(txn); } @@ -919,4 +925,15 @@ export class TransactionService { return typeOrFilter; } + + // to be used only when updating created expense with form values during capture recept flow + private cleanupExpensePayload(txn: Partial): Partial { + const newTxn: Partial = {}; + for (const key in txn) { + if (txn[key] !== null && txn[key] !== undefined) { + newTxn[key] = txn[key] as Transaction[keyof Transaction]; + } + } + return newTxn; + } } diff --git a/src/app/core/services/transactions-outbox.service.spec.ts b/src/app/core/services/transactions-outbox.service.spec.ts index 0b6baa15a6..f3e81e504f 100644 --- a/src/app/core/services/transactions-outbox.service.spec.ts +++ b/src/app/core/services/transactions-outbox.service.spec.ts @@ -178,13 +178,11 @@ describe('TransactionsOutboxService', () => { transactionsOutboxService.addEntryAndSync( txnData2, [{ url: '2023-02-08/orNVthTo2Zyo/receipts/fi6PQ6z4w6ET.000.jpeg', type: 'image/jpeg' }], - null, null ); expect(transactionsOutboxService.addEntry).toHaveBeenCalledOnceWith( txnData2, [{ url: '2023-02-08/orNVthTo2Zyo/receipts/fi6PQ6z4w6ET.000.jpeg', type: 'image/jpeg' }], - null, null ); expect(transactionsOutboxService.syncEntry).toHaveBeenCalledOnceWith(outboxQueueData1[0]); @@ -195,13 +193,11 @@ describe('TransactionsOutboxService', () => { transactionsOutboxService.addEntryAndSync( txnData2, [{ url: '2023-02-08/orNVthTo2Zyo/receipts/fi6PQ6z4w6ET.000.jpeg', type: 'image/jpeg' }], - null, null ); expect(transactionsOutboxService.addEntry).toHaveBeenCalledOnceWith( txnData2, [{ url: '2023-02-08/orNVthTo2Zyo/receipts/fi6PQ6z4w6ET.000.jpeg', type: 'image/jpeg' }], - null, null ); expect(transactionsOutboxService.syncEntry).toHaveBeenCalledOnceWith(outboxQueueData1[0]); diff --git a/src/app/core/services/transactions-outbox.service.ts b/src/app/core/services/transactions-outbox.service.ts index 8ad12f30ca..a9df7591de 100644 --- a/src/app/core/services/transactions-outbox.service.ts +++ b/src/app/core/services/transactions-outbox.service.ts @@ -141,14 +141,12 @@ export class TransactionsOutboxService { addEntry( transaction: Partial, dataUrls: { url: string; type: string }[], - comments?: string[], - reportId?: string + comments?: string[] ): Promise { this.queue.push({ transaction, dataUrls, comments, - reportId, }); return this.saveQueue(); @@ -159,10 +157,9 @@ export class TransactionsOutboxService { addEntryAndSync( transaction: Partial, dataUrls: { url: string; type: string }[], - comments: string[], - reportId: string + comments: string[] ): Promise { - this.addEntry(transaction, dataUrls, comments, reportId); + this.addEntry(transaction, dataUrls, comments); return this.syncEntry(this.queue.pop()); } diff --git a/src/app/fyle/add-edit-expense/add-edit-expense-4.spec.ts b/src/app/fyle/add-edit-expense/add-edit-expense-4.spec.ts index fe59feabc3..cc832a2df2 100644 --- a/src/app/fyle/add-edit-expense/add-edit-expense-4.spec.ts +++ b/src/app/fyle/add-edit-expense/add-edit-expense-4.spec.ts @@ -481,8 +481,7 @@ export function TestCases4(getTestBed) { expect(transactionOutboxService.addEntry).toHaveBeenCalledOnceWith( mockEtxn.tx, [{ url: '2023-02-08/orNVthTo2Zyo/receipts/fi6PQ6z4w6ET.000.pdf', type: 'pdf' }], - [], - 'rprAfNrce73O' + [] ); done(); }); @@ -523,12 +522,7 @@ export function TestCases4(getTestBed) { ); expect(authService.getEou).toHaveBeenCalledOnceWith(); expect(component.trackCreateExpense).toHaveBeenCalledOnceWith(expectedUnflattendedTxnData3, false); - expect(transactionOutboxService.addEntry).toHaveBeenCalledOnceWith( - outboxQueueData1[0].transaction, - [], - [], - undefined - ); + expect(transactionOutboxService.addEntry).toHaveBeenCalledOnceWith(outboxQueueData1[0].transaction, [], []); done(); }); }); @@ -574,7 +568,7 @@ export function TestCases4(getTestBed) { ); expect(authService.getEou).toHaveBeenCalledOnceWith(); expect(component.trackCreateExpense).toHaveBeenCalledOnceWith(expectedUnflattendedTxnData4, false); - expect(transactionOutboxService.addEntry).toHaveBeenCalledOnceWith(mockEtxn.tx, [], ['continue'], undefined); + expect(transactionOutboxService.addEntry).toHaveBeenCalledOnceWith(mockEtxn.tx, [], ['continue']); done(); }); }); diff --git a/src/app/fyle/add-edit-expense/add-edit-expense.page.ts b/src/app/fyle/add-edit-expense/add-edit-expense.page.ts index 1a2793d284..d9a2c7b43f 100644 --- a/src/app/fyle/add-edit-expense/add-edit-expense.page.ts +++ b/src/app/fyle/add-edit-expense/add-edit-expense.page.ts @@ -4275,7 +4275,6 @@ export class AddEditExpensePage implements OnInit { const customFields$ = this.getCustomFields(); this.trackAddExpense(); - return this.generateEtxnFromFg(this.etxn$, customFields$).pipe( switchMap((etxn) => this.isConnected$.pipe( @@ -4361,13 +4360,12 @@ export class AddEditExpensePage implements OnInit { etxn.tx.matchCCCId = this.selectedCCCTransaction.id; } - let reportId: string; const formValues = this.getFormValues(); if ( formValues.report && (etxn.tx.policy_amount === null || (etxn.tx.policy_amount && !(etxn.tx.policy_amount < 0.0001))) ) { - reportId = formValues.report.id; + etxn.tx.report_id = formValues.report.id; } etxn.dataUrls = etxn.dataUrls.map((data: FileObject) => { @@ -4387,8 +4385,7 @@ export class AddEditExpensePage implements OnInit { this.transactionOutboxService.addEntryAndSync( etxn.tx, etxn.dataUrls as { url: string; type: string }[], - comments, - reportId + comments ) ); } else { @@ -4404,13 +4401,12 @@ export class AddEditExpensePage implements OnInit { this.transactionOutboxService.addEntryAndSync( etxn.tx, etxn.dataUrls as { url: string; type: string }[], - comments, - reportId + comments ) ); } else { this.transactionOutboxService - .addEntry(etxn.tx, etxn.dataUrls as { url: string; type: string }[], comments, reportId) + .addEntry(etxn.tx, etxn.dataUrls as { url: string; type: string }[], comments) .then(noop); return of(null); diff --git a/src/app/fyle/add-edit-mileage/add-edit-mileage-3.spec.ts b/src/app/fyle/add-edit-mileage/add-edit-mileage-3.spec.ts index 0e0db0af2a..f01e293387 100644 --- a/src/app/fyle/add-edit-mileage/add-edit-mileage-3.spec.ts +++ b/src/app/fyle/add-edit-mileage/add-edit-mileage-3.spec.ts @@ -247,7 +247,7 @@ export function TestCases3(getTestBed) { spyOn(component, 'getCustomFields').and.returnValue(of(txnCustomPropertiesData4)); spyOn(component, 'getCalculatedDistance').and.returnValue(of('10')); component.isConnected$ = of(true); - spyOn(component, 'generateEtxnFromFg').and.returnValue(of(unflattenedTxnData)); + spyOn(component, 'generateEtxnFromFg').and.returnValue(of(cloneDeep(unflattenedTxnData))); spyOn(component, 'checkPolicyViolation').and.returnValue(of(expensePolicyDataWoData)); policyService.getCriticalPolicyRules.and.returnValue([]); policyService.getPolicyRules.and.returnValue([]); @@ -256,11 +256,18 @@ export function TestCases3(getTestBed) { spyOn(component, 'getFormValues').and.returnValue({ report: expectedReportsPaginated[0], }); + const expectedEtxnData = { + ...unflattenedTxnData, + tx: { + ...unflattenedTxnData.tx, + report_id: expectedReportsPaginated[0].id, + }, + }; transactionOutboxService.addEntryAndSync.and.resolveTo(outboxQueueData1[0]); fixture.detectChanges(); component.addExpense('SAVE_MILEAGE').subscribe((res) => { - expect(res).toEqual(unflattenedTxnData); + expect(res).toEqual(expectedEtxnData); expect(component.getCustomFields).toHaveBeenCalledTimes(1); expect(component.getCalculatedDistance).toHaveBeenCalledTimes(1); expect(component.generateEtxnFromFg).toHaveBeenCalledOnceWith( @@ -274,10 +281,9 @@ export function TestCases3(getTestBed) { expect(component.trackCreateExpense).toHaveBeenCalledTimes(1); expect(component.getFormValues).toHaveBeenCalledTimes(1); expect(transactionOutboxService.addEntryAndSync).toHaveBeenCalledOnceWith( - unflattenedTxnData.tx, + expectedEtxnData.tx, unflattenedTxnData.dataUrls as any, - [], - expectedReportsPaginated[0].id + [] ); done(); }); @@ -318,8 +324,7 @@ export function TestCases3(getTestBed) { expect(transactionOutboxService.addEntryAndSync).toHaveBeenCalledOnceWith( unflattenedMileageDataWithPolicyAmount.tx, unflattenedTxnData.dataUrls as any, - [], - undefined + [] ); done(); }); @@ -369,8 +374,7 @@ export function TestCases3(getTestBed) { expect(transactionOutboxService.addEntryAndSync).toHaveBeenCalledOnceWith( unflattenedTxnData.tx, unflattenedTxnData.dataUrls as any, - [], - undefined + [] ); done(); }); @@ -422,8 +426,7 @@ export function TestCases3(getTestBed) { expect(transactionOutboxService.addEntryAndSync).toHaveBeenCalledOnceWith( unflattendedTxnWithPolicyAmount.tx, unflattendedTxnWithPolicyAmount.dataUrls as any, - ['A comment'], - undefined + ['A comment'] ); done(); }); @@ -433,18 +436,25 @@ export function TestCases3(getTestBed) { component.isConnected$ = of(false); spyOn(component, 'getCustomFields').and.returnValue(of(txnCustomPropertiesData4)); spyOn(component, 'getCalculatedDistance').and.returnValue(of('10')); - spyOn(component, 'generateEtxnFromFg').and.returnValue(of(unflattenedTxnData)); + spyOn(component, 'generateEtxnFromFg').and.returnValue(of(cloneDeep(unflattenedTxnData))); spyOn(component, 'checkPolicyViolation').and.returnValue(of(expensePolicyDataWoData)); spyOn(component, 'trackCreateExpense'); authService.getEou.and.resolveTo(apiEouRes); spyOn(component, 'getFormValues').and.returnValue({ report: expectedReportsPaginated[0], }); + const expectedEtxnData = { + ...unflattenedTxnData, + tx: { + ...unflattenedTxnData.tx, + report_id: expectedReportsPaginated[0].id, + }, + }; transactionOutboxService.addEntryAndSync.and.resolveTo(outboxQueueData1[0]); fixture.detectChanges(); component.addExpense('SAVE_MILEAGE').subscribe((res) => { - expect(res).toEqual(unflattenedTxnData); + expect(res).toEqual(expectedEtxnData); expect(component.getCustomFields).toHaveBeenCalledTimes(1); expect(component.getCalculatedDistance).toHaveBeenCalledTimes(1); expect(component.generateEtxnFromFg).toHaveBeenCalledOnceWith( @@ -456,10 +466,9 @@ export function TestCases3(getTestBed) { expect(component.trackCreateExpense).toHaveBeenCalledTimes(1); expect(component.getFormValues).toHaveBeenCalledTimes(1); expect(transactionOutboxService.addEntryAndSync).toHaveBeenCalledOnceWith( - unflattenedTxnData.tx, + expectedEtxnData.tx, unflattenedTxnData.dataUrls as any, - [], - expectedReportsPaginated[0].id + [] ); done(); }); diff --git a/src/app/fyle/add-edit-mileage/add-edit-mileage.page.ts b/src/app/fyle/add-edit-mileage/add-edit-mileage.page.ts index 79cb11fb1c..7f0044cc4c 100644 --- a/src/app/fyle/add-edit-mileage/add-edit-mileage.page.ts +++ b/src/app/fyle/add-edit-mileage/add-edit-mileage.page.ts @@ -2910,19 +2910,17 @@ export class AddEditMileagePage implements OnInit { const reportValue = this.getFormValues(); - let reportId: string; if ( reportValue?.report && (etxn.tx.policy_amount === null || (etxn.tx.policy_amount && !(etxn.tx.policy_amount < 0.0001))) ) { - reportId = reportValue.report?.id; + etxn.tx.report_id = reportValue.report?.id; } return of( this.transactionsOutboxService.addEntryAndSync( etxn.tx, etxn.dataUrls as { url: string; type: string }[], - comments, - reportId + comments ) ).pipe( switchMap((txnData: Promise) => from(txnData)), diff --git a/src/app/fyle/add-edit-per-diem/add-edit-per-diem-3.page.spec.ts b/src/app/fyle/add-edit-per-diem/add-edit-per-diem-3.page.spec.ts index f7aceaf89e..08db84db5d 100644 --- a/src/app/fyle/add-edit-per-diem/add-edit-per-diem-3.page.spec.ts +++ b/src/app/fyle/add-edit-per-diem/add-edit-per-diem-3.page.spec.ts @@ -613,18 +613,27 @@ export function TestCases3(getTestBed) { }); describe('addExpense():', () => { - const etxn$ = of({ tx: unflattenedTxnData.tx, ou: unflattenedTxnData.ou, dataUrls: [] }); const customFields$ = of(txnCustomProperties4); + const expectedEtxnDataWithReportId = { + ...unflattenedTxnData, + tx: { + ...unflattenedTxnData.tx, + report_id: expectedReportsPaginated[0].id, + }, + }; beforeEach(() => { + const etxn$ = of({ tx: cloneDeep(unflattenedTxnData.tx), ou: unflattenedTxnData.ou, dataUrls: [] }); spyOn(component, 'generateEtxnFromFg').and.returnValue(etxn$); spyOn(component, 'getCustomFields').and.returnValue(customFields$); component.isConnected$ = of(true); spyOn(component, 'checkPolicyViolation').and.returnValue(of(expensePolicyData)); policyService.getCriticalPolicyRules.and.returnValue(['The expense will be flagged']); policyService.getPolicyRules.and.returnValue(['The expense will be flagged']); - spyOn(component, 'criticalPolicyViolationErrorHandler').and.returnValue(of({ etxn: unflattenedTxnData })); + spyOn(component, 'criticalPolicyViolationErrorHandler').and.returnValue( + of({ etxn: cloneDeep(unflattenedTxnData) }) + ); spyOn(component, 'policyViolationErrorHandler').and.returnValue( - of({ etxn: unflattenedTxnData, comment: 'comment' }) + of({ etxn: cloneDeep(unflattenedTxnData), comment: 'comment' }) ); authService.getEou.and.resolveTo(apiEouRes); spyOn(component, 'getFormValues').and.returnValue({ @@ -670,10 +679,9 @@ export function TestCases3(getTestBed) { expect(authService.getEou).toHaveBeenCalledTimes(1); expect(trackingService.createExpense).toHaveBeenCalledOnceWith(createExpenseProperties3); expect(transactionOutboxService.addEntryAndSync).toHaveBeenCalledOnceWith( - unflattenedTxnData.tx, + expectedEtxnDataWithReportId.tx, undefined, - [], - 'rprAfNrce73O' + [] ); expect(res).toEqual(outboxQueueData1[0]); done(); @@ -713,10 +721,9 @@ export function TestCases3(getTestBed) { expect(authService.getEou).toHaveBeenCalledTimes(1); expect(trackingService.createExpense).toHaveBeenCalledOnceWith(createExpenseProperties3); expect(transactionOutboxService.addEntryAndSync).toHaveBeenCalledOnceWith( - unflattenedTxnData.tx, + expectedEtxnDataWithReportId.tx, undefined, - ['comment'], - 'rprAfNrce73O' + ['comment'] ); expect(res).toEqual(outboxQueueData1[0]); done(); @@ -759,10 +766,9 @@ export function TestCases3(getTestBed) { expect(authService.getEou).toHaveBeenCalledTimes(1); expect(trackingService.createExpense).toHaveBeenCalledOnceWith(createExpenseProperties3); expect(transactionOutboxService.addEntryAndSync).toHaveBeenCalledOnceWith( - unflattenedTxnData.tx, + expectedEtxnDataWithReportId.tx, undefined, - ['comment'], - 'rprAfNrce73O' + ['comment'] ); expect(res).toEqual(outboxQueueData1[0]); done(); @@ -803,10 +809,9 @@ export function TestCases3(getTestBed) { expect(authService.getEou).toHaveBeenCalledTimes(1); expect(trackingService.createExpense).toHaveBeenCalledOnceWith(createExpenseProperties3); expect(transactionOutboxService.addEntryAndSync).toHaveBeenCalledOnceWith( - unflattenedTxnData.tx, + expectedEtxnDataWithReportId.tx, undefined, - ['comment'], - 'rprAfNrce73O' + ['comment'] ); expect(res).toEqual(outboxQueueData1[0]); done(); @@ -843,10 +848,9 @@ export function TestCases3(getTestBed) { expect(authService.getEou).toHaveBeenCalledTimes(1); expect(trackingService.createExpense).toHaveBeenCalledOnceWith(createExpenseProperties3); expect(transactionOutboxService.addEntryAndSync).toHaveBeenCalledOnceWith( - unflattenedTxnData.tx, + expectedEtxnDataWithReportId.tx, undefined, - ['comment'], - 'rprAfNrce73O' + ['comment'] ); expect(res).toEqual(outboxQueueData1[0]); }, @@ -888,10 +892,9 @@ export function TestCases3(getTestBed) { expect(trackingService.createExpense).toHaveBeenCalledOnceWith(createExpenseProperties3); expect(transactionOutboxService.addEntryAndSync).toHaveBeenCalledOnceWith( - unflattenedTxnData.tx, + expectedEtxnDataWithReportId.tx, [], - [], - 'rprAfNrce73O' + [] ); expect(res).toEqual(outboxQueueData1[0]); done(); @@ -923,10 +926,9 @@ export function TestCases3(getTestBed) { expect(trackingService.createExpense).toHaveBeenCalledOnceWith(createExpenseProperties3); expect(transactionOutboxService.addEntryAndSync).toHaveBeenCalledOnceWith( - unflattenedTxnData.tx, - [], + expectedEtxnDataWithReportId.tx, [], - 'rprAfNrce73O' + [] ); expect(res).toEqual(outboxQueueData1[0]); done(); @@ -938,6 +940,7 @@ export function TestCases3(getTestBed) { policyService.getPolicyRules.and.returnValue([]); const mockTxnData = cloneDeep(unflattenedTxnData); mockTxnData.tx.policy_amount = 0.1; + mockTxnData.tx.report_id = expectedReportsPaginated[0].id; component.generateEtxnFromFg = jasmine .createSpy() .and.returnValue(of({ tx: mockTxnData.tx, ou: unflattenedTxnData.ou, dataUrls: [] })); @@ -967,12 +970,7 @@ export function TestCases3(getTestBed) { expect(authService.getEou).toHaveBeenCalledTimes(1); expect(trackingService.createExpense).toHaveBeenCalledOnceWith(createExpenseProperties3); - expect(transactionOutboxService.addEntryAndSync).toHaveBeenCalledOnceWith( - mockTxnData.tx, - [], - [], - 'rprAfNrce73O' - ); + expect(transactionOutboxService.addEntryAndSync).toHaveBeenCalledOnceWith(mockTxnData.tx, [], []); expect(res).toEqual(outboxQueueData1[0]); done(); }); diff --git a/src/app/fyle/add-edit-per-diem/add-edit-per-diem.page.ts b/src/app/fyle/add-edit-per-diem/add-edit-per-diem.page.ts index 503326d976..ee9a115bfe 100644 --- a/src/app/fyle/add-edit-per-diem/add-edit-per-diem.page.ts +++ b/src/app/fyle/add-edit-per-diem/add-edit-per-diem.page.ts @@ -1970,20 +1970,19 @@ export class AddEditPerDiemPage implements OnInit { comments.push(comment); } - let reportId: string; const formValue = this.getFormValues(); + const transaction = cloneDeep(etxn.tx); if ( formValue.report && (etxn.tx.policy_amount === null || (etxn.tx.policy_amount && !(etxn.tx.policy_amount < 0.0001))) ) { - reportId = formValue.report.id; + transaction.report_id = formValue.report.id; } return of( this.transactionsOutboxService.addEntryAndSync( - etxn.tx, + transaction, etxn.dataUrls as { url: string; type: string }[], - comments, - reportId + comments ) ).pipe(switchMap((txnData) => from(txnData))); }) diff --git a/src/app/shared/components/capture-receipt/capture-receipt.component.ts b/src/app/shared/components/capture-receipt/capture-receipt.component.ts index 4c9df512f4..0e733f173e 100644 --- a/src/app/shared/components/capture-receipt/capture-receipt.component.ts +++ b/src/app/shared/components/capture-receipt/capture-receipt.component.ts @@ -127,7 +127,7 @@ export class CaptureReceiptComponent implements OnInit, OnDestroy, AfterViewInit url: base64ImagesWithSource.base64Image, }, ]; - return this.transactionsOutboxService.addEntry(transaction, attachmentUrls, null, null); + return this.transactionsOutboxService.addEntry(transaction, attachmentUrls, null); }) ); }