fix: add baseCurrency in sale & purchases data table.

This commit is contained in:
elforjani3
2021-01-08 23:59:14 +02:00
parent 0b70c7ba9f
commit e9222b87fd
7 changed files with 88 additions and 47 deletions

View File

@@ -23,6 +23,7 @@ import EstimatesEmptyStatus from './EstimatesEmptyStatus';
import { statusAccessor } from './components';
import withEstimates from './withEstimates';
import withEstimateActions from './withEstimateActions';
import withSettings from 'containers/Settings/withSettings';
// Estimates transactions datatable.
function EstimatesDataTable({
@@ -36,6 +37,9 @@ function EstimatesDataTable({
// #withEstimatesActions
addEstimatesTableQueries,
// #withSettings
baseCurrency,
// #ownProps
onEditEstimate,
onDeleteEstimate,
@@ -160,7 +164,7 @@ function EstimatesDataTable({
{
id: 'amount',
Header: formatMessage({ id: 'amount' }),
accessor: (r) => <Money amount={r.amount} currency={'USD'} />,
accessor: (r) => <Money amount={r.amount} currency={baseCurrency} />,
width: 140,
className: 'amount',
@@ -282,4 +286,7 @@ export default compose(
estimatesCurrentViewId,
}),
),
withSettings(({ organizationSettings }) => ({
baseCurrency: organizationSettings?.baseCurrency,
})),
)(EstimatesDataTable);