Skip to content
Merged
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
44 changes: 27 additions & 17 deletions src/pages/iou/request/step/IOURequestStepConfirmation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -721,23 +721,33 @@

const currentTransactionReceiptFile = transaction?.transactionID ? receiptFiles[transaction.transactionID] : undefined;

// If we have a receipt let's start the split expense by creating only the action, the transaction, and the group DM if needed
if (iouType === CONST.IOU.TYPE.SPLIT && currentTransactionReceiptFile) {
if (currentUserPersonalDetails.login && !!transaction) {
startSplitBill({
participants: selectedParticipants,
currentUserLogin: currentUserPersonalDetails.login,
currentUserAccountID: currentUserPersonalDetails.accountID,
comment: trimmedComment,
receipt: currentTransactionReceiptFile,
existingSplitChatReportID: report?.reportID,
billable: transaction.billable,
reimbursable: transaction.reimbursable,
category: transaction.category,
tag: transaction.tag,
currency: transaction.currency,
taxCode: transactionTaxCode,
taxAmount: transactionTaxAmount,
if (iouType === CONST.IOU.TYPE.SPLIT && Object.values(receiptFiles).filter((receipt) => !!receipt).length) {
const currentUserLogin = currentUserPersonalDetails.login;
if (currentUserLogin) {
transactions.forEach((item, index) => {
const transactionReceiptFile = receiptFiles[item.transactionID];
if (!transactionReceiptFile) {
return;
}
const itemTrimmedComment = item?.comment?.comment?.trim() ?? '';

// If we have a receipt let's start the split expense by creating only the action, the transaction, and the group DM if needed
startSplitBill({
Comment thread
huult marked this conversation as resolved.
participants: selectedParticipants,
currentUserLogin,
currentUserAccountID: currentUserPersonalDetails.accountID,
comment: itemTrimmedComment,
receipt: transactionReceiptFile,
existingSplitChatReportID: report?.reportID,
billable: item.billable,
reimbursable: item.reimbursable,
category: item.category,
tag: item.tag,
currency: item.currency,
taxCode: transactionTaxCode,
taxAmount: transactionTaxAmount,
shouldPlaySound: index === transactions.length - 1,
});
});
}
return;
Expand Down Expand Up @@ -908,7 +918,7 @@
isDistanceRequest,
isMovingTransactionFromTrackExpense,
receiptFiles,
isCategorizingTrackExpense,

Check warning on line 921 in src/pages/iou/request/step/IOURequestStepConfirmation.tsx

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

React Hook useCallback has a missing dependency: 'transactions'. Either include it or remove the dependency array
isSharingTrackExpense,
isPerDiemRequest,
requestMoney,
Expand Down
Loading