Skip to content

Commit

Permalink
ExpenseItemsTable: fix tax amount value (#961)
Browse files Browse the repository at this point in the history
  • Loading branch information
Betree authored Oct 17, 2023
1 parent 4d1f55a commit bce50bb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/ExpenseItemsTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<table style={{ borderCollapse: 'collapse', width: '100%' }}>
<thead>
Expand Down Expand Up @@ -46,7 +46,7 @@ const ExpenseItemsTable = ({ items, expense }) => {
)}
</Td>
<Td textAlign="right">{formatCurrency(item.amount, expense.currency)}</Td>
<Td textAlign="right">{formatCurrency(item.amount * (taxRate || 1), expense.currency)}</Td>
<Td textAlign="right">{formatCurrency(item.amount * taxRate, expense.currency)}</Td>
<Td textAlign="right">{formatCurrency(item.amount * (1 + taxRate), expense.currency)}</Td>
</tr>
);
Expand Down

1 comment on commit bce50bb

@vercel
Copy link

@vercel vercel bot commented on bce50bb Oct 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.