mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 13:20:31 +00:00
feat : checkbox landed cost.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { FormattedMessage as T } from 'components';
|
||||
import intl from 'react-intl-universal';
|
||||
import { Tooltip, Button, Intent, Position } from '@blueprintjs/core';
|
||||
import { Tooltip, Button, Checkbox, Intent, Position } from '@blueprintjs/core';
|
||||
import { Hint, Icon } from 'components';
|
||||
import { formattedAmount, safeSumBy } from 'utils';
|
||||
import {
|
||||
@@ -28,7 +28,11 @@ export function ItemHeaderCell() {
|
||||
* Item column footer cell.
|
||||
*/
|
||||
export function ItemFooterCell() {
|
||||
return <span><T id={'total'}/></span>;
|
||||
return (
|
||||
<span>
|
||||
<T id={'total'} />
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -86,12 +90,35 @@ export function IndexTableCell({ row: { index } }) {
|
||||
return <span>{index + 1}</span>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Landed cost cell.
|
||||
*/
|
||||
const LandedCostCell = ({
|
||||
row: { index },
|
||||
column: { id },
|
||||
cell: { value: initialValue },
|
||||
data,
|
||||
payload,
|
||||
}) => {
|
||||
return <Checkbox minimal={true} className="ml2" />;
|
||||
};
|
||||
|
||||
/**
|
||||
* Landed cost header cell.
|
||||
*/
|
||||
const LandedCostHeaderCell = () => {
|
||||
return (
|
||||
<>
|
||||
<T id={'cost'} />
|
||||
<Hint content={''} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieve editable items entries columns.
|
||||
*/
|
||||
export function useEditableItemsEntriesColumns() {
|
||||
|
||||
|
||||
return React.useMemo(
|
||||
() => [
|
||||
{
|
||||
@@ -155,6 +182,14 @@ export function useEditableItemsEntriesColumns() {
|
||||
width: 100,
|
||||
className: 'total',
|
||||
},
|
||||
{
|
||||
Header: '',
|
||||
accessor: 'landed_cost',
|
||||
Cell: LandedCostCell,
|
||||
width: 70,
|
||||
disableSortBy: true,
|
||||
disableResizing: true,
|
||||
},
|
||||
{
|
||||
Header: '',
|
||||
accessor: 'action',
|
||||
|
||||
@@ -59,11 +59,7 @@ const LandedCostCell = ({
|
||||
data,
|
||||
payload,
|
||||
}) => {
|
||||
return (
|
||||
<Tooltip content={''} position={Position.RIGHT}>
|
||||
<Checkbox minimal={true} className="ml2" />
|
||||
</Tooltip>
|
||||
);
|
||||
return <Checkbox minimal={true} className="ml2" />;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user