From 850b09bda81da5f135876f221cd7edc78af4a53e Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Mon, 3 Jun 2024 18:45:42 +0800 Subject: [PATCH 1/3] update scan request condition --- src/libs/TransactionUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/TransactionUtils.ts b/src/libs/TransactionUtils.ts index 7b328458c0ac..92d72ed34cb5 100644 --- a/src/libs/TransactionUtils.ts +++ b/src/libs/TransactionUtils.ts @@ -58,7 +58,7 @@ function isScanRequest(transaction: OnyxEntry): boolean { return transaction?.iouRequestType === CONST.IOU.REQUEST_TYPE.SCAN; } - return Boolean(transaction?.receipt?.source); + return Boolean(transaction?.receipt?.source) && transaction?.amount === 0; } function getRequestType(transaction: OnyxEntry): IOURequestType { From ea7da78cab29f730c8e4a5c2017d89c2770241a2 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Mon, 3 Jun 2024 18:45:57 +0800 Subject: [PATCH 2/3] don't show add receipt option when moving transaction from tracked expense --- .../iou/request/step/IOURequestStepConfirmation.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pages/iou/request/step/IOURequestStepConfirmation.tsx b/src/pages/iou/request/step/IOURequestStepConfirmation.tsx index b4eb9f1082ed..bf8d8b3c7f6a 100644 --- a/src/pages/iou/request/step/IOURequestStepConfirmation.tsx +++ b/src/pages/iou/request/step/IOURequestStepConfirmation.tsx @@ -91,6 +91,7 @@ function IOURequestStepConfirmation({ const isSharingTrackExpense = action === CONST.IOU.ACTION.SHARE; const isCategorizingTrackExpense = action === CONST.IOU.ACTION.CATEGORIZE; const isSubmittingFromTrackExpense = action === CONST.IOU.ACTION.SUBMIT; + const isMovingTransactionFromTrackExpense = IOUUtils.isMovingTransactionFromTrackExpense(action); const payeePersonalDetails = useMemo(() => { if (personalDetails?.[transaction?.splitPayerAccountIDs?.[0] ?? -1]) { return personalDetails?.[transaction?.splitPayerAccountIDs?.[0] ?? -1]; @@ -468,7 +469,7 @@ function IOURequestStepConfirmation({ return; } - if (requestType === CONST.IOU.REQUEST_TYPE.DISTANCE && !IOUUtils.isMovingTransactionFromTrackExpense(action)) { + if (requestType === CONST.IOU.REQUEST_TYPE.DISTANCE && !isMovingTransactionFromTrackExpense) { const customUnitRateID = TransactionUtils.getRateID(transaction) ?? ''; createDistanceRequest(selectedParticipants, trimmedComment, customUnitRateID); return; @@ -489,7 +490,7 @@ function IOURequestStepConfirmation({ createDistanceRequest, isSharingTrackExpense, isCategorizingTrackExpense, - action, + isMovingTransactionFromTrackExpense, policy, policyTags, policyCategories, @@ -538,7 +539,7 @@ function IOURequestStepConfirmation({ From f5e4339ac9c4abe2617ef2719924e0359447e6a9 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Mon, 3 Jun 2024 19:08:53 +0800 Subject: [PATCH 3/3] prettier --- src/pages/iou/request/step/IOURequestStepConfirmation.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/iou/request/step/IOURequestStepConfirmation.tsx b/src/pages/iou/request/step/IOURequestStepConfirmation.tsx index bf8d8b3c7f6a..939589598701 100644 --- a/src/pages/iou/request/step/IOURequestStepConfirmation.tsx +++ b/src/pages/iou/request/step/IOURequestStepConfirmation.tsx @@ -539,7 +539,9 @@ function IOURequestStepConfirmation({