diff --git a/src/components/MoneyRequestConfirmationList.js b/src/components/MoneyRequestConfirmationList.js index 51467d4012e5..7dddbc28aeaf 100755 --- a/src/components/MoneyRequestConfirmationList.js +++ b/src/components/MoneyRequestConfirmationList.js @@ -290,6 +290,12 @@ function MoneyRequestConfirmationList(props) { return [...selectedParticipants, OptionsListUtils.getIOUConfirmationOptionsFromPayeePersonalDetail(payeePersonalDetails)]; }, [selectedParticipants, props.hasMultipleParticipants, payeePersonalDetails]); + const distanceMerchant = useMemo(() => DistanceRequestUtils.getDistanceMerchant(distance, unit, rate, currency, translate), [distance, unit, rate, currency, translate]); + + useEffect(() => { + IOU.setMoneyRequestMerchant(distanceMerchant); + }, [distanceMerchant]); + /** * @param {Object} option */ @@ -457,7 +463,7 @@ function MoneyRequestConfirmationList(props) { {props.isDistanceRequest ? ( transaction.reportID === reportID); + // `reportID` from the `/CreateDistanceRequest` endpoint return's number instead of string for created `transaction`. + // For reference, https://github.com/Expensify/App/pull/26536#issuecomment-1703573277. + // We will update this in a follow-up Issue. According to this comment: https://github.com/Expensify/App/pull/26536#issuecomment-1703591019. + return _.filter(allTransactions, (transaction) => `${transaction.reportID}` === `${reportID}`); } /** diff --git a/src/libs/actions/IOU.js b/src/libs/actions/IOU.js index 9eb3658e3e53..610e67a9c565 100644 --- a/src/libs/actions/IOU.js +++ b/src/libs/actions/IOU.js @@ -504,16 +504,19 @@ function getMoneyRequestInformation( * @param {String} comment * @param {String} created * @param {String} [transactionID] + * @param {Number} amount + * @param {String} currency + * @param {String} merchant */ -function createDistanceRequest(report, participant, comment, created, transactionID) { +function createDistanceRequest(report, participant, comment, created, transactionID, amount, currency, merchant) { const {iouReport, chatReport, transaction, iouAction, createdChatReportActionID, createdIOUReportActionID, reportPreviewAction, onyxData} = getMoneyRequestInformation( report, participant, comment, - 0, - 'USD', + amount, + currency, created, - '', + merchant, null, null, null, diff --git a/src/pages/iou/steps/MoneyRequestConfirmPage.js b/src/pages/iou/steps/MoneyRequestConfirmPage.js index 8c063df63056..15cb7632714e 100644 --- a/src/pages/iou/steps/MoneyRequestConfirmPage.js +++ b/src/pages/iou/steps/MoneyRequestConfirmPage.js @@ -144,9 +144,18 @@ function MoneyRequestConfirmPage(props) { */ const createDistanceRequest = useCallback( (selectedParticipants, trimmedComment) => { - IOU.createDistanceRequest(props.report, selectedParticipants[0], trimmedComment, props.iou.created, props.iou.transactionID); + IOU.createDistanceRequest( + props.report, + selectedParticipants[0], + trimmedComment, + props.iou.created, + props.iou.transactionID, + props.iou.amount, + props.iou.currency, + props.iou.merchant, + ); }, - [props.report, props.iou.created, props.iou.transactionID], + [props.report, props.iou.created, props.iou.transactionID, props.iou.amount, props.iou.currency, props.iou.merchant], ); const createTransaction = useCallback(