From d2c656c6d518edf54857e839670d57446c3abd85 Mon Sep 17 00:00:00 2001 From: Monil Bhavsar Date: Tue, 14 May 2024 22:04:50 +0530 Subject: [PATCH] Fallback to default tax rate --- src/pages/iou/request/step/IOURequestStepAmount.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pages/iou/request/step/IOURequestStepAmount.tsx b/src/pages/iou/request/step/IOURequestStepAmount.tsx index 54352a1b8fba..cdc5c9979519 100644 --- a/src/pages/iou/request/step/IOURequestStepAmount.tsx +++ b/src/pages/iou/request/step/IOURequestStepAmount.tsx @@ -283,7 +283,8 @@ function IOURequestStepAmount({ // If currency has changed, then we get the default tax rate based on currency, otherwise we use the current tax rate selected in transaction, if we have it. const transactionTaxCode = transaction?.taxCode ?? ''; - const taxCode = currency !== transactionCurrency ? TransactionUtils.getDefaultTaxCode(policy, transaction, currency) ?? '' : transactionTaxCode; + const defaultTaxCode = TransactionUtils.getDefaultTaxCode(policy, transaction, currency) ?? ''; + const taxCode = (currency !== transactionCurrency ? defaultTaxCode : transactionTaxCode) ?? defaultTaxCode; const taxPercentage = TransactionUtils.getTaxValue(policy, transaction, taxCode) ?? ''; const taxAmount = CurrencyUtils.convertToBackendAmount(TransactionUtils.calculateTaxAmount(taxPercentage, newAmount));