feat: wip journal and general ledger dyanmic columns

This commit is contained in:
Ahmed Bouhuolia
2024-01-06 20:16:22 +02:00
parent c71836ec27
commit 79f3f1b63d
15 changed files with 615 additions and 214 deletions

View File

@@ -13,7 +13,7 @@ import {
} from '@/components';
import { useGeneralLedgerContext } from './GeneralLedgerProvider';
import { useGeneralLedgerTableColumns } from './components';
import { useGeneralLedgerTableColumns } from './dynamicColumns';
/**
* General ledger table.
@@ -21,7 +21,7 @@ import { useGeneralLedgerTableColumns } from './components';
export default function GeneralLedgerTable({ companyName }) {
// General ledger context.
const {
generalLedger: { tableRows, query },
generalLedger: { query, table },
isLoading,
} = useGeneralLedgerContext();
@@ -30,8 +30,8 @@ export default function GeneralLedgerTable({ companyName }) {
// Default expanded rows of general ledger table.
const expandedRows = useMemo(
() => defaultExpanderReducer(tableRows, 1),
[tableRows],
() => defaultExpanderReducer(table.rows, 1),
[table.rows],
);
return (
@@ -48,7 +48,7 @@ export default function GeneralLedgerTable({ companyName }) {
'this_report_does_not_contain_any_data_between_date_period',
)}
columns={columns}
data={tableRows}
data={table.rows}
rowClassNames={tableRowTypesToClassnames}
expanded={expandedRows}
virtualizedRows={true}