Skip to content

Commit

Permalink
bug(oneOffInvoice) fix tax display from provider (#1706)
Browse files Browse the repository at this point in the history
  • Loading branch information
ansmonjol committed Aug 30, 2024
1 parent caf3b11 commit ffb06b3
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/pages/CreateInvoice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
})
Expand Down Expand Up @@ -1002,9 +1002,12 @@ const CreateInvoice = () => {
? null
: !hasAnyFee
? '-'
: intlFormatNumber(taxToDisplay.amount, {
currency,
})}
: intlFormatNumber(
deserializeAmount(taxToDisplay.amount || 0, currency),
{
currency,
},
)}
</Typography>
</InvoiceFooterLine>
)
Expand Down

0 comments on commit ffb06b3

Please sign in to comment.