Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
c618237
Add main change for the feature
ZhenjaHorbach Mar 6, 2026
24fcc89
Fix 0 reportID for new selfDM splits
ZhenjaHorbach Mar 6, 2026
b8a221b
Fix lint issues and revert reportID changes for selfDM splits
ZhenjaHorbach Mar 9, 2026
6cb08e4
Fix conflicts
ZhenjaHorbach Mar 13, 2026
1bc30c6
Fix prettier
ZhenjaHorbach Mar 13, 2026
f6aa247
Fix lint issues
ZhenjaHorbach Mar 13, 2026
6f491d6
Fix optimistic issues during reverting
ZhenjaHorbach Mar 13, 2026
3d4369c
Fix conflicts
ZhenjaHorbach Mar 19, 2026
6cc1cd7
Fix getChildTransactions using
ZhenjaHorbach Mar 20, 2026
4e00ea6
Fix conflicts
ZhenjaHorbach Mar 20, 2026
45820dc
Fix issues with selfDMReportIDs
ZhenjaHorbach Mar 20, 2026
58f960e
Fix conflicts
ZhenjaHorbach Mar 23, 2026
0886cb7
Fix issues with dublication transactions
ZhenjaHorbach Mar 23, 2026
83f7ab9
Fix conflicts
ZhenjaHorbach Mar 25, 2026
89b53d1
Fix a few issues with selfDm splits
ZhenjaHorbach Mar 25, 2026
33e4079
Fix a few issues with selfDm splits x2
ZhenjaHorbach Mar 25, 2026
d449ec3
Fix conflicts
ZhenjaHorbach Mar 25, 2026
2b926a6
Fix lint issues
ZhenjaHorbach Mar 25, 2026
2264cd4
Fix comments
ZhenjaHorbach Mar 26, 2026
b00ae30
Fix conflicts
ZhenjaHorbach Mar 31, 2026
5ebfe73
Fix issues with removing splits on selfdm screen
ZhenjaHorbach Apr 1, 2026
dc77015
Fix issue with negative original amount
ZhenjaHorbach Apr 1, 2026
18a4ae7
Fix issue with expenses on report screen
ZhenjaHorbach Apr 1, 2026
569001e
Fix issue with successData for original transaction
ZhenjaHorbach Apr 2, 2026
24ef703
Fix conflicts
ZhenjaHorbach Apr 2, 2026
3e25c21
Fix conflicts x2
ZhenjaHorbach Apr 2, 2026
65e4c64
Fix issues with search hash
ZhenjaHorbach Apr 2, 2026
76c7e3f
Fix conflicts
ZhenjaHorbach Apr 2, 2026
590cbd6
Fix issues with selfDM splits
ZhenjaHorbach Apr 2, 2026
0823ee8
Merge branch 'main' into add-support-unreported-expenses-for-splits
ZhenjaHorbach Apr 4, 2026
358ff06
Fix conflicts
ZhenjaHorbach Apr 6, 2026
51c4210
Fix comments
ZhenjaHorbach Apr 8, 2026
72642b0
Fix bugs
ZhenjaHorbach Apr 8, 2026
7f53154
Fix conflicts
ZhenjaHorbach Apr 8, 2026
ca80c27
Fix rate issues
ZhenjaHorbach Apr 8, 2026
cbf3239
Merge branch 'main' into add-support-unreported-expenses-for-splits
ZhenjaHorbach Apr 10, 2026
d5d1995
Fix issues with map distances for selfDM splits
ZhenjaHorbach Apr 10, 2026
c9c2fec
Fix conflicts
ZhenjaHorbach Apr 13, 2026
34712f6
Fix comments
ZhenjaHorbach Apr 13, 2026
a9b4002
Fix rates
ZhenjaHorbach Apr 13, 2026
a2e211b
Fix issue with revert negative ammounts
ZhenjaHorbach Apr 13, 2026
c1619b0
Fix spellcheck
ZhenjaHorbach Apr 13, 2026
4a5ef95
Fix issue with revert selfDM split amount
ZhenjaHorbach Apr 13, 2026
87888f3
Fix conflicts
ZhenjaHorbach Apr 16, 2026
bf82460
Fix few issues
ZhenjaHorbach Apr 17, 2026
b82cc4a
Update tests
ZhenjaHorbach Apr 17, 2026
06d2017
Fix shanpshot ids for splits
ZhenjaHorbach Apr 17, 2026
0eaeaa1
Update tags and categories logic for selfDM splits
ZhenjaHorbach Apr 17, 2026
9ec5989
Fix conflicts
ZhenjaHorbach Apr 21, 2026
43d732d
Fix conflicts x2
ZhenjaHorbach Apr 21, 2026
620f97f
Merge branch 'main' into add-support-unreported-expenses-for-splits
ZhenjaHorbach Apr 22, 2026
4ca2e67
Fix few bugs
ZhenjaHorbach Apr 22, 2026
0891539
Fix tests and update comment counts
ZhenjaHorbach Apr 22, 2026
2c1cbe4
Fix counter for selfDM splits
ZhenjaHorbach Apr 23, 2026
20c3fed
Fix conflicts
ZhenjaHorbach Apr 23, 2026
0c9c7d6
Fix tests
ZhenjaHorbach Apr 23, 2026
43c85b9
Merge branch 'main' into add-support-unreported-expenses-for-splits
ZhenjaHorbach Apr 24, 2026
43ddd15
Fix bug with empty report after removing last split in this report
ZhenjaHorbach Apr 24, 2026
8f33c88
Fix conflicts
ZhenjaHorbach Apr 28, 2026
3294925
Fix conflicts x2
ZhenjaHorbach Apr 28, 2026
bc91777
Merge branch 'main' into add-support-unreported-expenses-for-splits
ZhenjaHorbach Apr 28, 2026
a6f9b42
Fix lint issues
ZhenjaHorbach Apr 28, 2026
bc922da
Merge branch 'main' into add-support-unreported-expenses-for-splits
ZhenjaHorbach Apr 28, 2026
e496eb6
fix conflicts
ZhenjaHorbach Apr 29, 2026
3ce4c1e
Pass parent report to isSplitActions
ZhenjaHorbach Apr 29, 2026
e421576
Merge branch 'main' into add-support-unreported-expenses-for-splits
ZhenjaHorbach Apr 29, 2026
26bf3bb
Fix issue with split button for selfDM in search screen
ZhenjaHorbach Apr 30, 2026
c795a80
Fix conflicts
ZhenjaHorbach May 1, 2026
6782c4f
Fix lint issue
ZhenjaHorbach May 1, 2026
72be83e
Fix conflicts
ZhenjaHorbach May 4, 2026
db89987
Fix lint issue
ZhenjaHorbach May 4, 2026
aef5b49
Fix conflicts
ZhenjaHorbach May 5, 2026
d548531
Fix lint issue
ZhenjaHorbach May 5, 2026
c4c2426
Merge branch 'main' into add-support-unreported-expenses-for-splits
ZhenjaHorbach May 5, 2026
42b591e
Fix conflicts
ZhenjaHorbach May 6, 2026
15a6a1b
Fix conflicts
ZhenjaHorbach May 7, 2026
d17bdaf
Fix lint issues
ZhenjaHorbach May 7, 2026
815005b
Merge branch 'main' into add-support-unreported-expenses-for-splits
ZhenjaHorbach May 7, 2026
1126416
Fix conflicts
ZhenjaHorbach May 11, 2026
a36daac
Fix conflicts
ZhenjaHorbach May 11, 2026
b5300fa
Fix a few bugs
ZhenjaHorbach May 11, 2026
d3fd96c
Reuse selfDMReportID for updateSplitTransactionsFromSplitExpensesFlow
ZhenjaHorbach May 12, 2026
b7e905e
Fix conflicts
ZhenjaHorbach May 12, 2026
9605164
Fix selfDM with invalid rates
ZhenjaHorbach May 12, 2026
1194d73
Fix lint issues
ZhenjaHorbach May 12, 2026
dae0b85
Fix tests
ZhenjaHorbach May 12, 2026
d7d3dec
Fix visual glitch after creating splits
ZhenjaHorbach May 13, 2026
f122e58
Refactor code
ZhenjaHorbach May 14, 2026
8b4ce90
Fix conflicts
ZhenjaHorbach May 14, 2026
9e5d610
Fix issues with removed rates
ZhenjaHorbach May 14, 2026
9bc5ec3
Fix conflicts
ZhenjaHorbach May 15, 2026
f98a2a5
Fix issues with split reverting
ZhenjaHorbach May 15, 2026
5b7eb16
Merge branch 'main' into add-support-unreported-expenses-for-splits
ZhenjaHorbach May 15, 2026
3ef755f
Fix ts issue
ZhenjaHorbach May 15, 2026
59e3ef8
Fix comments and improve logic for splits withouts workspaces
ZhenjaHorbach May 16, 2026
79acef0
Merge branch 'main' into add-support-unreported-expenses-for-splits
ZhenjaHorbach May 18, 2026
e94cca4
Fix bugs with negative amount and with tags
ZhenjaHorbach May 18, 2026
d5b38d8
Fix spellcheck issues
ZhenjaHorbach May 18, 2026
a086175
Fix conflicts
ZhenjaHorbach May 19, 2026
b28c8dc
Fix issue with reverted selfDM reportID
ZhenjaHorbach May 19, 2026
2c88c22
Fix conflicts
ZhenjaHorbach May 20, 2026
6f63da4
Fix issue with reverted transaction
ZhenjaHorbach May 20, 2026
a94ab19
Fix conflicts
ZhenjaHorbach May 21, 2026
014af88
Refactor code to make policy and report required for initSplitExpense
ZhenjaHorbach May 21, 2026
5ac0f08
Fix SplitDistanceMessageTest tests
ZhenjaHorbach May 21, 2026
2ff7afe
Fix delete buttons in more menu for per diem selfdm splits
ZhenjaHorbach May 22, 2026
d1b08b6
Fix conlifcts
ZhenjaHorbach May 22, 2026
96166db
Fix conlifcts
ZhenjaHorbach May 25, 2026
5bfb8e2
Fix bug with removed perDiem selfDM splits in offline mode
ZhenjaHorbach May 25, 2026
bb99f97
Update navigatin logic after pressing category on edit split screen
ZhenjaHorbach May 25, 2026
a57d8e6
Fix issues with spend
ZhenjaHorbach May 25, 2026
3d14e2f
Fix conflicts
ZhenjaHorbach May 25, 2026
94af5a9
Fix conflicts x2
ZhenjaHorbach May 25, 2026
1865b81
Fix conflicts x3
ZhenjaHorbach May 25, 2026
e0add02
Merge branch 'main' into add-support-unreported-expenses-for-splits
ZhenjaHorbach May 25, 2026
61880a9
Merge branch 'main' into add-support-unreported-expenses-for-splits
ZhenjaHorbach May 26, 2026
d3bd261
Fix lint issues
ZhenjaHorbach May 26, 2026
09f616c
Fix comments
ZhenjaHorbach May 26, 2026
fa1604b
Fix comments x2
ZhenjaHorbach May 26, 2026
d6b0bf5
Merge branch 'main' into add-support-unreported-expenses-for-splits
ZhenjaHorbach May 26, 2026
8deebef
Merge branch 'main' into add-support-unreported-expenses-for-splits
ZhenjaHorbach May 27, 2026
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
22 changes: 12 additions & 10 deletions src/components/MoneyRequestHeaderSecondaryActions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ function MoneyRequestHeaderSecondaryActions({reportID, onBackButtonPress}: Money
// Per-key Onyx subscriptions
const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`);
const [parentReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${report?.parentReportID}`);
const [grandParentReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${parentReport?.parentReportID}`);
const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`);
const [parentReportActions] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report?.parentReportID}`);
const parentReportAction = report?.parentReportActionID ? parentReportActions?.[report.parentReportActionID] : undefined;
Expand Down Expand Up @@ -275,18 +276,19 @@ function MoneyRequestHeaderSecondaryActions({reportID, onBackButtonPress}: Money
if (!transaction || !parentReportAction || !parentReport) {
return [];
}
return getSecondaryTransactionThreadActions(
currentUserLogin ?? '',
accountID,
return getSecondaryTransactionThreadActions({
currentUserLogin: currentUserLogin ?? '',
currentUserAccountID: accountID,
parentReport,
transaction,
parentReportAction,
reportTransaction: transaction,
reportAction: parentReportAction,
originalTransaction,
policy,
report,
transactionThreadReport: report,
outstandingReportsByPolicyID,
isChatIOUReportArchived,
);
isChatReportArchived: isChatIOUReportArchived,
grandParentReport,
});
})();

const secondaryActionsImplementation: Partial<
Expand Down Expand Up @@ -338,7 +340,7 @@ function MoneyRequestHeaderSecondaryActions({reportID, onBackButtonPress}: Money
icon: expensifyIcons.ArrowSplit,
value: CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS.SPLIT,
onSelected: () => {
initSplitExpense(transaction, policy);
initSplitExpense(transaction, policy, report);
},
},
[CONST.REPORT.TRANSACTION_SECONDARY_ACTIONS.MERGE]: {
Expand Down Expand Up @@ -438,7 +440,7 @@ function MoneyRequestHeaderSecondaryActions({reportID, onBackButtonPress}: Money
}
const backToRoute = route.params?.backTo ?? Navigation.getActiveRoute();
setDeleteTransactionNavigateBackUrl(backToRoute);
if (isTrackExpenseAction(parentReportAction)) {
if (isTrackExpenseAction(parentReportAction) && !isExpenseSplit) {
deleteTrackExpense({
chatReportID: report?.parentReportID,
chatReport: parentReport,
Expand Down
2 changes: 1 addition & 1 deletion src/components/ReportActionItem/MoneyRequestView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -956,7 +956,7 @@ function MoneyRequestView({
}

if (shouldShowSplitIndicator && isSplitAvailable) {
initSplitExpense(transaction, policy);
initSplitExpense(transaction, policy, transactionThreadReport);
return;
}

Expand Down
76 changes: 66 additions & 10 deletions src/components/Search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import useResponsiveLayout from '@hooks/useResponsiveLayout';
import useSaveSortedReportIDs from '@hooks/useSaveSortedReportIDs';
import useSearchHighlightAndScroll from '@hooks/useSearchHighlightAndScroll';
import useSearchShouldCalculateTotals from '@hooks/useSearchShouldCalculateTotals';
import useSelfDMReport from '@hooks/useSelfDMReport';
import useStableArrayReference from '@hooks/useStableArrayReference';
import useThemeStyles from '@hooks/useThemeStyles';
import {turnOffMobileSelectionMode, turnOnMobileSelectionMode} from '@libs/actions/MobileSelectionMode';
Expand Down Expand Up @@ -79,7 +80,7 @@ import ROUTES from '@src/ROUTES';
import SCREENS from '@src/SCREENS';
import {columnsSelector} from '@src/selectors/AdvancedSearchFiltersForm';
import {hasCompletedGuidedSetupFlowSelector, hasSeenTourSelector} from '@src/selectors/Onboarding';
import type {OutstandingReportsByPolicyIDDerivedValue, SaveSearch, Transaction} from '@src/types/onyx';
import type {OutstandingReportsByPolicyIDDerivedValue, Report, SaveSearch, Transaction} from '@src/types/onyx';
import type {PaymentMethodType} from '@src/types/onyx/OriginalMessage';
import type SearchResults from '@src/types/onyx/SearchResults';
import {isEmptyObject} from '@src/types/utils/EmptyObject';
Expand Down Expand Up @@ -125,10 +126,14 @@ function mapTransactionItemToSelectedEntry(
currentUserAccountID: number,
outstandingReportsByPolicyID?: OutstandingReportsByPolicyIDDerivedValue,
allowNegativeAmount = true,
parentReport?: OnyxEntry<Report>,
selfDMReport?: OnyxEntry<Report>,
): [string, SelectedTransactionInfo] {
const {canHoldRequest, canUnholdRequest} = canHoldUnholdReportAction(item.report, item.reportAction, item.holdReportAction, item, item.policy, currentUserAccountID);
const canRejectRequest = item.report ? canRejectReportAction(currentUserLogin, item.report) : false;
const amount = hasValidModifiedAmount(item) ? Number(item.modifiedAmount) : item.amount;
const isUnreported = item.reportID === CONST.REPORT.UNREPORTED_REPORT_ID;
const reportForSplit = item.report ?? (isUnreported ? selfDMReport : undefined);

return [
item.keyForList,
Expand All @@ -139,7 +144,7 @@ function mapTransactionItemToSelectedEntry(
canHold: canHoldRequest,
isHeld: isOnHold(item),
canUnhold: canUnholdRequest,
canSplit: isSplitAction(item.report, [itemTransaction], originalItemTransaction, currentUserLogin, currentUserAccountID, item.policy),
canSplit: isSplitAction(reportForSplit, [itemTransaction], originalItemTransaction, currentUserLogin, currentUserAccountID, item.policy, parentReport),
hasBeenSplit: getOriginalTransactionWithSplitInfo(itemTransaction, originalItemTransaction).isExpenseSplit,
canChangeReport: canEditFieldOfMoneyRequest({
reportAction: item.reportAction,
Expand Down Expand Up @@ -196,6 +201,8 @@ function prepareTransactionsList(
currentUserLogin: string,
currentUserAccountID: number,
outstandingReportsByPolicyID?: OutstandingReportsByPolicyIDDerivedValue,
parentReport?: OnyxEntry<Report>,
selfDMReport?: OnyxEntry<Report>,
) {
if (selectedTransactions[item.keyForList]?.isSelected) {
const {[item.keyForList]: omittedTransaction, ...transactions} = selectedTransactions;
Expand All @@ -211,6 +218,8 @@ function prepareTransactionsList(
currentUserAccountID,
outstandingReportsByPolicyID,
false,
parentReport,
selfDMReport,
);

return {
Expand Down Expand Up @@ -263,6 +272,7 @@ function Search({
const [violations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS);
const [policies] = useOnyx(ONYXKEYS.COLLECTION.POLICY);
const {accountID, email, login} = useCurrentUserPersonalDetails();
const selfDMReport = useSelfDMReport();
const isActionLoadingSet = useActionLoadingReportIDs();
const [allReportMetadata] = useOnyx(ONYXKEYS.COLLECTION.REPORT_METADATA);
const [visibleColumns] = useOnyx(ONYXKEYS.FORMS.SEARCH_ADVANCED_FILTERS_FORM, {selector: columnsSelector});
Expand Down Expand Up @@ -786,14 +796,17 @@ function Search({
const originalItemTransaction =
searchResults?.data?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${itemTransaction?.comment?.originalTransactionID}`] ??
transactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${itemTransaction?.comment?.originalTransactionID}`];
const itemParentReport = searchResults?.data?.[`${ONYXKEYS.COLLECTION.REPORT}${transactionItem.report?.parentReportID}`] as OnyxEntry<Report>;
const isItemUnreported = transactionItem.reportID === CONST.REPORT.UNREPORTED_REPORT_ID;
const reportForSplit = transactionItem.report ?? (isItemUnreported ? selfDMReport : undefined);

newTransactionList[transactionItem.transactionID] = {
transaction: transactionItem,
action: transactionItem.action,
canHold: canHoldRequest,
isHeld: isOnHold(transactionItem),
canUnhold: canUnholdRequest,
canSplit: isSplitAction(transactionItem.report, [itemTransaction], originalItemTransaction, login ?? '', accountID, transactionItem.policy),
canSplit: isSplitAction(reportForSplit, [itemTransaction], originalItemTransaction, login ?? '', accountID, transactionItem.policy, itemParentReport),
hasBeenSplit: getOriginalTransactionWithSplitInfo(itemTransaction, originalItemTransaction).isExpenseSplit,
canChangeReport: canEditFieldOfMoneyRequest({
reportAction: transactionItem.reportAction,
Expand Down Expand Up @@ -842,14 +855,17 @@ function Search({

const itemTransaction = searchResults?.data?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionItem.transactionID}`] as OnyxEntry<Transaction>;
const originalItemTransaction = searchResults?.data?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${itemTransaction?.comment?.originalTransactionID}`];
const itemParentReport = searchResults?.data?.[`${ONYXKEYS.COLLECTION.REPORT}${transactionItem.report?.parentReportID}`] as OnyxEntry<Report>;
const isItemUnreported = transactionItem.reportID === CONST.REPORT.UNREPORTED_REPORT_ID;
const reportForSplit = transactionItem.report ?? (isItemUnreported ? selfDMReport : undefined);

newTransactionList[transactionItem.transactionID] = {
transaction: transactionItem,
action: transactionItem.action,
canHold: canHoldRequest,
isHeld: isOnHold(transactionItem),
canUnhold: canUnholdRequest,
canSplit: isSplitAction(transactionItem.report, [itemTransaction], originalItemTransaction, login ?? '', accountID, transactionItem.policy),
canSplit: isSplitAction(reportForSplit, [itemTransaction], originalItemTransaction, login ?? '', accountID, transactionItem.policy, itemParentReport),
hasBeenSplit: getOriginalTransactionWithSplitInfo(itemTransaction, originalItemTransaction).isExpenseSplit,
canChangeReport: canEditFieldOfMoneyRequest({
reportAction: transactionItem.reportAction,
Expand Down Expand Up @@ -1005,6 +1021,7 @@ function Search({
}
const itemTransaction = transactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${item.transactionID}`] as OnyxEntry<Transaction>;
const originalItemTransaction = transactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${itemTransaction?.comment?.originalTransactionID}`];
const itemParentReport = searchResults?.data?.[`${ONYXKEYS.COLLECTION.REPORT}${item.report?.parentReportID}`] as OnyxEntry<Report>;
const updatedTransactions = prepareTransactionsList(
item,
itemTransaction,
Expand All @@ -1013,6 +1030,8 @@ function Search({
email ?? '',
accountID,
outstandingReportsByPolicyID,
itemParentReport,
selfDMReport,
);
setSelectedTransactions(updatedTransactions);
updateSelectAllMatchingItemsState(updatedTransactions);
Expand Down Expand Up @@ -1073,16 +1092,30 @@ function Search({
currentTransactions
.filter((t) => !isTransactionPendingDelete(t))
.map((transactionItem) => {
const itemTransaction = transactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionItem.transactionID}`] as OnyxEntry<Transaction>;
const originalItemTransaction = transactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${itemTransaction?.comment?.originalTransactionID}`];
return mapTransactionItemToSelectedEntry(transactionItem, itemTransaction, originalItemTransaction, email ?? '', accountID, outstandingReportsByPolicyID);
const itemTransaction = (searchResults?.data?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionItem.transactionID}`] ??
transactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionItem.transactionID}`]) as OnyxEntry<Transaction>;
const originalItemTransaction =
searchResults?.data?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${itemTransaction?.comment?.originalTransactionID}`] ??
transactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${itemTransaction?.comment?.originalTransactionID}`];
const itemParentReport = searchResults?.data?.[`${ONYXKEYS.COLLECTION.REPORT}${transactionItem.report?.parentReportID}`] as OnyxEntry<Report>;
return mapTransactionItemToSelectedEntry(
transactionItem,
itemTransaction,
originalItemTransaction,
email ?? '',
accountID,
outstandingReportsByPolicyID,
true,
itemParentReport,
selfDMReport,
);
}),
),
};
setSelectedTransactions(updatedTransactions);
updateSelectAllMatchingItemsState(updatedTransactions);
},
[selectedTransactions, setSelectedTransactions, updateSelectAllMatchingItemsState, transactions, email, accountID, outstandingReportsByPolicyID],
[selectedTransactions, setSelectedTransactions, updateSelectAllMatchingItemsState, transactions, email, accountID, outstandingReportsByPolicyID, searchResults?.data, selfDMReport],
);

const onSelectRowInMobileSelectionMode = (item: SearchListItem) => {
Expand Down Expand Up @@ -1385,7 +1418,18 @@ function Search({
.map((transactionItem) => {
const itemTransaction = transactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionItem.transactionID}`] as OnyxEntry<Transaction>;
const originalItemTransaction = transactions?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${itemTransaction?.comment?.originalTransactionID}`];
return mapTransactionItemToSelectedEntry(transactionItem, itemTransaction, originalItemTransaction, email ?? '', accountID, outstandingReportsByPolicyID);
const itemParentReport = searchResults?.data?.[`${ONYXKEYS.COLLECTION.REPORT}${transactionItem.report?.parentReportID}`] as OnyxEntry<Report>;
return mapTransactionItemToSelectedEntry(
transactionItem,
itemTransaction,
originalItemTransaction,
email ?? '',
accountID,
outstandingReportsByPolicyID,
true,
itemParentReport,
selfDMReport,
);
});
});
updatedTransactions = Object.fromEntries(allSelections);
Expand All @@ -1397,7 +1441,18 @@ function Search({
.map((transactionItem) => {
const itemTransaction = searchResults?.data?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${transactionItem.transactionID}`] as OnyxEntry<Transaction>;
const originalItemTransaction = searchResults?.data?.[`${ONYXKEYS.COLLECTION.TRANSACTION}${itemTransaction?.comment?.originalTransactionID}`];
return mapTransactionItemToSelectedEntry(transactionItem, itemTransaction, originalItemTransaction, email ?? '', accountID, outstandingReportsByPolicyID);
const itemParentReport = searchResults?.data?.[`${ONYXKEYS.COLLECTION.REPORT}${transactionItem.report?.parentReportID}`] as OnyxEntry<Report>;
return mapTransactionItemToSelectedEntry(
transactionItem,
itemTransaction,
originalItemTransaction,
email ?? '',
accountID,
outstandingReportsByPolicyID,
true,
itemParentReport,
selfDMReport,
);
}),
);
}
Expand All @@ -1415,6 +1470,7 @@ function Search({
accountID,
outstandingReportsByPolicyID,
searchResults?.data,
selfDMReport,
]);

const onLayoutBase = useCallback(() => {
Expand Down
Loading
Loading