- fixed preview of the application;
This commit is contained in:
@@ -6,6 +6,7 @@ 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)
|
||||
@@ -31,7 +32,7 @@ const RenderTable = ({ tableValue = {}, columnsCfg, lastRowCfg, setTableValueFn,
|
||||
.map(v => isEmpty(v) || isNil(v) ? 0 : v);
|
||||
|
||||
if (cellValue === 'sum') {
|
||||
total = sum(getAllRowsValues);
|
||||
total = getNumberFormatted(sum(getAllRowsValues));
|
||||
} else {
|
||||
total = 0;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { head, isEmpty, isNil, sum } from 'ramda';
|
||||
import getNumberFormatted from '../../../../../../../helpers/getNumberFormatted';
|
||||
|
||||
const LastRowCell = ({columnId, lastRowCfg, columnMeta = {}, getColumnDataFn}) => {
|
||||
const cellData = head(lastRowCfg.filter(o => !isNil(o[columnId])));
|
||||
@@ -9,7 +10,7 @@ const LastRowCell = ({columnId, lastRowCfg, columnMeta = {}, getColumnDataFn}) =
|
||||
.map(v => isEmpty(v) || isNil(v) ? 0 : v);
|
||||
|
||||
if (cellValue === 'sum') {
|
||||
cellValue = sum(getAllRowsValues);
|
||||
cellValue = getNumberFormatted(sum(getAllRowsValues));
|
||||
} else {
|
||||
cellValue = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user