mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 07:10:33 +00:00
feat: add project invoicing cell.
This commit is contained in:
47
src/components/DataTableCells/ProjectInvoicingCell.tsx
Normal file
47
src/components/DataTableCells/ProjectInvoicingCell.tsx
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import styled from 'styled-components';
|
||||||
|
import { Popover2 } from '@blueprintjs/popover2';
|
||||||
|
import { Button } from '@blueprintjs/core';
|
||||||
|
import { CellType } from '@/constants';
|
||||||
|
import {
|
||||||
|
Icon,
|
||||||
|
FormattedMessage as T,
|
||||||
|
ButtonLink,
|
||||||
|
DetailsMenu,
|
||||||
|
DetailItem,
|
||||||
|
FormatDate,
|
||||||
|
} from '@/components';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
export function ProjectInvoicingCell({}) {
|
||||||
|
const content = (
|
||||||
|
<ProjectInvoicingContent>
|
||||||
|
<DetailsMenu direction={'vertical'}>
|
||||||
|
<DetailItem label={'Type'}>
|
||||||
|
<ButtonLink>Expense</ButtonLink>
|
||||||
|
</DetailItem>
|
||||||
|
<DetailItem label={'Transaction No.'}>EXP-1000</DetailItem>
|
||||||
|
<DetailItem label={'Date'}>2022-02-02</DetailItem>
|
||||||
|
<DetailItem label={'Amount'}>$1000.00</DetailItem>
|
||||||
|
</DetailsMenu>
|
||||||
|
</ProjectInvoicingContent>
|
||||||
|
);
|
||||||
|
return (
|
||||||
|
<Popover2 content={content}>
|
||||||
|
<Button
|
||||||
|
icon={<Icon icon={'info'} iconSize={14} />}
|
||||||
|
className="m12"
|
||||||
|
minimal={true}
|
||||||
|
/>
|
||||||
|
</Popover2>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
ProjectInvoicingCell.cellType = CellType.Button;
|
||||||
|
|
||||||
|
const ProjectInvoicingContent = styled.div`
|
||||||
|
width: 450px;
|
||||||
|
padding: 7px 12px;
|
||||||
|
`;
|
||||||
@@ -11,6 +11,7 @@ import SwitchFieldCell from './SwitchFieldCell';
|
|||||||
import TextAreaCell from './TextAreaCell';
|
import TextAreaCell from './TextAreaCell';
|
||||||
import BranchesListFieldCell from './BranchesListFieldCell';
|
import BranchesListFieldCell from './BranchesListFieldCell';
|
||||||
import { ProjectsListFieldCell } from './ProjectsListFieldCell';
|
import { ProjectsListFieldCell } from './ProjectsListFieldCell';
|
||||||
|
import { ProjectInvoicingCell } from './ProjectInvoicingCell';
|
||||||
import { TextOverviewTooltipCell } from './TextOverviewTooltipCell';
|
import { TextOverviewTooltipCell } from './TextOverviewTooltipCell';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
@@ -28,5 +29,6 @@ export {
|
|||||||
TextAreaCell,
|
TextAreaCell,
|
||||||
BranchesListFieldCell,
|
BranchesListFieldCell,
|
||||||
ProjectsListFieldCell,
|
ProjectsListFieldCell,
|
||||||
|
ProjectInvoicingCell,
|
||||||
TextOverviewTooltipCell,
|
TextOverviewTooltipCell,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import {
|
|||||||
PercentFieldCell,
|
PercentFieldCell,
|
||||||
NumericInputCell,
|
NumericInputCell,
|
||||||
CheckBoxFieldCell,
|
CheckBoxFieldCell,
|
||||||
|
ProjectInvoicingCell,
|
||||||
} from '@/components/DataTableCells';
|
} from '@/components/DataTableCells';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -152,6 +153,15 @@ export function useEditableItemsEntriesColumns({ landedCost }) {
|
|||||||
},
|
},
|
||||||
]
|
]
|
||||||
: []),
|
: []),
|
||||||
|
{
|
||||||
|
Header: '',
|
||||||
|
accessor: 'invoicing',
|
||||||
|
Cell: ProjectInvoicingCell,
|
||||||
|
disableSortBy: true,
|
||||||
|
disableResizing: true,
|
||||||
|
width: 45,
|
||||||
|
align: Align.Center,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Header: '',
|
Header: '',
|
||||||
accessor: 'action',
|
accessor: 'action',
|
||||||
|
|||||||
@@ -40,6 +40,9 @@ function ProjectDetailActionsBar({
|
|||||||
// Handle new transaction button click.
|
// Handle new transaction button click.
|
||||||
const handleNewTransactionBtnClick = ({ path }) => {
|
const handleNewTransactionBtnClick = ({ path }) => {
|
||||||
switch (path) {
|
switch (path) {
|
||||||
|
case 'invoincing':
|
||||||
|
openDialog('project-invoicing-form');
|
||||||
|
break;
|
||||||
case 'expense':
|
case 'expense':
|
||||||
openDialog('project-expense-form', { projectId });
|
openDialog('project-expense-form', { projectId });
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user