From cfb2c48d271a799e62d5aa24f87da19e199f3b3d Mon Sep 17 00:00:00 2001 From: Youssef Lourayad Date: Fri, 13 Oct 2023 19:45:00 +0800 Subject: [PATCH 1/3] Only show Split Bill option the user's own workspace chat --- src/libs/ReportUtils.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index fdfc630cfd33..0051fd056dba 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -3412,8 +3412,12 @@ function getMoneyRequestOptions(report, reportParticipants) { // User created policy rooms and default rooms like #admins or #announce will always have the Split Bill option // unless there are no participants at all (e.g. #admins room for a policy with only 1 admin) // DM chats will have the Split Bill option only when there are at least 3 people in the chat. - // There is no Split Bill option for Workspace chats, IOU or Expense reports which are threads - if ((isChatRoom(report) && participants.length > 0) || (hasMultipleParticipants && !isPolicyExpenseChat(report) && !isMoneyRequestReport(report)) || isControlPolicyExpenseChat(report)) { + // There is no Split Bill option for IOU or Expense reports which are threads + if ( + (isChatRoom(report) && participants.length > 0) || + (hasMultipleParticipants && !isPolicyExpenseChat(report) && !isMoneyRequestReport(report)) || + (isControlPolicyExpenseChat(report) && canRequestMoney(report, participants)) + ) { return [CONST.IOU.MONEY_REQUEST_TYPE.SPLIT]; } From e22831e0cd5505e2bc9555ae65118cb2959679c4 Mon Sep 17 00:00:00 2001 From: Youssef Lourayad Date: Sun, 15 Oct 2023 22:37:21 +0800 Subject: [PATCH 2/3] Update ReportUtils.js Co-authored-by: Vit Horacek <36083550+mountiny@users.noreply.github.com> --- src/libs/ReportUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index 0051fd056dba..186a542baa91 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -3416,7 +3416,7 @@ function getMoneyRequestOptions(report, reportParticipants) { if ( (isChatRoom(report) && participants.length > 0) || (hasMultipleParticipants && !isPolicyExpenseChat(report) && !isMoneyRequestReport(report)) || - (isControlPolicyExpenseChat(report) && canRequestMoney(report, participants)) + (isControlPolicyExpenseChat(report) && (report.isOwnPolicyExpenseChat || false)) ) { return [CONST.IOU.MONEY_REQUEST_TYPE.SPLIT]; } From a16d2f23f77056ac8c16136cc62515bb58aa74b9 Mon Sep 17 00:00:00 2001 From: Youssef Lourayad Date: Mon, 16 Oct 2023 05:35:10 +0800 Subject: [PATCH 3/3] Update ReportUtils.js Co-authored-by: Vit Horacek <36083550+mountiny@users.noreply.github.com> --- src/libs/ReportUtils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.js b/src/libs/ReportUtils.js index 186a542baa91..44757f219a84 100644 --- a/src/libs/ReportUtils.js +++ b/src/libs/ReportUtils.js @@ -3416,7 +3416,7 @@ function getMoneyRequestOptions(report, reportParticipants) { if ( (isChatRoom(report) && participants.length > 0) || (hasMultipleParticipants && !isPolicyExpenseChat(report) && !isMoneyRequestReport(report)) || - (isControlPolicyExpenseChat(report) && (report.isOwnPolicyExpenseChat || false)) + (isControlPolicyExpenseChat(report) && report.isOwnPolicyExpenseChat) ) { return [CONST.IOU.MONEY_REQUEST_TYPE.SPLIT]; }