From 4465d4e6edb9f0f9c0d0789228f53834c57e205e Mon Sep 17 00:00:00 2001 From: Cristi Paval Date: Tue, 10 Dec 2024 23:24:07 +0200 Subject: [PATCH 1/3] Allow adding receipt to invoices --- src/pages/iou/request/step/IOURequestStepConfirmation.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/iou/request/step/IOURequestStepConfirmation.tsx b/src/pages/iou/request/step/IOURequestStepConfirmation.tsx index cb5b4d626715..b9db15115826 100644 --- a/src/pages/iou/request/step/IOURequestStepConfirmation.tsx +++ b/src/pages/iou/request/step/IOURequestStepConfirmation.tsx @@ -610,7 +610,7 @@ function IOURequestStepConfirmation({ title={headerTitle} onBackButtonPress={navigateBack} shouldShowThreeDotsButton={ - requestType === CONST.IOU.REQUEST_TYPE.MANUAL && (iouType === CONST.IOU.TYPE.SUBMIT || iouType === CONST.IOU.TYPE.TRACK) && !isMovingTransactionFromTrackExpense + requestType === CONST.IOU.REQUEST_TYPE.MANUAL && (iouType === CONST.IOU.TYPE.SUBMIT || iouType === CONST.IOU.TYPE.TRACK || iouType === CONST.IOU.TYPE.INVOICE) && !isMovingTransactionFromTrackExpense } threeDotsAnchorPosition={styles.threeDotsPopoverOffsetNoCloseButton(windowWidth)} threeDotsMenuItems={[ From 361498a98bd40da805245ad04f84ff417a5e5bd5 Mon Sep 17 00:00:00 2001 From: Cristi Paval Date: Tue, 10 Dec 2024 23:27:02 +0200 Subject: [PATCH 2/3] Pass receipt to the API --- src/libs/API/parameters/SendInvoiceParams.ts | 2 ++ src/libs/actions/IOU.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/src/libs/API/parameters/SendInvoiceParams.ts b/src/libs/API/parameters/SendInvoiceParams.ts index e2cac84e0d12..2b1bf28b5870 100644 --- a/src/libs/API/parameters/SendInvoiceParams.ts +++ b/src/libs/API/parameters/SendInvoiceParams.ts @@ -1,3 +1,4 @@ +import {Receipt} from '@src/types/onyx/Transaction'; import type {RequireAtLeastOne} from 'type-fest'; type SendInvoiceParams = RequireAtLeastOne< @@ -23,6 +24,7 @@ type SendInvoiceParams = RequireAtLeastOne< createdIOUReportActionID: string; createdReportActionIDForThread: string; reportActionID: string; + receipt?: Receipt; }, 'receiverEmail' | 'receiverInvoiceRoomID' >; diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index c5023bc0c1b5..d9a95881ffc1 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -3861,6 +3861,7 @@ function sendInvoice( companyName, companyWebsite, ...(invoiceChatReport?.reportID ? {receiverInvoiceRoomID: invoiceChatReport.reportID} : {receiverEmail: receiver.login ?? ''}), + receipt: receiptFile, }; API.write(WRITE_COMMANDS.SEND_INVOICE, parameters, onyxData); From 8cb67f7b8a223b898ec1fef6e8656e4a4a29d964 Mon Sep 17 00:00:00 2001 From: Cristi Paval Date: Fri, 13 Dec 2024 12:28:54 +0200 Subject: [PATCH 3/3] Add receiptState to SendInvoice params --- src/libs/API/parameters/SendInvoiceParams.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libs/API/parameters/SendInvoiceParams.ts b/src/libs/API/parameters/SendInvoiceParams.ts index 2b1bf28b5870..eb90608bdc25 100644 --- a/src/libs/API/parameters/SendInvoiceParams.ts +++ b/src/libs/API/parameters/SendInvoiceParams.ts @@ -1,5 +1,6 @@ +import type CONST from '@src/CONST'; import {Receipt} from '@src/types/onyx/Transaction'; -import type {RequireAtLeastOne} from 'type-fest'; +import type {RequireAtLeastOne, ValueOf} from 'type-fest'; type SendInvoiceParams = RequireAtLeastOne< { @@ -25,6 +26,7 @@ type SendInvoiceParams = RequireAtLeastOne< createdReportActionIDForThread: string; reportActionID: string; receipt?: Receipt; + receiptState?: ValueOf; }, 'receiverEmail' | 'receiverInvoiceRoomID' >;