From c1865c42d193de8f6eef74fff2ae6fe569364fb7 Mon Sep 17 00:00:00 2001 From: elforjani3 Date: Sun, 29 Nov 2020 18:02:00 +0200 Subject: [PATCH] fix: sell_price & cost_price in itemsDateTable. --- client/src/containers/Items/ItemsDataTable.js | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/client/src/containers/Items/ItemsDataTable.js b/client/src/containers/Items/ItemsDataTable.js index 0afec335e..948d99979 100644 --- a/client/src/containers/Items/ItemsDataTable.js +++ b/client/src/containers/Items/ItemsDataTable.js @@ -19,7 +19,7 @@ import { CLASSES } from 'common/classes'; import withItems from 'containers/Items/withItems'; import withItemsActions from 'containers/Items/withItemsActions'; -import { compose, saveInvoke } from 'utils'; +import { compose, saveInvoke, isBlank, defaultToTransform } from 'utils'; // Items datatable. function ItemsDataTable({ @@ -122,7 +122,9 @@ function ItemsDataTable({ {formatMessage({ id: row.type })} - ) : (''), + ) : ( + '' + ), className: 'item_type', width: 120, }, @@ -134,13 +136,23 @@ function ItemsDataTable({ }, { Header: formatMessage({ id: 'sell_price' }), - accessor: (row) => , + accessor: (row) => + !isBlank(row.sell_price) ? ( + + ) : ( + '' + ), className: 'sell-price', width: 150, }, { Header: formatMessage({ id: 'cost_price' }), - accessor: (row) => , + accessor: (row) => + !isBlank(row.sell_price) ? ( + + ) : ( + '' + ), className: 'cost-price', width: 150, }, @@ -230,13 +242,13 @@ export default compose( itemsTableLoading, itemsTableQuery, itemsCurrentViewId, - itemsPagination + itemsPagination, }) => ({ itemsCurrentPage, itemsTableLoading, itemsTableQuery, itemsCurrentViewId, - itemsPagination + itemsPagination, }), ), withItemsActions,