mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 06:40:31 +00:00
fix: sell_price & cost_price in itemsDateTable.
This commit is contained in:
@@ -19,7 +19,7 @@ import { CLASSES } from 'common/classes';
|
|||||||
|
|
||||||
import withItems from 'containers/Items/withItems';
|
import withItems from 'containers/Items/withItems';
|
||||||
import withItemsActions from 'containers/Items/withItemsActions';
|
import withItemsActions from 'containers/Items/withItemsActions';
|
||||||
import { compose, saveInvoke } from 'utils';
|
import { compose, saveInvoke, isBlank, defaultToTransform } from 'utils';
|
||||||
|
|
||||||
// Items datatable.
|
// Items datatable.
|
||||||
function ItemsDataTable({
|
function ItemsDataTable({
|
||||||
@@ -122,7 +122,9 @@ function ItemsDataTable({
|
|||||||
<Tag minimal={true} round={true} intent={Intent.NONE}>
|
<Tag minimal={true} round={true} intent={Intent.NONE}>
|
||||||
{formatMessage({ id: row.type })}
|
{formatMessage({ id: row.type })}
|
||||||
</Tag>
|
</Tag>
|
||||||
) : (''),
|
) : (
|
||||||
|
''
|
||||||
|
),
|
||||||
className: 'item_type',
|
className: 'item_type',
|
||||||
width: 120,
|
width: 120,
|
||||||
},
|
},
|
||||||
@@ -134,13 +136,23 @@ function ItemsDataTable({
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
Header: formatMessage({ id: 'sell_price' }),
|
Header: formatMessage({ id: 'sell_price' }),
|
||||||
accessor: (row) => <Money amount={row.sell_price} currency={'USD'} />,
|
accessor: (row) =>
|
||||||
|
!isBlank(row.sell_price) ? (
|
||||||
|
<Money amount={row.sell_price} currency={'USD'} />
|
||||||
|
) : (
|
||||||
|
''
|
||||||
|
),
|
||||||
className: 'sell-price',
|
className: 'sell-price',
|
||||||
width: 150,
|
width: 150,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Header: formatMessage({ id: 'cost_price' }),
|
Header: formatMessage({ id: 'cost_price' }),
|
||||||
accessor: (row) => <Money amount={row.cost_price} currency={'USD'} />,
|
accessor: (row) =>
|
||||||
|
!isBlank(row.sell_price) ? (
|
||||||
|
<Money amount={row.cost_price} currency={'USD'} />
|
||||||
|
) : (
|
||||||
|
''
|
||||||
|
),
|
||||||
className: 'cost-price',
|
className: 'cost-price',
|
||||||
width: 150,
|
width: 150,
|
||||||
},
|
},
|
||||||
@@ -230,13 +242,13 @@ export default compose(
|
|||||||
itemsTableLoading,
|
itemsTableLoading,
|
||||||
itemsTableQuery,
|
itemsTableQuery,
|
||||||
itemsCurrentViewId,
|
itemsCurrentViewId,
|
||||||
itemsPagination
|
itemsPagination,
|
||||||
}) => ({
|
}) => ({
|
||||||
itemsCurrentPage,
|
itemsCurrentPage,
|
||||||
itemsTableLoading,
|
itemsTableLoading,
|
||||||
itemsTableQuery,
|
itemsTableQuery,
|
||||||
itemsCurrentViewId,
|
itemsCurrentViewId,
|
||||||
itemsPagination
|
itemsPagination,
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
withItemsActions,
|
withItemsActions,
|
||||||
|
|||||||
Reference in New Issue
Block a user