From 339a568cf5b0dd0327c98759bda130884d2cbb28 Mon Sep 17 00:00:00 2001 From: Lukasz Modzelewski Date: Mon, 20 Oct 2025 14:42:06 +0200 Subject: [PATCH 1/4] Fix wrong iouType type when moving to startMoneyRequest --- src/components/FloatingCameraButton.tsx | 2 +- src/pages/home/sidebar/FloatingActionButtonAndPopover.tsx | 2 +- src/pages/iou/request/step/IOURequestStepParticipants.tsx | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/FloatingCameraButton.tsx b/src/components/FloatingCameraButton.tsx index 67054a2ac9614..6bcd85b9928a0 100644 --- a/src/components/FloatingCameraButton.tsx +++ b/src/components/FloatingCameraButton.tsx @@ -56,7 +56,7 @@ function FloatingCameraButton() { const quickActionReportID = policyChatForActivePolicy?.reportID ?? reportID; Tab.setSelectedTab(CONST.TAB.IOU_REQUEST_TYPE, CONST.IOU.REQUEST_TYPE.SCAN); - startMoneyRequest(CONST.IOU.TYPE.SUBMIT, quickActionReportID, CONST.IOU.REQUEST_TYPE.SCAN, !!policyChatForActivePolicy?.reportID, undefined, allTransactionDrafts); + startMoneyRequest(CONST.IOU.TYPE.CREATE, quickActionReportID, CONST.IOU.REQUEST_TYPE.SCAN, !!policyChatForActivePolicy?.reportID, undefined, allTransactionDrafts); }); }; diff --git a/src/pages/home/sidebar/FloatingActionButtonAndPopover.tsx b/src/pages/home/sidebar/FloatingActionButtonAndPopover.tsx index c4ff1c951ca43..d52416f980902 100644 --- a/src/pages/home/sidebar/FloatingActionButtonAndPopover.tsx +++ b/src/pages/home/sidebar/FloatingActionButtonAndPopover.tsx @@ -257,7 +257,7 @@ function FloatingActionButtonAndPopover({onHideCreateMenu, onShowCreateMenu, ref const quickActionReportID = policyChatForActivePolicy?.reportID ?? reportID; Tab.setSelectedTab(CONST.TAB.IOU_REQUEST_TYPE, CONST.IOU.REQUEST_TYPE.SCAN); - startMoneyRequest(CONST.IOU.TYPE.SUBMIT, quickActionReportID, CONST.IOU.REQUEST_TYPE.SCAN, !!policyChatForActivePolicy?.reportID, undefined, allTransactionDrafts); + startMoneyRequest(CONST.IOU.TYPE.CREATE, quickActionReportID, CONST.IOU.REQUEST_TYPE.SCAN, !!policyChatForActivePolicy?.reportID, undefined, allTransactionDrafts); }); }, [policyChatForActivePolicy?.policyID, policyChatForActivePolicy?.reportID, reportID, allTransactionDrafts]); diff --git a/src/pages/iou/request/step/IOURequestStepParticipants.tsx b/src/pages/iou/request/step/IOURequestStepParticipants.tsx index 1bb302ec2d332..b5d1c7b780f4a 100644 --- a/src/pages/iou/request/step/IOURequestStepParticipants.tsx +++ b/src/pages/iou/request/step/IOURequestStepParticipants.tsx @@ -356,7 +356,9 @@ function IOURequestStepParticipants({ Navigation.goBack(backTo); return; } - navigateToStartMoneyRequestStep(iouRequestType, iouType, initialTransactionID, reportID, action); + const iouTypeValue = iouRequestType === CONST.IOU.REQUEST_TYPE.MANUAL && action === CONST.IOU.ACTION.CREATE ? CONST.IOU.TYPE.CREATE : iouType; + + navigateToStartMoneyRequestStep(iouRequestType, iouTypeValue, initialTransactionID, reportID, action); }, [backTo, iouRequestType, iouType, initialTransactionID, reportID, action]); useEffect(() => { From a26cb4f6743844ba7ca562bd5b9f759b37b2fee1 Mon Sep 17 00:00:00 2001 From: Lukasz Modzelewski Date: Mon, 20 Oct 2025 15:14:42 +0200 Subject: [PATCH 2/4] Add stricter condition --- src/pages/iou/request/step/IOURequestStepParticipants.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pages/iou/request/step/IOURequestStepParticipants.tsx b/src/pages/iou/request/step/IOURequestStepParticipants.tsx index b5d1c7b780f4a..6e616931f25c6 100644 --- a/src/pages/iou/request/step/IOURequestStepParticipants.tsx +++ b/src/pages/iou/request/step/IOURequestStepParticipants.tsx @@ -356,7 +356,11 @@ function IOURequestStepParticipants({ Navigation.goBack(backTo); return; } - const iouTypeValue = iouRequestType === CONST.IOU.REQUEST_TYPE.MANUAL && action === CONST.IOU.ACTION.CREATE ? CONST.IOU.TYPE.CREATE : iouType; + + // Change iouType param to enable negative values + const shouldForceIOUType = + action === CONST.IOU.ACTION.CREATE && iouType === CONST.IOU.TYPE.SUBMIT && (iouRequestType === CONST.IOU.REQUEST_TYPE.MANUAL || iouRequestType === CONST.IOU.REQUEST_TYPE.SCAN); + const iouTypeValue = shouldForceIOUType ? CONST.IOU.TYPE.CREATE : iouType; navigateToStartMoneyRequestStep(iouRequestType, iouTypeValue, initialTransactionID, reportID, action); }, [backTo, iouRequestType, iouType, initialTransactionID, reportID, action]); From 99ccbe9eb992fa7bac728c24b89d680173b3342a Mon Sep 17 00:00:00 2001 From: Lukasz Modzelewski Date: Mon, 20 Oct 2025 14:42:06 +0200 Subject: [PATCH 3/4] Fix wrong iouType type when moving to startMoneyRequest --- src/components/FloatingCameraButton.tsx | 2 +- src/pages/home/sidebar/FloatingActionButtonAndPopover.tsx | 2 +- src/pages/iou/request/step/IOURequestStepParticipants.tsx | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/FloatingCameraButton.tsx b/src/components/FloatingCameraButton.tsx index 67054a2ac9614..6bcd85b9928a0 100644 --- a/src/components/FloatingCameraButton.tsx +++ b/src/components/FloatingCameraButton.tsx @@ -56,7 +56,7 @@ function FloatingCameraButton() { const quickActionReportID = policyChatForActivePolicy?.reportID ?? reportID; Tab.setSelectedTab(CONST.TAB.IOU_REQUEST_TYPE, CONST.IOU.REQUEST_TYPE.SCAN); - startMoneyRequest(CONST.IOU.TYPE.SUBMIT, quickActionReportID, CONST.IOU.REQUEST_TYPE.SCAN, !!policyChatForActivePolicy?.reportID, undefined, allTransactionDrafts); + startMoneyRequest(CONST.IOU.TYPE.CREATE, quickActionReportID, CONST.IOU.REQUEST_TYPE.SCAN, !!policyChatForActivePolicy?.reportID, undefined, allTransactionDrafts); }); }; diff --git a/src/pages/home/sidebar/FloatingActionButtonAndPopover.tsx b/src/pages/home/sidebar/FloatingActionButtonAndPopover.tsx index c4ff1c951ca43..d52416f980902 100644 --- a/src/pages/home/sidebar/FloatingActionButtonAndPopover.tsx +++ b/src/pages/home/sidebar/FloatingActionButtonAndPopover.tsx @@ -257,7 +257,7 @@ function FloatingActionButtonAndPopover({onHideCreateMenu, onShowCreateMenu, ref const quickActionReportID = policyChatForActivePolicy?.reportID ?? reportID; Tab.setSelectedTab(CONST.TAB.IOU_REQUEST_TYPE, CONST.IOU.REQUEST_TYPE.SCAN); - startMoneyRequest(CONST.IOU.TYPE.SUBMIT, quickActionReportID, CONST.IOU.REQUEST_TYPE.SCAN, !!policyChatForActivePolicy?.reportID, undefined, allTransactionDrafts); + startMoneyRequest(CONST.IOU.TYPE.CREATE, quickActionReportID, CONST.IOU.REQUEST_TYPE.SCAN, !!policyChatForActivePolicy?.reportID, undefined, allTransactionDrafts); }); }, [policyChatForActivePolicy?.policyID, policyChatForActivePolicy?.reportID, reportID, allTransactionDrafts]); diff --git a/src/pages/iou/request/step/IOURequestStepParticipants.tsx b/src/pages/iou/request/step/IOURequestStepParticipants.tsx index 1bb302ec2d332..b5d1c7b780f4a 100644 --- a/src/pages/iou/request/step/IOURequestStepParticipants.tsx +++ b/src/pages/iou/request/step/IOURequestStepParticipants.tsx @@ -356,7 +356,9 @@ function IOURequestStepParticipants({ Navigation.goBack(backTo); return; } - navigateToStartMoneyRequestStep(iouRequestType, iouType, initialTransactionID, reportID, action); + const iouTypeValue = iouRequestType === CONST.IOU.REQUEST_TYPE.MANUAL && action === CONST.IOU.ACTION.CREATE ? CONST.IOU.TYPE.CREATE : iouType; + + navigateToStartMoneyRequestStep(iouRequestType, iouTypeValue, initialTransactionID, reportID, action); }, [backTo, iouRequestType, iouType, initialTransactionID, reportID, action]); useEffect(() => { From 761e9eed7fdba16395d74426f3b270f7b39a919b Mon Sep 17 00:00:00 2001 From: Lukasz Modzelewski Date: Mon, 20 Oct 2025 15:14:42 +0200 Subject: [PATCH 4/4] Add stricter condition --- src/pages/iou/request/step/IOURequestStepParticipants.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/pages/iou/request/step/IOURequestStepParticipants.tsx b/src/pages/iou/request/step/IOURequestStepParticipants.tsx index b5d1c7b780f4a..6e616931f25c6 100644 --- a/src/pages/iou/request/step/IOURequestStepParticipants.tsx +++ b/src/pages/iou/request/step/IOURequestStepParticipants.tsx @@ -356,7 +356,11 @@ function IOURequestStepParticipants({ Navigation.goBack(backTo); return; } - const iouTypeValue = iouRequestType === CONST.IOU.REQUEST_TYPE.MANUAL && action === CONST.IOU.ACTION.CREATE ? CONST.IOU.TYPE.CREATE : iouType; + + // Change iouType param to enable negative values + const shouldForceIOUType = + action === CONST.IOU.ACTION.CREATE && iouType === CONST.IOU.TYPE.SUBMIT && (iouRequestType === CONST.IOU.REQUEST_TYPE.MANUAL || iouRequestType === CONST.IOU.REQUEST_TYPE.SCAN); + const iouTypeValue = shouldForceIOUType ? CONST.IOU.TYPE.CREATE : iouType; navigateToStartMoneyRequestStep(iouRequestType, iouTypeValue, initialTransactionID, reportID, action); }, [backTo, iouRequestType, iouType, initialTransactionID, reportID, action]);