mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-15 12:20:31 +00:00
feat: Tabular number of all money columns
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
// @ts-nocheck
|
||||
import React, { useMemo } from 'react';
|
||||
import * as R from 'ramda';
|
||||
import { getColumnWidth } from '@/utils';
|
||||
import { Align } from '@/constants';
|
||||
@@ -25,6 +24,7 @@ const currentAccessor = R.curry((data, column) => {
|
||||
className: column.id,
|
||||
width: getColumnWidth(data, accessor, { minWidth: 120 }),
|
||||
align: Align.Right,
|
||||
money: true,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -38,6 +38,7 @@ const totalAccessor = R.curry((data, column) => {
|
||||
className: column.key,
|
||||
width: getColumnWidth(data, accessor, { minWidth: 120 }),
|
||||
align: Align.Right,
|
||||
money: true,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -51,6 +52,7 @@ const agingPeriodAccessor = R.curry((data, column) => {
|
||||
className: column.key,
|
||||
width: getColumnWidth(data, accessor, { minWidth: 120 }),
|
||||
align: Align.Right,
|
||||
money: true,
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import * as R from 'ramda';
|
||||
import { isEmpty } from 'lodash';
|
||||
|
||||
import { Align } from '@/constants';
|
||||
import { CellTextSpan } from '@/components/Datatable/Cells';
|
||||
import { getColumnWidth } from '@/utils';
|
||||
|
||||
const getTableCellValueAccessor = (index) => `cells[${index}].value`;
|
||||
@@ -12,12 +11,11 @@ const getReportColWidth = (data, accessor, headerText) => {
|
||||
return getColumnWidth(
|
||||
data,
|
||||
accessor,
|
||||
{ magicSpacing: 10, minWidth: 100 },
|
||||
{ magicSpacing: 12, minWidth: 100 },
|
||||
headerText,
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Account name column mapper.
|
||||
*/
|
||||
@@ -77,6 +75,7 @@ const dateRangeMapper = R.curry((data, column) => {
|
||||
key: column.key,
|
||||
disableSortBy: true,
|
||||
textOverview: true,
|
||||
money: true,
|
||||
align: isDateColumnHasColumns ? Align.Center : Align.Right,
|
||||
};
|
||||
return R.compose(
|
||||
@@ -104,9 +103,9 @@ const totalMapper = R.curry((data, column) => {
|
||||
Header: column.label,
|
||||
accessor,
|
||||
textOverview: true,
|
||||
Cell: CellTextSpan,
|
||||
width,
|
||||
disableSortBy: true,
|
||||
money: true,
|
||||
align: hasChildren ? Align.Center : Align.Right,
|
||||
};
|
||||
return R.compose(
|
||||
@@ -129,6 +128,7 @@ const percentageOfColumnAccessor = R.curry((data, column) => {
|
||||
align: Align.Right,
|
||||
disableSortBy: true,
|
||||
textOverview: true,
|
||||
money: true,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -147,6 +147,7 @@ const percentageOfRowAccessor = R.curry((data, column) => {
|
||||
align: Align.Right,
|
||||
disableSortBy: true,
|
||||
textOverview: true,
|
||||
money: true,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -165,6 +166,7 @@ const previousYearAccessor = R.curry((data, column) => {
|
||||
align: Align.Right,
|
||||
disableSortBy: true,
|
||||
textOverview: true,
|
||||
money: true,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -183,6 +185,7 @@ const previousYearChangeAccessor = R.curry((data, column) => {
|
||||
align: Align.Right,
|
||||
disableSortBy: true,
|
||||
textOverview: true,
|
||||
money: true,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -201,6 +204,7 @@ const previousYearPercentageAccessor = R.curry((data, column) => {
|
||||
align: Align.Right,
|
||||
disableSortBy: true,
|
||||
textOverview: true,
|
||||
money: true,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -219,6 +223,7 @@ const previousPeriodAccessor = R.curry((data, column) => {
|
||||
align: Align.Right,
|
||||
disableSortBy: true,
|
||||
textOverview: true,
|
||||
money: true,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -237,6 +242,7 @@ const previousPeriodChangeAccessor = R.curry((data, column) => {
|
||||
align: Align.Right,
|
||||
disableSortBy: true,
|
||||
textOverview: true,
|
||||
money: true,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -255,6 +261,7 @@ const previousPeriodPercentageAccessor = R.curry((data, column) => {
|
||||
align: Align.Right,
|
||||
disableSortBy: true,
|
||||
textOverview: true,
|
||||
money: true,
|
||||
};
|
||||
});
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ const numericColumn = R.curry((data, index, column) => ({
|
||||
}),
|
||||
disableSortBy: true,
|
||||
align: Align.Right,
|
||||
money: true,
|
||||
}));
|
||||
|
||||
const columnsMapper = R.curry((data, index, column) => ({
|
||||
|
||||
@@ -41,6 +41,7 @@ const numericColumnAccessor = R.curry((data, column) => {
|
||||
return {
|
||||
...column,
|
||||
align: Align.Right,
|
||||
money: true,
|
||||
width,
|
||||
};
|
||||
});
|
||||
|
||||
@@ -154,6 +154,7 @@ export function useVendorsCreditNoteTableColumns() {
|
||||
clickable: true,
|
||||
textOverview: true,
|
||||
disableSortBy: true,
|
||||
money: true,
|
||||
className: clsx(CLASSES.FONT_BOLD),
|
||||
},
|
||||
{
|
||||
|
||||
@@ -117,6 +117,7 @@ export function usePaymentMadesTableColumns() {
|
||||
className: 'amount',
|
||||
align: 'right',
|
||||
clickable: true,
|
||||
money: true,
|
||||
},
|
||||
{
|
||||
id: 'reference_no',
|
||||
|
||||
@@ -113,6 +113,7 @@ export function usePaymentReceivesColumns() {
|
||||
align: 'right',
|
||||
clickable: true,
|
||||
textOverview: true,
|
||||
money: true,
|
||||
className: clsx(CLASSES.FONT_BOLD),
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user