From 7d1ade1054e00f6949d68377b8739b3f8d48d4c5 Mon Sep 17 00:00:00 2001 From: Dysto coder Date: Tue, 9 Jul 2024 12:21:36 +0300 Subject: [PATCH 1/2] Dispaly a positive tax amount when BE returns negative amount --- src/components/MoneyRequestConfirmationListFooter.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/MoneyRequestConfirmationListFooter.tsx b/src/components/MoneyRequestConfirmationListFooter.tsx index 8dfff6466ab9..f739bc321d8a 100644 --- a/src/components/MoneyRequestConfirmationListFooter.tsx +++ b/src/components/MoneyRequestConfirmationListFooter.tsx @@ -255,8 +255,9 @@ function MoneyRequestConfirmationListFooter({ const shouldShowBillable = policy?.disabledFields?.defaultBillable === false; // Do not hide fields in case of paying someone const shouldShowAllFields = !!isDistanceRequest || shouldExpandFields || !shouldShowSmartScanFields || isTypeSend || !!isEditingSplitBill; - // Calculate the formatted tax amount based on the transaction's tax amount and the IOU currency code - const formattedTaxAmount = CurrencyUtils.convertToDisplayString(transaction?.taxAmount, iouCurrencyCode); + // Calculate the formatted tax amount based on the transaction's tax amount returned from getTaxAmount and the IOU currency code + const taxAmount = TransactionUtils.getTaxAmount(transaction, false); + const formattedTaxAmount = CurrencyUtils.convertToDisplayString(taxAmount, iouCurrencyCode); // Get the tax rate title based on the policy and transaction const taxRateTitle = TransactionUtils.getTaxName(policy, transaction); // Determine if the merchant error should be displayed From 3ce2a724fc97eed45f7b5a63d392a62a22f64ac9 Mon Sep 17 00:00:00 2001 From: Dysto coder Date: Tue, 9 Jul 2024 22:24:43 +0300 Subject: [PATCH 2/2] Undo edited comment --- src/components/MoneyRequestConfirmationListFooter.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/MoneyRequestConfirmationListFooter.tsx b/src/components/MoneyRequestConfirmationListFooter.tsx index f739bc321d8a..48190fb3c759 100644 --- a/src/components/MoneyRequestConfirmationListFooter.tsx +++ b/src/components/MoneyRequestConfirmationListFooter.tsx @@ -255,7 +255,7 @@ function MoneyRequestConfirmationListFooter({ const shouldShowBillable = policy?.disabledFields?.defaultBillable === false; // Do not hide fields in case of paying someone const shouldShowAllFields = !!isDistanceRequest || shouldExpandFields || !shouldShowSmartScanFields || isTypeSend || !!isEditingSplitBill; - // Calculate the formatted tax amount based on the transaction's tax amount returned from getTaxAmount and the IOU currency code + // Calculate the formatted tax amount based on the transaction's tax amount and the IOU currency code const taxAmount = TransactionUtils.getTaxAmount(transaction, false); const formattedTaxAmount = CurrencyUtils.convertToDisplayString(taxAmount, iouCurrencyCode); // Get the tax rate title based on the policy and transaction