mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 07:10:33 +00:00
feat : checkbox landed cost.
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
import { FormattedMessage as T } from 'components';
|
import { FormattedMessage as T } from 'components';
|
||||||
import intl from 'react-intl-universal';
|
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 { Hint, Icon } from 'components';
|
||||||
import { formattedAmount, safeSumBy } from 'utils';
|
import { formattedAmount, safeSumBy } from 'utils';
|
||||||
import {
|
import {
|
||||||
@@ -28,7 +28,11 @@ export function ItemHeaderCell() {
|
|||||||
* Item column footer cell.
|
* Item column footer cell.
|
||||||
*/
|
*/
|
||||||
export function ItemFooterCell() {
|
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>;
|
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.
|
* Retrieve editable items entries columns.
|
||||||
*/
|
*/
|
||||||
export function useEditableItemsEntriesColumns() {
|
export function useEditableItemsEntriesColumns() {
|
||||||
|
|
||||||
|
|
||||||
return React.useMemo(
|
return React.useMemo(
|
||||||
() => [
|
() => [
|
||||||
{
|
{
|
||||||
@@ -155,6 +182,14 @@ export function useEditableItemsEntriesColumns() {
|
|||||||
width: 100,
|
width: 100,
|
||||||
className: 'total',
|
className: 'total',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Header: '',
|
||||||
|
accessor: 'landed_cost',
|
||||||
|
Cell: LandedCostCell,
|
||||||
|
width: 70,
|
||||||
|
disableSortBy: true,
|
||||||
|
disableResizing: true,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Header: '',
|
Header: '',
|
||||||
accessor: 'action',
|
accessor: 'action',
|
||||||
|
|||||||
@@ -59,11 +59,7 @@ const LandedCostCell = ({
|
|||||||
data,
|
data,
|
||||||
payload,
|
payload,
|
||||||
}) => {
|
}) => {
|
||||||
return (
|
return <Checkbox minimal={true} className="ml2" />;
|
||||||
<Tooltip content={''} position={Position.RIGHT}>
|
|
||||||
<Checkbox minimal={true} className="ml2" />
|
|
||||||
</Tooltip>
|
|
||||||
);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user