mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 14:20:31 +00:00
BC-14: feat: table rows clickable.
This commit is contained in:
@@ -73,6 +73,11 @@ function ManualJournalsDataTable({
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Handle cell click.
|
||||||
|
const handleCellClick = (cell, event) => {
|
||||||
|
openDrawer('journal-drawer', { manualJournalId: cell.row.original.id });
|
||||||
|
};
|
||||||
|
|
||||||
// Handle fetch data once the page index, size or sort by of the table change.
|
// Handle fetch data once the page index, size or sort by of the table change.
|
||||||
const handleFetchData = React.useCallback(
|
const handleFetchData = React.useCallback(
|
||||||
({ pageSize, pageIndex, sortBy }) => {
|
({ pageSize, pageIndex, sortBy }) => {
|
||||||
@@ -111,6 +116,7 @@ function ManualJournalsDataTable({
|
|||||||
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
||||||
ContextMenu={ActionsMenu}
|
ContextMenu={ActionsMenu}
|
||||||
onFetchData={handleFetchData}
|
onFetchData={handleFetchData}
|
||||||
|
onCellClick={handleCellClick}
|
||||||
payload={{
|
payload={{
|
||||||
onDelete: handleDeleteJournal,
|
onDelete: handleDeleteJournal,
|
||||||
onPublish: handlePublishJournal,
|
onPublish: handlePublishJournal,
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ export const useManualJournalsColumns = () => {
|
|||||||
accessor: DateAccessor,
|
accessor: DateAccessor,
|
||||||
width: 115,
|
width: 115,
|
||||||
className: 'date',
|
className: 'date',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'amount',
|
id: 'amount',
|
||||||
@@ -27,6 +28,7 @@ export const useManualJournalsColumns = () => {
|
|||||||
accessor: 'formatted_amount',
|
accessor: 'formatted_amount',
|
||||||
className: 'amount',
|
className: 'amount',
|
||||||
width: 115,
|
width: 115,
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'journal_number',
|
id: 'journal_number',
|
||||||
@@ -34,6 +36,7 @@ export const useManualJournalsColumns = () => {
|
|||||||
accessor: (row) => `#${row.journal_number}`,
|
accessor: (row) => `#${row.journal_number}`,
|
||||||
className: 'journal_number',
|
className: 'journal_number',
|
||||||
width: 100,
|
width: 100,
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'journal_type',
|
id: 'journal_type',
|
||||||
@@ -41,6 +44,7 @@ export const useManualJournalsColumns = () => {
|
|||||||
accessor: 'journal_type',
|
accessor: 'journal_type',
|
||||||
width: 110,
|
width: 110,
|
||||||
className: 'journal_type',
|
className: 'journal_type',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'status',
|
id: 'status',
|
||||||
@@ -48,6 +52,7 @@ export const useManualJournalsColumns = () => {
|
|||||||
accessor: (row) => StatusAccessor(row),
|
accessor: (row) => StatusAccessor(row),
|
||||||
width: 95,
|
width: 95,
|
||||||
className: 'status',
|
className: 'status',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'note',
|
id: 'note',
|
||||||
@@ -56,6 +61,7 @@ export const useManualJournalsColumns = () => {
|
|||||||
disableSortBy: true,
|
disableSortBy: true,
|
||||||
width: 85,
|
width: 85,
|
||||||
className: 'note',
|
className: 'note',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'created_at',
|
id: 'created_at',
|
||||||
@@ -63,8 +69,9 @@ export const useManualJournalsColumns = () => {
|
|||||||
accessor: (r) => moment(r.created_at).format('YYYY MMM DD'),
|
accessor: (r) => moment(r.created_at).format('YYYY MMM DD'),
|
||||||
width: 125,
|
width: 125,
|
||||||
className: 'created_at',
|
className: 'created_at',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -95,6 +95,11 @@ function CustomersTable({
|
|||||||
openDrawer('contact-detail-drawer', { contactId: id });
|
openDrawer('contact-detail-drawer', { contactId: id });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Handle cell click.
|
||||||
|
const handleCellClick = (cell, event) => {
|
||||||
|
openDrawer('contact-detail-drawer', { contactId: cell.row.original.id });
|
||||||
|
};
|
||||||
|
|
||||||
if (isEmptyStatus) {
|
if (isEmptyStatus) {
|
||||||
return <CustomersEmptyStatus />;
|
return <CustomersEmptyStatus />;
|
||||||
}
|
}
|
||||||
@@ -121,6 +126,7 @@ function CustomersTable({
|
|||||||
autoResetPage={false}
|
autoResetPage={false}
|
||||||
TableLoadingRenderer={TableSkeletonRows}
|
TableLoadingRenderer={TableSkeletonRows}
|
||||||
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
||||||
|
onCellClick={handleCellClick}
|
||||||
payload={{
|
payload={{
|
||||||
onDelete: handleCustomerDelete,
|
onDelete: handleCustomerDelete,
|
||||||
onEdit: handleCustomerEdit,
|
onEdit: handleCustomerEdit,
|
||||||
|
|||||||
@@ -104,6 +104,7 @@ export function useCustomersTableColumns() {
|
|||||||
width: 45,
|
width: 45,
|
||||||
disableResizing: true,
|
disableResizing: true,
|
||||||
disableSortBy: true,
|
disableSortBy: true,
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'display_name',
|
id: 'display_name',
|
||||||
@@ -111,6 +112,7 @@ export function useCustomersTableColumns() {
|
|||||||
accessor: 'display_name',
|
accessor: 'display_name',
|
||||||
className: 'display_name',
|
className: 'display_name',
|
||||||
width: 150,
|
width: 150,
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'company_name',
|
id: 'company_name',
|
||||||
@@ -118,6 +120,7 @@ export function useCustomersTableColumns() {
|
|||||||
accessor: 'company_name',
|
accessor: 'company_name',
|
||||||
className: 'company_name',
|
className: 'company_name',
|
||||||
width: 150,
|
width: 150,
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'work_phone',
|
id: 'work_phone',
|
||||||
@@ -125,6 +128,7 @@ export function useCustomersTableColumns() {
|
|||||||
accessor: PhoneNumberAccessor,
|
accessor: PhoneNumberAccessor,
|
||||||
className: 'phone_number',
|
className: 'phone_number',
|
||||||
width: 100,
|
width: 100,
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'balance',
|
id: 'balance',
|
||||||
@@ -132,6 +136,7 @@ export function useCustomersTableColumns() {
|
|||||||
accessor: BalanceAccessor,
|
accessor: BalanceAccessor,
|
||||||
className: 'receivable_balance',
|
className: 'receivable_balance',
|
||||||
width: 100,
|
width: 100,
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[],
|
[],
|
||||||
|
|||||||
@@ -78,6 +78,11 @@ function ExpensesDataTable({
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Handle cell click.
|
||||||
|
const handleCellClick = (cell, event) => {
|
||||||
|
openDrawer('expense-drawer', { expenseId: cell.row.original.id });
|
||||||
|
};
|
||||||
|
|
||||||
// Display empty status instead of the table.
|
// Display empty status instead of the table.
|
||||||
if (isEmptyStatus) {
|
if (isEmptyStatus) {
|
||||||
return <ExpensesEmptyStatus />;
|
return <ExpensesEmptyStatus />;
|
||||||
@@ -103,6 +108,7 @@ function ExpensesDataTable({
|
|||||||
TableLoadingRenderer={TableSkeletonRows}
|
TableLoadingRenderer={TableSkeletonRows}
|
||||||
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
||||||
ContextMenu={ActionsMenu}
|
ContextMenu={ActionsMenu}
|
||||||
|
onCellClick={handleCellClick}
|
||||||
payload={{
|
payload={{
|
||||||
onPublish: handlePublishExpense,
|
onPublish: handlePublishExpense,
|
||||||
onDelete: handleDeleteExpense,
|
onDelete: handleDeleteExpense,
|
||||||
|
|||||||
@@ -138,6 +138,7 @@ export function useExpensesTableColumns() {
|
|||||||
accessor: (r) => moment(r.payment_date).format('YYYY MMM DD'),
|
accessor: (r) => moment(r.payment_date).format('YYYY MMM DD'),
|
||||||
width: 140,
|
width: 140,
|
||||||
className: 'payment_date',
|
className: 'payment_date',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'amount',
|
id: 'amount',
|
||||||
@@ -145,6 +146,7 @@ export function useExpensesTableColumns() {
|
|||||||
accessor: TotalAmountAccessor,
|
accessor: TotalAmountAccessor,
|
||||||
className: 'amount',
|
className: 'amount',
|
||||||
width: 150,
|
width: 150,
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'payment_account',
|
id: 'payment_account',
|
||||||
@@ -152,6 +154,7 @@ export function useExpensesTableColumns() {
|
|||||||
accessor: 'payment_account.name',
|
accessor: 'payment_account.name',
|
||||||
className: 'payment_account',
|
className: 'payment_account',
|
||||||
width: 150,
|
width: 150,
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'expense_account',
|
id: 'expense_account',
|
||||||
@@ -160,6 +163,7 @@ export function useExpensesTableColumns() {
|
|||||||
width: 160,
|
width: 160,
|
||||||
className: 'expense_account',
|
className: 'expense_account',
|
||||||
disableSortBy: true,
|
disableSortBy: true,
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'published',
|
id: 'published',
|
||||||
@@ -167,6 +171,7 @@ export function useExpensesTableColumns() {
|
|||||||
accessor: PublishAccessor,
|
accessor: PublishAccessor,
|
||||||
width: 100,
|
width: 100,
|
||||||
className: 'publish',
|
className: 'publish',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'description',
|
id: 'description',
|
||||||
@@ -175,6 +180,7 @@ export function useExpensesTableColumns() {
|
|||||||
width: 150,
|
width: 150,
|
||||||
className: 'description',
|
className: 'description',
|
||||||
disableSortBy: true,
|
disableSortBy: true,
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[],
|
[],
|
||||||
|
|||||||
@@ -66,7 +66,12 @@ function InventoryAdjustmentDataTable({
|
|||||||
},
|
},
|
||||||
[setInventoryAdjustmentTableState],
|
[setInventoryAdjustmentTableState],
|
||||||
);
|
);
|
||||||
|
// Handle cell click.
|
||||||
|
const handleCellClick = (cell, event) => {
|
||||||
|
openDrawer('inventory-adjustment-drawer', {
|
||||||
|
inventoryId: cell.row.original.id,
|
||||||
|
});
|
||||||
|
};
|
||||||
return (
|
return (
|
||||||
<DataTable
|
<DataTable
|
||||||
columns={columns}
|
columns={columns}
|
||||||
@@ -83,6 +88,7 @@ function InventoryAdjustmentDataTable({
|
|||||||
pagesCount={pagination.pagesCount}
|
pagesCount={pagination.pagesCount}
|
||||||
autoResetSortBy={false}
|
autoResetSortBy={false}
|
||||||
autoResetPage={false}
|
autoResetPage={false}
|
||||||
|
onCellClick={handleCellClick}
|
||||||
payload={{
|
payload={{
|
||||||
onDelete: handleDeleteAdjustment,
|
onDelete: handleDeleteAdjustment,
|
||||||
onPublish: handlePublishInventoryAdjustment,
|
onPublish: handlePublishInventoryAdjustment,
|
||||||
|
|||||||
@@ -143,6 +143,7 @@ export const useInventoryAdjustmentsColumns = () => {
|
|||||||
accessor: (r) => moment(r.date).format('YYYY MMM DD'),
|
accessor: (r) => moment(r.date).format('YYYY MMM DD'),
|
||||||
width: 115,
|
width: 115,
|
||||||
className: 'date',
|
className: 'date',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'type',
|
id: 'type',
|
||||||
@@ -150,6 +151,7 @@ export const useInventoryAdjustmentsColumns = () => {
|
|||||||
accessor: TypeAccessor,
|
accessor: TypeAccessor,
|
||||||
className: 'type',
|
className: 'type',
|
||||||
width: 100,
|
width: 100,
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'reason',
|
id: 'reason',
|
||||||
@@ -157,6 +159,7 @@ export const useInventoryAdjustmentsColumns = () => {
|
|||||||
accessor: 'reason',
|
accessor: 'reason',
|
||||||
className: 'reason',
|
className: 'reason',
|
||||||
width: 115,
|
width: 115,
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'reference_no',
|
id: 'reference_no',
|
||||||
@@ -164,6 +167,7 @@ export const useInventoryAdjustmentsColumns = () => {
|
|||||||
accessor: 'reference_no',
|
accessor: 'reference_no',
|
||||||
className: 'reference_no',
|
className: 'reference_no',
|
||||||
width: 100,
|
width: 100,
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'published_at',
|
id: 'published_at',
|
||||||
@@ -171,6 +175,7 @@ export const useInventoryAdjustmentsColumns = () => {
|
|||||||
accessor: PublishAccessor,
|
accessor: PublishAccessor,
|
||||||
width: 95,
|
width: 95,
|
||||||
className: 'publish',
|
className: 'publish',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'description',
|
id: 'description',
|
||||||
@@ -179,6 +184,7 @@ export const useInventoryAdjustmentsColumns = () => {
|
|||||||
disableSorting: true,
|
disableSorting: true,
|
||||||
width: 85,
|
width: 85,
|
||||||
className: 'description',
|
className: 'description',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'created_at',
|
id: 'created_at',
|
||||||
@@ -186,6 +192,7 @@ export const useInventoryAdjustmentsColumns = () => {
|
|||||||
accessor: (r) => moment(r.created_at).format('YYYY MMM DD'),
|
accessor: (r) => moment(r.created_at).format('YYYY MMM DD'),
|
||||||
width: 125,
|
width: 125,
|
||||||
className: 'created_at',
|
className: 'created_at',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[],
|
[],
|
||||||
|
|||||||
@@ -107,6 +107,11 @@ function ItemsDataTable({
|
|||||||
return <ItemsEmptyStatus />;
|
return <ItemsEmptyStatus />;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Handle cell click.
|
||||||
|
const handleCellClick = (cell, event) => {
|
||||||
|
openDrawer('item-detail-drawer', { itemId: cell.row.original.id });
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DataTable
|
<DataTable
|
||||||
columns={columns}
|
columns={columns}
|
||||||
@@ -131,6 +136,7 @@ function ItemsDataTable({
|
|||||||
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
||||||
ContextMenu={ItemsActionMenuList}
|
ContextMenu={ItemsActionMenuList}
|
||||||
onFetchData={handleFetchData}
|
onFetchData={handleFetchData}
|
||||||
|
onCellClick={handleCellClick}
|
||||||
payload={{
|
payload={{
|
||||||
onDeleteItem: handleDeleteItem,
|
onDeleteItem: handleDeleteItem,
|
||||||
onEditItem: handleEditItem,
|
onEditItem: handleEditItem,
|
||||||
|
|||||||
@@ -155,6 +155,7 @@ export const useItemsTableColumns = () => {
|
|||||||
accessor: 'name',
|
accessor: 'name',
|
||||||
className: 'name',
|
className: 'name',
|
||||||
width: 180,
|
width: 180,
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'code',
|
id: 'code',
|
||||||
@@ -162,6 +163,7 @@ export const useItemsTableColumns = () => {
|
|||||||
accessor: 'code',
|
accessor: 'code',
|
||||||
className: 'code',
|
className: 'code',
|
||||||
width: 120,
|
width: 120,
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'type',
|
id: 'type',
|
||||||
@@ -169,6 +171,7 @@ export const useItemsTableColumns = () => {
|
|||||||
accessor: ItemTypeAccessor,
|
accessor: ItemTypeAccessor,
|
||||||
className: 'item_type',
|
className: 'item_type',
|
||||||
width: 120,
|
width: 120,
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'category',
|
id: 'category',
|
||||||
@@ -176,6 +179,7 @@ export const useItemsTableColumns = () => {
|
|||||||
accessor: 'category.name',
|
accessor: 'category.name',
|
||||||
className: 'category',
|
className: 'category',
|
||||||
width: 150,
|
width: 150,
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'sell_price',
|
id: 'sell_price',
|
||||||
@@ -183,6 +187,7 @@ export const useItemsTableColumns = () => {
|
|||||||
accessor: 'sell_price_formatted',
|
accessor: 'sell_price_formatted',
|
||||||
className: 'sell-price',
|
className: 'sell-price',
|
||||||
width: 150,
|
width: 150,
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'cost_price',
|
id: 'cost_price',
|
||||||
@@ -190,6 +195,7 @@ export const useItemsTableColumns = () => {
|
|||||||
accessor: 'cost_price_formatted',
|
accessor: 'cost_price_formatted',
|
||||||
className: 'cost-price',
|
className: 'cost-price',
|
||||||
width: 150,
|
width: 150,
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'quantity_on_hand',
|
id: 'quantity_on_hand',
|
||||||
@@ -197,6 +203,7 @@ export const useItemsTableColumns = () => {
|
|||||||
accessor: 'quantity_on_hand',
|
accessor: 'quantity_on_hand',
|
||||||
Cell: QuantityOnHandCell,
|
Cell: QuantityOnHandCell,
|
||||||
width: 140,
|
width: 140,
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[],
|
[],
|
||||||
|
|||||||
@@ -86,6 +86,11 @@ function BillsDataTable({
|
|||||||
openDrawer('bill-drawer', { billId: id });
|
openDrawer('bill-drawer', { billId: id });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Handle cell click.
|
||||||
|
const handleCellClick = (cell, event) => {
|
||||||
|
openDrawer('bill-drawer', { billId: cell.row.original.id });
|
||||||
|
};
|
||||||
|
|
||||||
if (isEmptyStatus) {
|
if (isEmptyStatus) {
|
||||||
return <BillsEmptyStatus />;
|
return <BillsEmptyStatus />;
|
||||||
}
|
}
|
||||||
@@ -108,6 +113,7 @@ function BillsDataTable({
|
|||||||
TableLoadingRenderer={TableSkeletonRows}
|
TableLoadingRenderer={TableSkeletonRows}
|
||||||
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
||||||
ContextMenu={ActionsMenu}
|
ContextMenu={ActionsMenu}
|
||||||
|
onCellClick={handleCellClick}
|
||||||
payload={{
|
payload={{
|
||||||
onDelete: handleDeleteBill,
|
onDelete: handleDeleteBill,
|
||||||
onEdit: handleEditBill,
|
onEdit: handleEditBill,
|
||||||
|
|||||||
@@ -159,6 +159,7 @@ export function useBillsTableColumns() {
|
|||||||
accessor: (r) => moment(r.bill_date).format('YYYY MMM DD'),
|
accessor: (r) => moment(r.bill_date).format('YYYY MMM DD'),
|
||||||
width: 110,
|
width: 110,
|
||||||
className: 'bill_date',
|
className: 'bill_date',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'vendor',
|
id: 'vendor',
|
||||||
@@ -166,6 +167,7 @@ export function useBillsTableColumns() {
|
|||||||
accessor: 'vendor.display_name',
|
accessor: 'vendor.display_name',
|
||||||
width: 180,
|
width: 180,
|
||||||
className: 'vendor',
|
className: 'vendor',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'bill_number',
|
id: 'bill_number',
|
||||||
@@ -173,6 +175,7 @@ export function useBillsTableColumns() {
|
|||||||
accessor: (row) => (row.bill_number ? `#${row.bill_number}` : null),
|
accessor: (row) => (row.bill_number ? `#${row.bill_number}` : null),
|
||||||
width: 100,
|
width: 100,
|
||||||
className: 'bill_number',
|
className: 'bill_number',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'amount',
|
id: 'amount',
|
||||||
@@ -180,6 +183,7 @@ export function useBillsTableColumns() {
|
|||||||
accessor: AmountAccessor,
|
accessor: AmountAccessor,
|
||||||
width: 120,
|
width: 120,
|
||||||
className: 'amount',
|
className: 'amount',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'status',
|
id: 'status',
|
||||||
@@ -187,6 +191,7 @@ export function useBillsTableColumns() {
|
|||||||
accessor: StatusAccessor,
|
accessor: StatusAccessor,
|
||||||
width: 160,
|
width: 160,
|
||||||
className: 'status',
|
className: 'status',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'due_date',
|
id: 'due_date',
|
||||||
@@ -194,6 +199,7 @@ export function useBillsTableColumns() {
|
|||||||
accessor: (r) => moment(r.due_date).format('YYYY MMM DD'),
|
accessor: (r) => moment(r.due_date).format('YYYY MMM DD'),
|
||||||
width: 110,
|
width: 110,
|
||||||
className: 'due_date',
|
className: 'due_date',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'reference_no',
|
id: 'reference_no',
|
||||||
@@ -201,6 +207,7 @@ export function useBillsTableColumns() {
|
|||||||
accessor: 'reference_no',
|
accessor: 'reference_no',
|
||||||
width: 90,
|
width: 90,
|
||||||
className: 'reference_no',
|
className: 'reference_no',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[],
|
[],
|
||||||
|
|||||||
@@ -63,6 +63,13 @@ function PaymentMadesTable({
|
|||||||
openDrawer('payment-made-detail-drawer', { paymentMadeId: id });
|
openDrawer('payment-made-detail-drawer', { paymentMadeId: id });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Handle cell click.
|
||||||
|
const handleCellClick = (cell, event) => {
|
||||||
|
openDrawer('payment-made-detail-drawer', {
|
||||||
|
paymentMadeId: cell.row.original.id,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// Handle datatable fetch data once the table state change.
|
// Handle datatable fetch data once the table state change.
|
||||||
const handleDataTableFetchData = useCallback(
|
const handleDataTableFetchData = useCallback(
|
||||||
({ pageIndex, pageSize, sortBy }) => {
|
({ pageIndex, pageSize, sortBy }) => {
|
||||||
@@ -96,6 +103,7 @@ function PaymentMadesTable({
|
|||||||
TableLoadingRenderer={TableSkeletonRows}
|
TableLoadingRenderer={TableSkeletonRows}
|
||||||
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
||||||
ContextMenu={ActionsMenu}
|
ContextMenu={ActionsMenu}
|
||||||
|
onCellClick={handleCellClick}
|
||||||
payload={{
|
payload={{
|
||||||
onEdit: handleEditPaymentMade,
|
onEdit: handleEditPaymentMade,
|
||||||
onDelete: handleDeletePaymentMade,
|
onDelete: handleDeletePaymentMade,
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ export function usePaymentMadesTableColumns() {
|
|||||||
accessor: 'payment_date',
|
accessor: 'payment_date',
|
||||||
width: 140,
|
width: 140,
|
||||||
className: 'payment_date',
|
className: 'payment_date',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'vendor',
|
id: 'vendor',
|
||||||
@@ -85,6 +86,7 @@ export function usePaymentMadesTableColumns() {
|
|||||||
accessor: 'vendor.display_name',
|
accessor: 'vendor.display_name',
|
||||||
width: 140,
|
width: 140,
|
||||||
className: 'vendor_id',
|
className: 'vendor_id',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'payment_number',
|
id: 'payment_number',
|
||||||
@@ -93,6 +95,7 @@ export function usePaymentMadesTableColumns() {
|
|||||||
row.payment_number ? `#${row.payment_number}` : null,
|
row.payment_number ? `#${row.payment_number}` : null,
|
||||||
width: 140,
|
width: 140,
|
||||||
className: 'payment_number',
|
className: 'payment_number',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'payment_account',
|
id: 'payment_account',
|
||||||
@@ -100,6 +103,7 @@ export function usePaymentMadesTableColumns() {
|
|||||||
accessor: 'payment_account.name',
|
accessor: 'payment_account.name',
|
||||||
width: 140,
|
width: 140,
|
||||||
className: 'payment_account_id',
|
className: 'payment_account_id',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'amount',
|
id: 'amount',
|
||||||
@@ -107,6 +111,7 @@ export function usePaymentMadesTableColumns() {
|
|||||||
accessor: AmountAccessor,
|
accessor: AmountAccessor,
|
||||||
width: 140,
|
width: 140,
|
||||||
className: 'amount',
|
className: 'amount',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'reference_no',
|
id: 'reference_no',
|
||||||
@@ -114,6 +119,7 @@ export function usePaymentMadesTableColumns() {
|
|||||||
accessor: 'reference',
|
accessor: 'reference',
|
||||||
width: 140,
|
width: 140,
|
||||||
className: 'reference',
|
className: 'reference',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[],
|
[],
|
||||||
|
|||||||
@@ -90,6 +90,10 @@ function EstimatesDataTable({
|
|||||||
openDialog('estimate-pdf-preview', { estimateId: id });
|
openDialog('estimate-pdf-preview', { estimateId: id });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Handle cell click.
|
||||||
|
const handleCellClick = (cell, event) => {
|
||||||
|
openDrawer('estimate-detail-drawer', { estimateId: cell.row.original.id });
|
||||||
|
};
|
||||||
// Handles fetch data.
|
// Handles fetch data.
|
||||||
const handleFetchData = useCallback(
|
const handleFetchData = useCallback(
|
||||||
({ pageIndex, pageSize, sortBy }) => {
|
({ pageIndex, pageSize, sortBy }) => {
|
||||||
@@ -125,6 +129,7 @@ function EstimatesDataTable({
|
|||||||
TableLoadingRenderer={TableSkeletonRows}
|
TableLoadingRenderer={TableSkeletonRows}
|
||||||
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
||||||
ContextMenu={ActionsMenu}
|
ContextMenu={ActionsMenu}
|
||||||
|
onCellClick={handleCellClick}
|
||||||
payload={{
|
payload={{
|
||||||
onApprove: handleApproveEstimate,
|
onApprove: handleApproveEstimate,
|
||||||
onEdit: handleEditEstimate,
|
onEdit: handleEditEstimate,
|
||||||
|
|||||||
@@ -164,6 +164,7 @@ export function useEstiamtesTableColumns() {
|
|||||||
Cell: DateCell,
|
Cell: DateCell,
|
||||||
width: 140,
|
width: 140,
|
||||||
className: 'estimate_date',
|
className: 'estimate_date',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'customer',
|
id: 'customer',
|
||||||
@@ -171,6 +172,7 @@ export function useEstiamtesTableColumns() {
|
|||||||
accessor: 'customer.display_name',
|
accessor: 'customer.display_name',
|
||||||
width: 140,
|
width: 140,
|
||||||
className: 'customer_id',
|
className: 'customer_id',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'expiration_date',
|
id: 'expiration_date',
|
||||||
@@ -179,6 +181,7 @@ export function useEstiamtesTableColumns() {
|
|||||||
Cell: DateCell,
|
Cell: DateCell,
|
||||||
width: 140,
|
width: 140,
|
||||||
className: 'expiration_date',
|
className: 'expiration_date',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'estimate_number',
|
id: 'estimate_number',
|
||||||
@@ -187,6 +190,7 @@ export function useEstiamtesTableColumns() {
|
|||||||
row.estimate_number ? `#${row.estimate_number}` : null,
|
row.estimate_number ? `#${row.estimate_number}` : null,
|
||||||
width: 140,
|
width: 140,
|
||||||
className: 'estimate_number',
|
className: 'estimate_number',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'amount',
|
id: 'amount',
|
||||||
@@ -194,6 +198,7 @@ export function useEstiamtesTableColumns() {
|
|||||||
accessor: AmountAccessor,
|
accessor: AmountAccessor,
|
||||||
width: 140,
|
width: 140,
|
||||||
className: 'amount',
|
className: 'amount',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'status',
|
id: 'status',
|
||||||
@@ -201,6 +206,7 @@ export function useEstiamtesTableColumns() {
|
|||||||
accessor: (row) => statusAccessor(row),
|
accessor: (row) => statusAccessor(row),
|
||||||
width: 140,
|
width: 140,
|
||||||
className: 'status',
|
className: 'status',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'reference_no',
|
id: 'reference_no',
|
||||||
@@ -208,6 +214,7 @@ export function useEstiamtesTableColumns() {
|
|||||||
accessor: 'reference',
|
accessor: 'reference',
|
||||||
width: 90,
|
width: 90,
|
||||||
className: 'reference',
|
className: 'reference',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[],
|
[],
|
||||||
|
|||||||
@@ -86,6 +86,10 @@ function InvoicesDataTable({
|
|||||||
openDialog('invoice-pdf-preview', { invoiceId: id });
|
openDialog('invoice-pdf-preview', { invoiceId: id });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Handle cell click.
|
||||||
|
const handleCellClick = (cell, event) => {
|
||||||
|
openDrawer('invoice-detail-drawer', { invoiceId: cell.row.original.id });
|
||||||
|
};
|
||||||
// Handles fetch data once the table state change.
|
// Handles fetch data once the table state change.
|
||||||
const handleDataTableFetchData = useCallback(
|
const handleDataTableFetchData = useCallback(
|
||||||
({ pageSize, pageIndex, sortBy }) => {
|
({ pageSize, pageIndex, sortBy }) => {
|
||||||
@@ -124,6 +128,7 @@ function InvoicesDataTable({
|
|||||||
TableLoadingRenderer={TableSkeletonRows}
|
TableLoadingRenderer={TableSkeletonRows}
|
||||||
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
||||||
ContextMenu={ActionsMenu}
|
ContextMenu={ActionsMenu}
|
||||||
|
onCellClick={handleCellClick}
|
||||||
payload={{
|
payload={{
|
||||||
onDelete: handleDeleteInvoice,
|
onDelete: handleDeleteInvoice,
|
||||||
onDeliver: handleDeliverInvoice,
|
onDeliver: handleDeliverInvoice,
|
||||||
|
|||||||
@@ -174,6 +174,7 @@ export function useInvoicesTableColumns() {
|
|||||||
accessor: (r) => moment(r.invoice_date).format('YYYY MMM DD'),
|
accessor: (r) => moment(r.invoice_date).format('YYYY MMM DD'),
|
||||||
width: 110,
|
width: 110,
|
||||||
className: 'invoice_date',
|
className: 'invoice_date',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'customer',
|
id: 'customer',
|
||||||
@@ -181,6 +182,7 @@ export function useInvoicesTableColumns() {
|
|||||||
accessor: 'customer.display_name',
|
accessor: 'customer.display_name',
|
||||||
width: 180,
|
width: 180,
|
||||||
className: 'customer_id',
|
className: 'customer_id',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
@@ -189,6 +191,7 @@ export function useInvoicesTableColumns() {
|
|||||||
accessor: 'invoice_no',
|
accessor: 'invoice_no',
|
||||||
width: 100,
|
width: 100,
|
||||||
className: 'invoice_no',
|
className: 'invoice_no',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'balance',
|
id: 'balance',
|
||||||
@@ -198,6 +201,7 @@ export function useInvoicesTableColumns() {
|
|||||||
),
|
),
|
||||||
width: 120,
|
width: 120,
|
||||||
className: 'balance',
|
className: 'balance',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'status',
|
id: 'status',
|
||||||
@@ -205,6 +209,7 @@ export function useInvoicesTableColumns() {
|
|||||||
accessor: (row) => statusAccessor(row),
|
accessor: (row) => statusAccessor(row),
|
||||||
width: 160,
|
width: 160,
|
||||||
className: 'status',
|
className: 'status',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'due_date',
|
id: 'due_date',
|
||||||
@@ -212,6 +217,7 @@ export function useInvoicesTableColumns() {
|
|||||||
accessor: (r) => moment(r.due_date).format('YYYY MMM DD'),
|
accessor: (r) => moment(r.due_date).format('YYYY MMM DD'),
|
||||||
width: 110,
|
width: 110,
|
||||||
className: 'due_date',
|
className: 'due_date',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'reference_no',
|
id: 'reference_no',
|
||||||
@@ -219,8 +225,9 @@ export function useInvoicesTableColumns() {
|
|||||||
accessor: 'reference_no',
|
accessor: 'reference_no',
|
||||||
width: 90,
|
width: 90,
|
||||||
className: 'reference_no',
|
className: 'reference_no',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[],
|
[],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,6 +66,13 @@ function PaymentReceivesDataTable({
|
|||||||
openDrawer('payment-receive-detail-drawer', { paymentReceiveId: id });
|
openDrawer('payment-receive-detail-drawer', { paymentReceiveId: id });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Handle cell click.
|
||||||
|
const handleCellClick = (cell, event) => {
|
||||||
|
openDrawer('payment-receive-detail-drawer', {
|
||||||
|
paymentReceiveId: cell.row.original.id,
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// Handle datatable fetch once the table's state changing.
|
// Handle datatable fetch once the table's state changing.
|
||||||
const handleDataTableFetchData = useCallback(
|
const handleDataTableFetchData = useCallback(
|
||||||
({ pageIndex, pageSize, sortBy }) => {
|
({ pageIndex, pageSize, sortBy }) => {
|
||||||
@@ -103,6 +110,7 @@ function PaymentReceivesDataTable({
|
|||||||
TableLoadingRenderer={TableSkeletonRows}
|
TableLoadingRenderer={TableSkeletonRows}
|
||||||
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
||||||
ContextMenu={ActionsMenu}
|
ContextMenu={ActionsMenu}
|
||||||
|
onCellClick={handleCellClick}
|
||||||
payload={{
|
payload={{
|
||||||
onDelete: handleDeletePaymentReceive,
|
onDelete: handleDeletePaymentReceive,
|
||||||
onEdit: handleEditPaymentReceive,
|
onEdit: handleEditPaymentReceive,
|
||||||
|
|||||||
@@ -89,6 +89,7 @@ export function usePaymentReceivesColumns() {
|
|||||||
accessor: PaymentDateAccessor,
|
accessor: PaymentDateAccessor,
|
||||||
width: 140,
|
width: 140,
|
||||||
className: 'payment_date',
|
className: 'payment_date',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'customer',
|
id: 'customer',
|
||||||
@@ -96,6 +97,7 @@ export function usePaymentReceivesColumns() {
|
|||||||
accessor: 'customer.display_name',
|
accessor: 'customer.display_name',
|
||||||
width: 160,
|
width: 160,
|
||||||
className: 'customer_id',
|
className: 'customer_id',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'amount',
|
id: 'amount',
|
||||||
@@ -103,6 +105,7 @@ export function usePaymentReceivesColumns() {
|
|||||||
accessor: AmountAccessor,
|
accessor: AmountAccessor,
|
||||||
width: 120,
|
width: 120,
|
||||||
className: 'amount',
|
className: 'amount',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'payment_receive_no',
|
id: 'payment_receive_no',
|
||||||
@@ -111,6 +114,7 @@ export function usePaymentReceivesColumns() {
|
|||||||
row.payment_receive_no ? `#${row.payment_receive_no}` : null,
|
row.payment_receive_no ? `#${row.payment_receive_no}` : null,
|
||||||
width: 140,
|
width: 140,
|
||||||
className: 'payment_receive_no',
|
className: 'payment_receive_no',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'deposit_account',
|
id: 'deposit_account',
|
||||||
@@ -118,6 +122,7 @@ export function usePaymentReceivesColumns() {
|
|||||||
accessor: 'deposit_account.name',
|
accessor: 'deposit_account.name',
|
||||||
width: 140,
|
width: 140,
|
||||||
className: 'deposit_account_id',
|
className: 'deposit_account_id',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'reference_no',
|
id: 'reference_no',
|
||||||
@@ -125,6 +130,7 @@ export function usePaymentReceivesColumns() {
|
|||||||
accessor: 'reference_no',
|
accessor: 'reference_no',
|
||||||
width: 140,
|
width: 140,
|
||||||
className: 'reference_no',
|
className: 'reference_no',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[],
|
[],
|
||||||
|
|||||||
@@ -95,6 +95,10 @@ function ReceiptsDataTable({
|
|||||||
if (isEmptyStatus) {
|
if (isEmptyStatus) {
|
||||||
return <ReceiptsEmptyStatus />;
|
return <ReceiptsEmptyStatus />;
|
||||||
}
|
}
|
||||||
|
// Handle cell click.
|
||||||
|
const handleCellClick = (cell, event) => {
|
||||||
|
openDrawer('receipt-detail-drawer', { receiptId: cell.row.original.id });
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DataTable
|
<DataTable
|
||||||
@@ -117,6 +121,7 @@ function ReceiptsDataTable({
|
|||||||
TableLoadingRenderer={TableSkeletonRows}
|
TableLoadingRenderer={TableSkeletonRows}
|
||||||
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
||||||
ContextMenu={ActionsMenu}
|
ContextMenu={ActionsMenu}
|
||||||
|
onCellClick={handleCellClick}
|
||||||
payload={{
|
payload={{
|
||||||
onEdit: handleEditReceipt,
|
onEdit: handleEditReceipt,
|
||||||
onDelete: handleDeleteReceipt,
|
onDelete: handleDeleteReceipt,
|
||||||
|
|||||||
@@ -106,6 +106,7 @@ export function useReceiptsTableColumns() {
|
|||||||
accessor: (r) => moment(r.receipt_date).format('YYYY MMM DD'),
|
accessor: (r) => moment(r.receipt_date).format('YYYY MMM DD'),
|
||||||
width: 140,
|
width: 140,
|
||||||
className: 'receipt_date',
|
className: 'receipt_date',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'customer',
|
id: 'customer',
|
||||||
@@ -113,6 +114,7 @@ export function useReceiptsTableColumns() {
|
|||||||
accessor: 'customer.display_name',
|
accessor: 'customer.display_name',
|
||||||
width: 140,
|
width: 140,
|
||||||
className: 'customer_id',
|
className: 'customer_id',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'receipt_number',
|
id: 'receipt_number',
|
||||||
@@ -120,6 +122,7 @@ export function useReceiptsTableColumns() {
|
|||||||
accessor: 'receipt_number',
|
accessor: 'receipt_number',
|
||||||
width: 140,
|
width: 140,
|
||||||
className: 'receipt_number',
|
className: 'receipt_number',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'deposit_account',
|
id: 'deposit_account',
|
||||||
@@ -127,6 +130,7 @@ export function useReceiptsTableColumns() {
|
|||||||
accessor: 'deposit_account.name',
|
accessor: 'deposit_account.name',
|
||||||
width: 140,
|
width: 140,
|
||||||
className: 'deposit_account',
|
className: 'deposit_account',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'amount',
|
id: 'amount',
|
||||||
@@ -134,6 +138,7 @@ export function useReceiptsTableColumns() {
|
|||||||
accessor: (r) => <Money amount={r.amount} currency={r.currency_code} />,
|
accessor: (r) => <Money amount={r.amount} currency={r.currency_code} />,
|
||||||
width: 140,
|
width: 140,
|
||||||
className: 'amount',
|
className: 'amount',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'status',
|
id: 'status',
|
||||||
@@ -141,6 +146,7 @@ export function useReceiptsTableColumns() {
|
|||||||
accessor: StatusAccessor,
|
accessor: StatusAccessor,
|
||||||
width: 140,
|
width: 140,
|
||||||
className: 'status',
|
className: 'status',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'reference_no',
|
id: 'reference_no',
|
||||||
@@ -148,6 +154,7 @@ export function useReceiptsTableColumns() {
|
|||||||
accessor: 'reference_no',
|
accessor: 'reference_no',
|
||||||
width: 140,
|
width: 140,
|
||||||
className: 'reference_no',
|
className: 'reference_no',
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[],
|
[],
|
||||||
|
|||||||
@@ -85,7 +85,11 @@ function VendorsTable({
|
|||||||
const handleViewDetailVendor = ({ id }) => {
|
const handleViewDetailVendor = ({ id }) => {
|
||||||
openDrawer('contact-detail-drawer', { contactId: id });
|
openDrawer('contact-detail-drawer', { contactId: id });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Handle cell click.
|
||||||
|
const handleCellClick = (cell, event) => {
|
||||||
|
openDrawer('contact-detail-drawer', { contactId: cell.row.original.id });
|
||||||
|
};
|
||||||
// Handle fetch data once the page index, size or sort by of the table change.
|
// Handle fetch data once the page index, size or sort by of the table change.
|
||||||
const handleFetchData = React.useCallback(
|
const handleFetchData = React.useCallback(
|
||||||
({ pageSize, pageIndex, sortBy }) => {
|
({ pageSize, pageIndex, sortBy }) => {
|
||||||
@@ -124,6 +128,7 @@ function VendorsTable({
|
|||||||
TableLoadingRenderer={TableSkeletonRows}
|
TableLoadingRenderer={TableSkeletonRows}
|
||||||
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
TableHeaderSkeletonRenderer={TableSkeletonHeader}
|
||||||
ContextMenu={ActionsMenu}
|
ContextMenu={ActionsMenu}
|
||||||
|
onCellClick={handleCellClick}
|
||||||
payload={{
|
payload={{
|
||||||
onEdit: handleEditVendor,
|
onEdit: handleEditVendor,
|
||||||
onDelete: handleDeleteVendor,
|
onDelete: handleDeleteVendor,
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ export function useVendorsTableColumns() {
|
|||||||
width: 45,
|
width: 45,
|
||||||
disableResizing: true,
|
disableResizing: true,
|
||||||
disableSortBy: true,
|
disableSortBy: true,
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'display_name',
|
id: 'display_name',
|
||||||
@@ -124,6 +125,7 @@ export function useVendorsTableColumns() {
|
|||||||
accessor: 'display_name',
|
accessor: 'display_name',
|
||||||
className: 'display_name',
|
className: 'display_name',
|
||||||
width: 150,
|
width: 150,
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'company_name',
|
id: 'company_name',
|
||||||
@@ -131,6 +133,7 @@ export function useVendorsTableColumns() {
|
|||||||
accessor: 'company_name',
|
accessor: 'company_name',
|
||||||
className: 'company_name',
|
className: 'company_name',
|
||||||
width: 150,
|
width: 150,
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'work_phone',
|
id: 'work_phone',
|
||||||
@@ -138,6 +141,7 @@ export function useVendorsTableColumns() {
|
|||||||
accessor: PhoneNumberAccessor,
|
accessor: PhoneNumberAccessor,
|
||||||
className: 'work_phone',
|
className: 'work_phone',
|
||||||
width: 100,
|
width: 100,
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'balance',
|
id: 'balance',
|
||||||
@@ -145,6 +149,7 @@ export function useVendorsTableColumns() {
|
|||||||
accessor: BalanceAccessor,
|
accessor: BalanceAccessor,
|
||||||
className: 'receivable_balance',
|
className: 'receivable_balance',
|
||||||
width: 100,
|
width: 100,
|
||||||
|
clickable: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
[],
|
[],
|
||||||
|
|||||||
Reference in New Issue
Block a user