From 5967e8f4ec95fac70ef19c7630249ba0ac859e32 Mon Sep 17 00:00:00 2001 From: mvaishnavi Date: Thu, 13 Jun 2024 13:35:59 +0530 Subject: [PATCH] fix: Advance Wallet changes - should not add company account to payment mode when advance wallet id is present (#3073) --- src/app/core/services/accounts.service.ts | 2 +- src/app/core/services/org-settings.service.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/core/services/accounts.service.ts b/src/app/core/services/accounts.service.ts index ea90c2dd1b..5cbee41444 100644 --- a/src/app/core/services/accounts.service.ts +++ b/src/app/core/services/accounts.service.ts @@ -290,7 +290,7 @@ export class AccountsService { } //Add current expense account to allowedPaymentModes if it is not present - if (etxn?.source?.account_id) { + if (etxn?.source?.account_id && !etxn?.tx?.advance_wallet_id) { let paymentModeOfExpense = etxn.source.account_type; if (etxn.source.account_type === AccountType.PERSONAL && etxn.tx.skip_reimbursement) { paymentModeOfExpense = AccountType.COMPANY; diff --git a/src/app/core/services/org-settings.service.ts b/src/app/core/services/org-settings.service.ts index f6312a4cca..8c3cdd5aaf 100644 --- a/src/app/core/services/org-settings.service.ts +++ b/src/app/core/services/org-settings.service.ts @@ -142,6 +142,7 @@ export class OrgSettingsService { advance_wallets_enabled: incoming.advances_settings && incoming.advances_settings.allowed && + incoming.advances_settings.enabled && incoming.advances_settings.advance_wallets_enabled, }, projects: {