From 7dda7158ad633551c4d15e856d275513896ab5ef Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Tue, 19 Nov 2024 20:13:37 +0100 Subject: [PATCH 1/2] Add the Accounts_Payable account --- .env.example | 1 + src/CONST.ts | 4 ++++ src/libs/ReportUtils.ts | 1 - 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index c4adc4f98b65..2bdda890b2ef 100644 --- a/.env.example +++ b/.env.example @@ -14,6 +14,7 @@ ONYX_METRICS=false USE_THIRD_PARTY_SCRIPTS=false EXPENSIFY_ACCOUNT_ID_ACCOUNTING=-1 +EXPENSIFY_ACCOUNT_ID_ACCOUNTS_PAYABLE=-1 EXPENSIFY_ACCOUNT_ID_ADMIN=-1 EXPENSIFY_ACCOUNT_ID_BILLS=-1 EXPENSIFY_ACCOUNT_ID_CHRONOS=-1 diff --git a/src/CONST.ts b/src/CONST.ts index faa3d35a5e06..dd5e043a33df 100755 --- a/src/CONST.ts +++ b/src/CONST.ts @@ -1620,6 +1620,7 @@ const CONST = { EXPENSIFY_MERCHANT: 'Expensify, Inc.', EMAIL: { ACCOUNTING: 'accounting@expensify.com', + ACCOUNTS_PAYABLE: 'accountspayable@expensify.com', ADMIN: 'admin@expensify.com', BILLS: 'bills@expensify.com', CHRONOS: 'chronos@expensify.com', @@ -2082,6 +2083,7 @@ const CONST = { ACCOUNT_ID: { ACCOUNTING: Number(Config?.EXPENSIFY_ACCOUNT_ID_ACCOUNTING ?? 9645353), + ACCOUNTS_PAYABLE: Number(Config?.EXPENSIFY_ACCOUNT_ID_ACCOUNTS_PAYABLE ?? 10903701), ADMIN: Number(Config?.EXPENSIFY_ACCOUNT_ID_ADMIN ?? -1), BILLS: Number(Config?.EXPENSIFY_ACCOUNT_ID_BILLS ?? 1371), CHRONOS: Number(Config?.EXPENSIFY_ACCOUNT_ID_CHRONOS ?? 10027416), @@ -3026,6 +3028,7 @@ const CONST = { get EXPENSIFY_EMAILS() { return [ this.EMAIL.ACCOUNTING, + this.EMAIL.ACCOUNTS_PAYABLE, this.EMAIL.ADMIN, this.EMAIL.BILLS, this.EMAIL.CHRONOS, @@ -3046,6 +3049,7 @@ const CONST = { get EXPENSIFY_ACCOUNT_IDS() { return [ this.ACCOUNT_ID.ACCOUNTING, + this.ACCOUNT_ID.ACCOUNTS_PAYABLE, this.ACCOUNT_ID.ADMIN, this.ACCOUNT_ID.BILLS, this.ACCOUNT_ID.CHRONOS, diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 373a861f7c2e..ee33dd8221bd 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -7308,7 +7308,6 @@ function getReportOfflinePendingActionAndErrors(report: OnyxEntry): Repo */ function canCreateRequest(report: OnyxEntry, policy: OnyxEntry, iouType: ValueOf): boolean { const participantAccountIDs = Object.keys(report?.participants ?? {}).map(Number); - if (!canUserPerformWriteAction(report)) { return false; } From f7f8372ceafb46c153bd5e84386503692f3f034b Mon Sep 17 00:00:00 2001 From: Vit Horacek Date: Tue, 19 Nov 2024 20:14:01 +0100 Subject: [PATCH 2/2] Revert one change --- src/libs/ReportUtils.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index ee33dd8221bd..373a861f7c2e 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -7308,6 +7308,7 @@ function getReportOfflinePendingActionAndErrors(report: OnyxEntry): Repo */ function canCreateRequest(report: OnyxEntry, policy: OnyxEntry, iouType: ValueOf): boolean { const participantAccountIDs = Object.keys(report?.participants ?? {}).map(Number); + if (!canUserPerformWriteAction(report)) { return false; }