Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: unify TBD-related logic for Distance requests #34135

Merged
merged 41 commits into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
f4aff81
Use transaction.isLoading to identify pending Distance requests
paultsimura Jan 9, 2024
152b569
Merge branch 'main' into fix/33362-is-loading-tbd
paultsimura Jan 9, 2024
b30a5e7
Use transaction.isLoading to identify pending Distance requests
paultsimura Jan 9, 2024
f68e06e
Merge branch 'main' into fix/33362-is-loading-tbd
paultsimura Jan 12, 2024
27e9415
Merge branch 'main' into fix/33362-is-loading-tbd
paultsimura Jan 16, 2024
46dec59
Rename isLoadingDistanceRequest -> isDistanceBeingCalculated
paultsimura Jan 16, 2024
c05c602
Merge branch 'main' into fix/33362-is-loading-tbd
paultsimura Jan 19, 2024
b87642a
Use "Route pending" instead of "TBD"
paultsimura Jan 19, 2024
5a24138
Fix the pending route logic in Distance e-Receipt
paultsimura Jan 19, 2024
dd94a01
Show the "Pending route..." as merchant for requests with manual amount
paultsimura Jan 20, 2024
cda5367
Merge branch 'main' into fix/33362-is-loading-tbd
paultsimura Jan 20, 2024
373c670
Update hasPendingRoute logic
paultsimura Jan 20, 2024
634b5fa
Update "Route pending" display based on amount
paultsimura Jan 20, 2024
f2a7a06
Revert some changes
paultsimura Jan 20, 2024
98ec065
Update IOU Report total on waypoints change
paultsimura Jan 21, 2024
5443b83
Merge branch 'main' into fix/33362-is-loading-tbd
paultsimura Jan 23, 2024
c6ed187
Use TransactionUtils.hasPendingRoute to check pending route for receipt
paultsimura Jan 23, 2024
6cdea23
Merge branch 'main' into fix/33362-is-loading-tbd
paultsimura Jan 24, 2024
0d72dde
Merge branch 'main' into fix/33362-is-loading-tbd
paultsimura Jan 26, 2024
3f3564c
Show "Route pending" when the rate is not loaded yet
paultsimura Jan 26, 2024
98c7b9b
Merge branch 'main' into fix/33362-is-loading-tbd
paultsimura Jan 27, 2024
9452819
Cosmetic change for readability
paultsimura Jan 27, 2024
db6e2a7
Merge branch 'main' into fix/33362-is-loading-tbd
paultsimura Jan 29, 2024
26da439
Merge branch 'main' into fix/33362-is-loading-tbd
paultsimura Jan 30, 2024
16f6b54
Change hasPendingRoute to isFetchingWaypointsFromServer
paultsimura Jan 30, 2024
646c97f
Merge branch 'main' into fix/33362-is-loading-tbd
paultsimura Feb 1, 2024
19d97aa
Update comment for readability
paultsimura Feb 1, 2024
42757dc
Merge branch 'main' into fix/33362-is-loading-tbd
paultsimura Feb 2, 2024
2cd2c52
Merge branch 'main' into fix/33362-is-loading-tbd
paultsimura Feb 2, 2024
3ff6f9a
Refactor checks for readability
paultsimura Feb 3, 2024
e63553c
Merge branch 'main' into fix/33362-is-loading-tbd
paultsimura Feb 5, 2024
e88d6d5
TS migration cleanup
paultsimura Feb 6, 2024
516ae47
Merge branch 'main' into fix/33362-is-loading-tbd
paultsimura Feb 6, 2024
d22cfe5
Merge branch 'main' into fix/33362-is-loading-tbd
paultsimura Feb 6, 2024
a020a23
Remove hasOnlyPendingDistanceRequests vars
paultsimura Feb 6, 2024
1c849c3
Merge branch 'main' into fix/33362-is-loading-tbd
paultsimura Feb 6, 2024
534b2c1
Explain the setMoneyRequestPendingFields call
paultsimura Feb 6, 2024
82bb06e
Merge branch 'main' into fix/33362-is-loading-tbd
paultsimura Feb 6, 2024
749a395
Merge branch 'main' into fix/33362-is-loading-tbd
paultsimura Feb 6, 2024
8d493e2
Merge branch 'main' into fix/33362-is-loading-tbd
paultsimura Feb 7, 2024
2e4c40f
Merge branch 'main' into fix/33362-is-loading-tbd
paultsimura Feb 7, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/components/DistanceEReceipt.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {ScrollView, View} from 'react-native';
import _ from 'underscore';
import EReceiptBackground from '@assets/images/eReceipt_background.svg';
import useLocalize from '@hooks/useLocalize';
import useNetwork from '@hooks/useNetwork';
import useTheme from '@hooks/useTheme';
import useThemeStyles from '@hooks/useThemeStyles';
import * as CurrencyUtils from '@libs/CurrencyUtils';
Expand Down Expand Up @@ -33,10 +32,10 @@ function DistanceEReceipt({transaction}) {
const theme = useTheme();
const styles = useThemeStyles();
const {translate} = useLocalize();
const {isOffline} = useNetwork();
const {thumbnail} = TransactionUtils.hasReceipt(transaction) ? ReceiptUtils.getThumbnailAndImageURIs(transaction) : {};
const {amount: transactionAmount, currency: transactionCurrency, merchant: transactionMerchant, created: transactionDate} = ReportUtils.getTransactionDetails(transaction);
const formattedTransactionAmount = transactionAmount ? CurrencyUtils.convertToDisplayString(transactionAmount, transactionCurrency) : translate('common.tbd');
const formattedTransactionAmount = CurrencyUtils.convertToDisplayString(transactionAmount, transactionCurrency);
const isFetchingWaypointsFromServer = TransactionUtils.isFetchingWaypointsFromServer(transaction);
paultsimura marked this conversation as resolved.
Show resolved Hide resolved
const thumbnailSource = tryResolveUrlFromApiRoot(thumbnail || '');
const waypoints = lodashGet(transaction, 'comment.waypoints', {});
const sortedWaypoints = useMemo(
Expand Down Expand Up @@ -64,7 +63,7 @@ function DistanceEReceipt({transaction}) {
/>

<View style={[styles.moneyRequestViewImage, styles.mh0, styles.mt0, styles.mb5, styles.borderNone]}>
{isOffline || !thumbnailSource ? (
{isFetchingWaypointsFromServer || !thumbnailSource ? (
<PendingMapView />
) : (
<ThumbnailImage
Expand All @@ -76,7 +75,7 @@ function DistanceEReceipt({transaction}) {
)}
</View>
<View style={[styles.mb10, styles.gap5, styles.ph2, styles.flexColumn, styles.alignItemsCenter]}>
<Text style={styles.eReceiptAmount}>{formattedTransactionAmount}</Text>
{!!transactionAmount && <Text style={styles.eReceiptAmount}>{formattedTransactionAmount}</Text>}
<Text style={styles.eReceiptMerchant}>{transactionMerchant}</Text>
</View>
<View style={[styles.mb10, styles.gap5, styles.ph2]}>
Expand Down
21 changes: 13 additions & 8 deletions src/components/MoneyRequestConfirmationList.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,9 +255,9 @@ function MoneyRequestConfirmationList(props) {
const shouldShowBillable = !lodashGet(props.policy, 'disabledFields.defaultBillable', true);

const hasRoute = TransactionUtils.hasRoute(transaction);
const isDistanceRequestWithoutRoute = props.isDistanceRequest && !hasRoute;
const formattedAmount = isDistanceRequestWithoutRoute
? translate('common.tbd')
const isDistanceRequestWithPendingRoute = props.isDistanceRequest && (!hasRoute || !rate);
paultsimura marked this conversation as resolved.
Show resolved Hide resolved
const formattedAmount = isDistanceRequestWithPendingRoute
? ''
: CurrencyUtils.convertToDisplayString(
shouldCalculateDistanceAmount ? DistanceRequestUtils.getDistanceRequestAmount(distance, unit, rate) : props.iouAmount,
props.isDistanceRequest ? currency : props.iouCurrencyCode,
Expand Down Expand Up @@ -332,7 +332,7 @@ function MoneyRequestConfirmationList(props) {
let text;
if (isSplitBill && props.iouAmount === 0) {
text = translate('iou.split');
} else if ((props.receiptPath && isTypeRequest) || isDistanceRequestWithoutRoute) {
} else if ((props.receiptPath && isTypeRequest) || isDistanceRequestWithPendingRoute) {
text = translate('iou.request');
if (props.iouAmount !== 0) {
text = translate('iou.requestAmount', {amount: formattedAmount});
Expand All @@ -347,7 +347,7 @@ function MoneyRequestConfirmationList(props) {
value: props.iouType,
},
];
}, [isSplitBill, isTypeRequest, props.iouType, props.iouAmount, props.receiptPath, formattedAmount, isDistanceRequestWithoutRoute, translate]);
}, [isSplitBill, isTypeRequest, props.iouType, props.iouAmount, props.receiptPath, formattedAmount, isDistanceRequestWithPendingRoute, translate]);

const selectedParticipants = useMemo(() => _.filter(props.selectedParticipants, (participant) => participant.selected), [props.selectedParticipants]);
const payeePersonalDetails = useMemo(() => props.payeePersonalDetails || props.currentUserPersonalDetails, [props.payeePersonalDetails, props.currentUserPersonalDetails]);
Expand Down Expand Up @@ -426,9 +426,14 @@ function MoneyRequestConfirmationList(props) {
if (!props.isDistanceRequest) {
return;
}

if (isDistanceRequestWithPendingRoute) {
IOU.setMoneyRequestPendingFields(props.transactionID, {waypoints: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD});
}

const distanceMerchant = DistanceRequestUtils.getDistanceMerchant(hasRoute, distance, unit, rate, currency, translate, toLocaleDigit);
IOU.setMoneyRequestMerchant_temporaryForRefactor(props.transactionID, distanceMerchant);
}, [hasRoute, distance, unit, rate, currency, translate, toLocaleDigit, props.isDistanceRequest, props.transactionID]);
}, [isDistanceRequestWithPendingRoute, hasRoute, distance, unit, rate, currency, translate, toLocaleDigit, props.isDistanceRequest, props.transactionID]);

/**
* @param {Object} option
Expand Down Expand Up @@ -482,7 +487,7 @@ function MoneyRequestConfirmationList(props) {
} else {
// validate the amount for distance requests
const decimals = CurrencyUtils.getCurrencyDecimals(props.iouCurrencyCode);
if (props.isDistanceRequest && !isDistanceRequestWithoutRoute && !MoneyRequestUtils.validateAmount(String(props.iouAmount), decimals)) {
if (props.isDistanceRequest && !isDistanceRequestWithPendingRoute && !MoneyRequestUtils.validateAmount(String(props.iouAmount), decimals)) {
setFormError('common.error.invalidAmount');
return;
}
Expand All @@ -505,7 +510,7 @@ function MoneyRequestConfirmationList(props) {
props.iouType,
props.isDistanceRequest,
props.iouCategory,
isDistanceRequestWithoutRoute,
isDistanceRequestWithPendingRoute,
props.iouCurrencyCode,
props.iouAmount,
transaction,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@ function MoneyTemporaryForRefactorRequestConfirmationList({
const shouldShowBillable = !lodashGet(policy, 'disabledFields.defaultBillable', true);

const hasRoute = TransactionUtils.hasRoute(transaction);
const isDistanceRequestWithoutRoute = isDistanceRequest && !hasRoute;
const formattedAmount = isDistanceRequestWithoutRoute
? translate('common.tbd')
const isDistanceRequestWithPendingRoute = isDistanceRequest && (!hasRoute || !rate);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why isn't this using isFetchingWaypointsFromServer()?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The isFetchingWaypointsFromServer depends on this variable, not vice versa:

if (isDistanceRequestWithPendingRoute) {
IOU.setMoneyRequestPendingFields(transaction.transactionID, {waypoints: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD});
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like that's kind of an anti pattern. I think we should only call actions based directly on user action, not based on data changing. Do you agree Tim?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But we already do call these actions in multiple places when landing on different steps of the IOU creation. Since in all these places we update the draft transaction, it looks more like a way to transfer the state between the IOU creation steps, and not an actual data modification.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I think you're both right. @paultsimura you're correct that this is more akin to storing the form state between steps. @neil-marcellini I think you might be onto something about this looking like an anti-pattern.

What do you think about this?

  • Instead of calling IOU.setMoneyRequestPendingFields(transaction.transactionID, {waypoints: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD}); on this page, set that data on the previous page when the user submits the form. I think it could be part of the data that gets set here:
    Transaction.updateWaypoints(transactionID, newWaypoints, true).then(() => {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue here is the following scenario:

The user completes the first steps up until the confirmation step while being offline. Then, on the confirmation step, they come back online. Here, the map should get fetched, and we no longer should have the waypoints pending (even though when we landed on this page, the map was still pending).

Copy link
Contributor

@tgolen tgolen Feb 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that darn offline flow gets confusing! Thanks for pointing that out. It's probably OK then, but I would ask that you also put that context into a code comment where it happens.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got you, thanks for taking your time on this. Updated ✔️

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then, on the confirmation step, they come back online. Here, the map should get fetched, and we no longer should have the waypoints pending

Thank you for explaining. I think that flow makes sense, but how does that relate to this condition? If we are offline and set the waypoints pending when they are updated (as Tim suggested), then when the user is navigated to this page the pending fields will show correctly. Once they go back online I would think that the GetRoute response should clear the pending fields for the waypoints (and or the route), and then all data on the confirmation page would no longer show as pending. Does that make sense?

I'm going to leave this as a NAB. We could fix it in a follow up if needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably yes, but I'm not sure where to attach the workspace rate being still loaded in this case. That being said, I would really appreciate it if we could merge this PR as-is if it's an NAB. It's my longest one so far 🙂

const formattedAmount = isDistanceRequestWithPendingRoute
? ''
: CurrencyUtils.convertToDisplayString(
shouldCalculateDistanceAmount ? DistanceRequestUtils.getDistanceRequestAmount(distance, unit, rate) : iouAmount,
isDistanceRequest ? currency : iouCurrencyCode,
Expand Down Expand Up @@ -376,7 +376,7 @@ function MoneyTemporaryForRefactorRequestConfirmationList({
let text;
if (isTypeSplit && iouAmount === 0) {
text = translate('iou.split');
} else if ((receiptPath && isTypeRequest) || isDistanceRequestWithoutRoute) {
} else if ((receiptPath && isTypeRequest) || isDistanceRequestWithPendingRoute) {
text = translate('iou.request');
if (iouAmount !== 0) {
text = translate('iou.requestAmount', {amount: formattedAmount});
Expand All @@ -391,7 +391,7 @@ function MoneyTemporaryForRefactorRequestConfirmationList({
value: iouType,
},
];
}, [isTypeSplit, isTypeRequest, iouType, iouAmount, receiptPath, formattedAmount, isDistanceRequestWithoutRoute, translate]);
}, [isTypeSplit, isTypeRequest, iouType, iouAmount, receiptPath, formattedAmount, isDistanceRequestWithPendingRoute, translate]);

const selectedParticipants = useMemo(() => _.filter(pickedParticipants, (participant) => participant.selected), [pickedParticipants]);
const personalDetailsOfPayee = useMemo(() => payeePersonalDetails || currentUserPersonalDetails, [payeePersonalDetails, currentUserPersonalDetails]);
Expand Down Expand Up @@ -473,9 +473,14 @@ function MoneyTemporaryForRefactorRequestConfirmationList({
if (!isDistanceRequest) {
return;
}

if (isDistanceRequestWithPendingRoute) {
IOU.setMoneyRequestPendingFields(transaction.transactionID, {waypoints: CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD});
}

const distanceMerchant = DistanceRequestUtils.getDistanceMerchant(hasRoute, distance, unit, rate, currency, translate, toLocaleDigit);
IOU.setMoneyRequestMerchant_temporaryForRefactor(transaction.transactionID, distanceMerchant);
}, [hasRoute, distance, unit, rate, currency, translate, toLocaleDigit, isDistanceRequest, transaction]);
}, [isDistanceRequestWithPendingRoute, hasRoute, distance, unit, rate, currency, translate, toLocaleDigit, isDistanceRequest, transaction]);

/**
* @param {Object} option
Expand Down Expand Up @@ -530,7 +535,7 @@ function MoneyTemporaryForRefactorRequestConfirmationList({
} else {
// validate the amount for distance requests
const decimals = CurrencyUtils.getCurrencyDecimals(iouCurrencyCode);
if (isDistanceRequest && !isDistanceRequestWithoutRoute && !MoneyRequestUtils.validateAmount(String(iouAmount), decimals)) {
if (isDistanceRequest && !isDistanceRequestWithPendingRoute && !MoneyRequestUtils.validateAmount(String(iouAmount), decimals)) {
setFormError('common.error.invalidAmount');
return;
}
Expand All @@ -555,7 +560,7 @@ function MoneyTemporaryForRefactorRequestConfirmationList({
onSendMoney,
iouCurrencyCode,
isDistanceRequest,
isDistanceRequestWithoutRoute,
isDistanceRequestWithPendingRoute,
iouAmount,
isEditingSplitBill,
onConfirm,
Expand Down
2 changes: 1 addition & 1 deletion src/components/ReportActionItem/MoneyReportView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function MoneyReportView({report, policy, policyReportFields, shouldShowHorizont
const {totalDisplaySpend, nonReimbursableSpend, reimbursableSpend} = ReportUtils.getMoneyRequestSpendBreakdown(report);

const shouldShowBreakdown = nonReimbursableSpend && reimbursableSpend;
const formattedTotalAmount = CurrencyUtils.convertToDisplayString(totalDisplaySpend, report.currency, ReportUtils.hasOnlyDistanceRequestTransactions(report.reportID));
const formattedTotalAmount = CurrencyUtils.convertToDisplayString(totalDisplaySpend, report.currency);
const formattedOutOfPocketAmount = CurrencyUtils.convertToDisplayString(reimbursableSpend, report.currency);
const formattedCompanySpendAmount = CurrencyUtils.convertToDisplayString(nonReimbursableSpend, report.currency);

Expand Down
25 changes: 16 additions & 9 deletions src/components/ReportActionItem/MoneyRequestPreview.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,20 +165,27 @@ function MoneyRequestPreview(props) {
const isScanning = hasReceipt && TransactionUtils.isReceiptBeingScanned(props.transaction);
const hasFieldErrors = TransactionUtils.hasMissingSmartscanFields(props.transaction);
const isDistanceRequest = TransactionUtils.isDistanceRequest(props.transaction);
const isFetchingWaypointsFromServer = TransactionUtils.isFetchingWaypointsFromServer(props.transaction);
const isExpensifyCardTransaction = TransactionUtils.isExpensifyCardTransaction(props.transaction);
const isSettled = ReportUtils.isSettled(props.iouReport.reportID);
const isDeleted = lodashGet(props.action, 'pendingAction', null) === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE;

// Show the merchant for IOUs and expenses only if they are custom or not related to scanning smartscan
const shouldShowMerchant = !_.isEmpty(requestMerchant) && requestMerchant !== CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT && requestMerchant !== CONST.TRANSACTION.DEFAULT_MERCHANT;
/*
Show the merchant for IOUs and expenses only if:
- the merchant is not empty, is custom or not related to scanning smartscan;
paultsimura marked this conversation as resolved.
Show resolved Hide resolved
- the request is not a distance request with a pending route and amount = 0 - in this case,
the merchant says: "Route pending...", which is already shown in the amount field;
*/
const shouldShowMerchant =
!_.isEmpty(requestMerchant) &&
requestMerchant !== CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT &&
requestMerchant !== CONST.TRANSACTION.DEFAULT_MERCHANT &&
!(isDistanceRequest && isFetchingWaypointsFromServer && !requestAmount);
const shouldShowDescription = !_.isEmpty(description) && !shouldShowMerchant && !isScanning;
const hasPendingWaypoints = lodashGet(props.transaction, 'pendingFields.waypoints', null);

let merchantOrDescription = requestMerchant;
if (!shouldShowMerchant) {
merchantOrDescription = description || '';
} else if (hasPendingWaypoints) {
merchantOrDescription = requestMerchant.replace(CONST.REGEX.FIRST_SPACE, translate('common.tbd'));
}

const receiptImages = hasReceipt ? [ReceiptUtils.getThumbnailAndImageURIs(props.transaction)] : [];
Expand Down Expand Up @@ -227,14 +234,14 @@ function MoneyRequestPreview(props) {
};

const getDisplayAmountText = () => {
if (isDistanceRequest) {
return requestAmount && !hasPendingWaypoints ? CurrencyUtils.convertToDisplayString(requestAmount, requestCurrency) : translate('common.tbd');
}

if (isScanning) {
return translate('iou.receiptScanning');
}

if (isFetchingWaypointsFromServer && !requestAmount) {
return translate('iou.routePending');
}

if (!isSettled && TransactionUtils.hasMissingSmartscanFields(props.transaction)) {
return Localize.translateLocal('iou.receiptMissingDetails');
}
Expand Down
8 changes: 2 additions & 6 deletions src/components/ReportActionItem/MoneyRequestView.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,7 @@ function MoneyRequestView({report, parentReport, parentReportActions, policyCate
} = ReportUtils.getTransactionDetails(transaction);
const isEmptyMerchant = transactionMerchant === '' || transactionMerchant === CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT;
const isDistanceRequest = TransactionUtils.isDistanceRequest(transaction);
let formattedTransactionAmount = transactionAmount ? CurrencyUtils.convertToDisplayString(transactionAmount, transactionCurrency) : '';
const hasPendingWaypoints = lodashGet(transaction, 'pendingFields.waypoints', null);
if (isDistanceRequest && (!formattedTransactionAmount || hasPendingWaypoints)) {
formattedTransactionAmount = translate('common.tbd');
}
const formattedTransactionAmount = transactionAmount ? CurrencyUtils.convertToDisplayString(transactionAmount, transactionCurrency) : '';
const formattedOriginalAmount = transactionOriginalAmount && transactionOriginalCurrency && CurrencyUtils.convertToDisplayString(transactionOriginalAmount, transactionOriginalCurrency);
const isCardTransaction = TransactionUtils.isCardTransaction(transaction);
const cardProgramName = isCardTransaction ? CardUtils.getCardDescription(transactionCardID) : '';
Expand Down Expand Up @@ -305,7 +301,7 @@ function MoneyRequestView({report, parentReport, parentReportActions, policyCate
<OfflineWithFeedback pendingAction={lodashGet(transaction, 'pendingFields.waypoints') || lodashGet(transaction, 'pendingAction')}>
<MenuItemWithTopDescription
description={translate('common.distance')}
title={hasPendingWaypoints ? transactionMerchant.replace(CONST.REGEX.FIRST_SPACE, translate('common.tbd')) : transactionMerchant}
title={transactionMerchant}
interactive={canEditDistance}
shouldShowRightIcon={canEditDistance}
titleStyle={styles.flex1}
Expand Down
Loading
Loading