From edba12b670582066588c8f4d7eab341b55210c07 Mon Sep 17 00:00:00 2001 From: Alexandre Monjol Date: Fri, 30 Aug 2024 14:17:29 -0300 Subject: [PATCH] bug(oneOffInvoice) fix tax display from provider --- src/pages/CreateInvoice.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/pages/CreateInvoice.tsx b/src/pages/CreateInvoice.tsx index feb2961ea..8c7f07693 100644 --- a/src/pages/CreateInvoice.tsx +++ b/src/pages/CreateInvoice.tsx @@ -407,7 +407,7 @@ const CreateInvoice = () => { amount: Number(tax.taxAmount || 0), label: !!tax.enumedTaxCode ? translate(appliedTaxEnumedTaxCodeTranslationKey[tax.enumedTaxCode]) - : `${tax.name} (${tax.rate}%)`, + : `${tax.name} (${!tax?.rate || tax?.rate === 0 ? 0 : tax.rate * 100}%)`, taxRate: (tax.rate || 0) * 100, hasEnumedTaxCode: !!tax.enumedTaxCode, }) @@ -1002,9 +1002,12 @@ const CreateInvoice = () => { ? null : !hasAnyFee ? '-' - : intlFormatNumber(taxToDisplay.amount, { - currency, - })} + : intlFormatNumber( + deserializeAmount(taxToDisplay.amount || 0, currency), + { + currency, + }, + )} )