fix: item & Bills & Vendor Datatable.

This commit is contained in:
elforjani3
2021-01-04 19:49:58 +02:00
parent d25360d279
commit c97494bee1
3 changed files with 25 additions and 6 deletions

View File

@@ -26,6 +26,7 @@ import { CLASSES } from 'common/classes';
import withItems from 'containers/Items/withItems';
import withItemsActions from 'containers/Items/withItemsActions';
import withSettings from 'containers/Settings/withSettings';
import { compose, saveInvoke, isBlank, defaultToTransform } from 'utils';
// Items datatable.
@@ -40,6 +41,9 @@ function ItemsDataTable({
// #withItemsActions
addItemsTableQueries,
// #withSettings
baseCurrency,
// props
onEditItem,
onDeleteItem,
@@ -176,7 +180,7 @@ function ItemsDataTable({
Header: formatMessage({ id: 'sell_price' }),
accessor: (row) =>
!isBlank(row.sell_price) ? (
<Money amount={row.sell_price} currency={'USD'} />
<Money amount={row.sell_price} currency={baseCurrency} />
) : (
''
),
@@ -187,7 +191,7 @@ function ItemsDataTable({
Header: formatMessage({ id: 'cost_price' }),
accessor: (row) =>
!isBlank(row.cost_price) ? (
<Money amount={row.cost_price} currency={'USD'} />
<Money amount={row.cost_price} currency={baseCurrency} />
) : (
''
),
@@ -292,5 +296,8 @@ export default compose(
itemsPagination,
}),
),
withSettings(({ organizationSettings }) => ({
baseCurrency: organizationSettings?.baseCurrency,
})),
withItemsActions,
)(ItemsDataTable);