From 47293b44744f49aac837b58438700afedd37fc50 Mon Sep 17 00:00:00 2001 From: Benjamin Piouffle Date: Tue, 17 Oct 2023 08:25:54 +0200 Subject: [PATCH] fix(ExpenseItemsTable): tax amount value --- components/ExpenseItemsTable.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/ExpenseItemsTable.js b/components/ExpenseItemsTable.js index 1229ee7d..623daa4b 100644 --- a/components/ExpenseItemsTable.js +++ b/components/ExpenseItemsTable.js @@ -9,7 +9,7 @@ import { Span } from '@opencollective/frontend-components/components/Text'; const ExpenseItemsTable = ({ items, expense }) => { const allTaxTypes = uniq(expense.taxes.map((tax) => tax.type)); const taxType = allTaxTypes.length === 1 ? allTaxTypes[0] : 'Tax'; - const taxRate = sumBy(expense.taxes, 'rate'); + const taxRate = sumBy(expense.taxes, 'rate') || 0; return ( @@ -46,7 +46,7 @@ const ExpenseItemsTable = ({ items, expense }) => { )} - + );
{formatCurrency(item.amount, expense.currency)}{formatCurrency(item.amount * (taxRate || 1), expense.currency)}{formatCurrency(item.amount * taxRate, expense.currency)} {formatCurrency(item.amount * (1 + taxRate), expense.currency)}