- updates;

This commit is contained in:
Vitalii Kiiko
2025-02-05 17:01:44 +01:00
parent 0ec9f4e15e
commit a6c35af7ca
7 changed files with 130 additions and 37 deletions

View File

@@ -1,4 +1,5 @@
import { head, isNil, pathOr } from 'ramda';
import getNumberFormatted from '../../../../../../../helpers/getNumberFormatted';
const LastRowCell = ({columnId, lastRowCfg, columnMeta = {}, tableValue = []}) => {
const cellData = head(lastRowCfg.filter(o => !isNil(o[columnId])));
@@ -8,7 +9,7 @@ const LastRowCell = ({columnId, lastRowCfg, columnMeta = {}, tableValue = []}) =
cellValue = pathOr(0, ['total'], tableValue);
}
return <td>{cellValue}</td>;
return <td>{getNumberFormatted(cellValue)}</td>;
};
export default LastRowCell;

View File

@@ -6,7 +6,6 @@ import { head, isEmpty, isNil, pathOr, sum } from 'ramda';
// components
import DefaultCell from './components/DefaultCell';
import LastRowCell from './components/LastRowCell';
import getNumberFormatted from '../../../../../helpers/getNumberFormatted';
const RenderTable = ({ tableValue = {}, columnsCfg, lastRowCfg, setTableValueFn, disabled }) => {
const rows = pathOr([], ['rows'], tableValue)
@@ -32,7 +31,7 @@ const RenderTable = ({ tableValue = {}, columnsCfg, lastRowCfg, setTableValueFn,
.map(v => isEmpty(v) || isNil(v) ? 0 : v);
if (cellValue === 'sum') {
total = getNumberFormatted(sum(getAllRowsValues));
total = sum(getAllRowsValues);
} else {
total = 0;
}