Skip to content

[Attendees Tracking] - More follow up issues #61484

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

Merged
merged 3 commits into from
May 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion src/components/MoneyRequestConfirmationList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ function MoneyRequestConfirmationList({
? ''
: convertToDisplayString(shouldCalculateDistanceAmount ? distanceRequestAmount : iouAmount, isDistanceRequest ? currency : iouCurrencyCode);
const formattedAmountPerAttendee =
isDistanceRequestWithPendingRoute || isScanRequest
isDistanceRequestWithPendingRoute || isScanRequest || isPerDiemRequest
? ''
: convertToDisplayString(
(shouldCalculateDistanceAmount ? distanceRequestAmount : iouAmount) / (iouAttendees?.length && iouAttendees.length > 0 ? iouAttendees.length : 1),
Expand Down
8 changes: 4 additions & 4 deletions src/components/ReportActionItem/MoneyRequestView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ function MoneyRequestView({report, shouldShowAnimatedBackground, readonly = fals
const shouldDisplayTransactionAmount = ((isDistanceRequest && hasRoute) || !!transactionAmount) && transactionAmount !== undefined;
const formattedTransactionAmount = shouldDisplayTransactionAmount ? convertToDisplayString(transactionAmount, transactionCurrency) : '';
const formattedPerAttendeeAmount =
shouldDisplayTransactionAmount && !isReceiptBeingScanned && didReceiptScanSucceed
shouldDisplayTransactionAmount && ((hasReceipt && !isReceiptBeingScanned && didReceiptScanSucceed) || !isPerDiemRequest)
? convertToDisplayString(transactionAmount / (transactionAttendees?.length ?? 1), transactionCurrency)
: '';
const formattedOriginalAmount = transactionOriginalAmount && transactionOriginalCurrency && convertToDisplayString(transactionOriginalAmount, transactionOriginalCurrency);
Expand Down Expand Up @@ -759,11 +759,10 @@ function MoneyRequestView({report, shouldShowAnimatedBackground, readonly = fals
<OfflineWithFeedback pendingAction={getPendingFieldAction('attendees')}>
<MenuItemWithTopDescription
key="attendees"
shouldShowRightIcon
title={Array.isArray(transactionAttendees) ? transactionAttendees.map((item) => item?.displayName ?? item?.login).join(', ') : ''}
description={`${translate('iou.attendees')} ${
Array.isArray(transactionAttendees) && transactionAttendees.length > 1 && formattedPerAttendeeAmount
? `${formattedPerAttendeeAmount} ${translate('common.perPerson')}`
? `${CONST.DOT_SEPARATOR} ${formattedPerAttendeeAmount} ${translate('common.perPerson')}`
: ''
}`}
style={[styles.moneyRequestMenuItem]}
Expand All @@ -774,7 +773,8 @@ function MoneyRequestView({report, shouldShowAnimatedBackground, readonly = fals
}
Navigation.navigate(ROUTES.MONEY_REQUEST_ATTENDEE.getRoute(CONST.IOU.ACTION.EDIT, iouType, transaction.transactionID, report.reportID));
}}
interactive
interactive={canEdit}
shouldShowRightIcon={canEdit}
shouldRenderAsHTML
/>
</OfflineWithFeedback>
Expand Down
7 changes: 3 additions & 4 deletions src/libs/TransactionUtils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -325,10 +325,9 @@ function isMerchantMissing(transaction: OnyxEntry<Transaction>) {

// eslint-disable-next-line @typescript-eslint/no-unused-vars
function shouldShowAttendees(iouType: IOUType, policy: OnyxEntry<Policy>): boolean {
return false;
// To be renabled once feature is complete: https://github.com/Expensify/App/issues/44725
// Keep this disabled for per diem expense
return iouType === CONST.IOU.TYPE.SUBMIT && !!policy?.id && (policy?.type === CONST.POLICY.TYPE.CORPORATE || policy?.type === CONST.POLICY.TYPE.TEAM);
return (
(iouType === CONST.IOU.TYPE.SUBMIT || iouType === CONST.IOU.TYPE.CREATE) && !!policy?.id && (policy?.type === CONST.POLICY.TYPE.CORPORATE || policy?.type === CONST.POLICY.TYPE.TEAM)
);
}

/**
Expand Down
9 changes: 8 additions & 1 deletion src/pages/iou/request/MoneyRequestAttendeeSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,16 @@ function MoneyRequestAttendeeSelector({attendees = [], onFinish, onAttendeesAdde
maxRecentReportsToShow: CONST.IOU.MAX_RECENT_REPORTS_TO_SHOW,
preferPolicyExpenseChat: isPaidGroupPolicy,
shouldAcceptName: true,
selectedOptions: attendees.map((attendee) => ({
...attendee,
reportID: CONST.DEFAULT_NUMBER_ID.toString(),
selected: true,
login: attendee.email,
...getPersonalDetailByEmail(attendee.email),
})),
});
return newOptions;
}, [areOptionsInitialized, defaultOptions, cleanSearchTerm, isPaidGroupPolicy]);
}, [areOptionsInitialized, defaultOptions, cleanSearchTerm, isPaidGroupPolicy, attendees]);

/**
* Returns the sections needed for the OptionsSelector
Expand Down