Skip to content

Commit

Permalink
fix(ExpenseItemsTable): tax amount value
Browse files Browse the repository at this point in the history
  • Loading branch information
Betree committed Oct 17, 2023
1 parent 4d1f55a commit 47293b4
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

0 comments on commit 47293b4

Please sign in to comment.