diff --git a/src/containers/FinancialStatements/CashFlowStatement/CashFlowStatement.js b/src/containers/FinancialStatements/CashFlowStatement/CashFlowStatement.js
index 08c0ccd64..7b2cfd299 100644
--- a/src/containers/FinancialStatements/CashFlowStatement/CashFlowStatement.js
+++ b/src/containers/FinancialStatements/CashFlowStatement/CashFlowStatement.js
@@ -6,10 +6,9 @@ import { FinancialStatement } from 'components';
import DashboardPageContent from 'components/Dashboard/DashboardPageContent';
import CashFlowStatementHeader from './CashFlowStatementHeader';
-import CashFlowStatementTable from './CashFlowStatementTable';
import CashFlowStatementActionsBar from './CashFlowStatementActionsBar';
+import { CashFlowStatementBody } from './CashFlowStatementBody';
-import withCurrentOrganization from '../../Organization/withCurrentOrganization';
import withCashFlowStatementActions from './withCashFlowStatementActions';
import { CashFlowStatementProvider } from './CashFlowStatementProvider';
import {
@@ -23,8 +22,6 @@ import { compose } from 'utils';
* Cash flow statement.
*/
function CashFlowStatement({
- // #withPreferences
- organizationName,
//#withCashStatementActions
toggleCashFlowStatementFilterDrawer,
}) {
@@ -77,18 +74,11 @@ function CashFlowStatement({
pageFilter={filter}
onSubmitFilter={handleFilterSubmit}
/>
-
diff --git a/src/containers/FinancialStatements/CashFlowStatement/dynamicColumns.js b/src/containers/FinancialStatements/CashFlowStatement/dynamicColumns.js
new file mode 100644
index 000000000..b894cd994
--- /dev/null
+++ b/src/containers/FinancialStatements/CashFlowStatement/dynamicColumns.js
@@ -0,0 +1,78 @@
+import * as R from 'ramda';
+import intl from 'react-intl-universal';
+
+import { Align } from 'common';
+import { CellTextSpan } from 'components/Datatable/Cells';
+import { getColumnWidth } from 'utils';
+
+/**
+ * Account name column mapper.
+ */
+const accountNameMapper = (column) => ({
+ id: column.key,
+ key: column.key,
+ Header: intl.get('account_name'),
+ accessor: 'cells[0].value',
+ className: 'account_name',
+ textOverview: true,
+ width: 400,
+ disableSortBy: true,
+});
+
+/**
+ * Date range columns mapper.
+ */
+const dateRangeMapper = (data, index, column) => ({
+ id: column.key,
+ Header: column.label,
+ key: column.key,
+ accessor: `cells[${index}].value`,
+ width: getColumnWidth(data, `cells.${index}.value`, {
+ magicSpacing: 10,
+ minWidth: 100,
+ }),
+ className: `date-period ${column.key}`,
+ disableSortBy: true,
+ textOverview: true,
+ align: Align.Right,
+});
+
+/**
+ * Total column mapper.
+ */
+const totalMapper = (data, index, column) => ({
+ key: 'total',
+ Header: intl.get('total'),
+ accessor: `cells[${index}].value`,
+ className: 'total',
+ textOverview: true,
+ Cell: CellTextSpan,
+ width: getColumnWidth(data, `cells[${index}].value`, {
+ magicSpacing: 10,
+ minWidth: 100,
+ }),
+ disableSortBy: true,
+ align: Align.Right,
+});
+
+/**
+ * Detarmines the given string starts with `date-range` string.
+ */
+const isMatchesDateRange = (r) => R.match(/^date-range/g, r).length > 0;
+
+/**
+ * Cash flow dynamic columns.
+ */
+export const dynamicColumns = (columns, data) => {
+ const mapper = (column, index) => {
+ return R.compose(
+ R.when(
+ R.pathSatisfies(isMatchesDateRange, ['key']),
+ R.curry(dateRangeMapper)(data, index),
+ ),
+ R.when(R.pathEq(['key'], 'name'), accountNameMapper),
+ R.when(R.pathEq(['key'], 'total'), R.curry(totalMapper)(data, index)),
+ )(column);
+ };
+ return columns.map(mapper);
+};
diff --git a/src/containers/FinancialStatements/CashFlowStatement/utils.js b/src/containers/FinancialStatements/CashFlowStatement/utils.js
index 028c57d7f..e69de29bb 100644
--- a/src/containers/FinancialStatements/CashFlowStatement/utils.js
+++ b/src/containers/FinancialStatements/CashFlowStatement/utils.js
@@ -1,74 +0,0 @@
-import * as R from 'ramda';
-import { CellTextSpan } from 'components/Datatable/Cells';
-import { getColumnWidth } from 'utils';
-import intl from 'react-intl-universal';
-
-/**
- * Account name column mapper.
- */
-const accountNameMapper = (column) => ({
- id: column.key,
- key: column.key,
- Header: intl.get('account_name'),
- accessor: 'cells[0].value',
- className: 'account_name',
- textOverview: true,
- width: 400,
- disableSortBy: true,
-});
-
-/**
- * Date range columns mapper.
- */
-const dateRangeMapper = (data, index, column) => ({
- id: column.key,
- Header: column.label,
- key: column.key,
- accessor: `cells[${index}].value`,
- width: getColumnWidth(data, `cells.${index}.value`, {
- magicSpacing: 10,
- minWidth: 100,
- }),
- className: `date-period ${column.key}`,
- disableSortBy: true,
- textOverview: true,
-});
-
-/**
- * Total column mapper.
- */
-const totalMapper = (data, index, column) => ({
- key: 'total',
- Header: intl.get('total'),
- accessor: `cells[${index}].value`,
- className: 'total',
- textOverview: true,
- Cell: CellTextSpan,
- width: getColumnWidth(data, `cells[${index}].value`, {
- magicSpacing: 10,
- minWidth: 100,
- }),
- disableSortBy: true,
-});
-
-/**
- * Detarmines the given string starts with `date-range` string.
- */
-const isMatchesDateRange = (r) => R.match(/^date-range/g, r).length > 0;
-
-/**
- * Cash flow dynamic columns.
- */
-export const dynamicColumns = (columns, data) => {
- const mapper = (column, index) => {
- return R.compose(
- R.when(
- R.pathSatisfies(isMatchesDateRange, ['key']),
- R.curry(dateRangeMapper)(data, index),
- ),
- R.when(R.pathEq(['key'], 'name'), accountNameMapper),
- R.when(R.pathEq(['key'], 'total'), R.curry(totalMapper)(data, index)),
- )(column);
- };
- return columns.map(mapper);
-};
diff --git a/src/style/pages/FinancialStatements/CashFlowStatement.scss b/src/style/pages/FinancialStatements/CashFlowStatement.scss
index 419d7c8c1..d6fc85b7a 100644
--- a/src/style/pages/FinancialStatements/CashFlowStatement.scss
+++ b/src/style/pages/FinancialStatements/CashFlowStatement.scss
@@ -1,46 +1,7 @@
.financial-sheet {
&--cash-flow-statement {
.financial-sheet__table {
- .thead,
- .tbody {
- .tr .td.account_name ~ .td,
- .tr .th.account_name ~ .th {
- text-align: right;
- }
- }
- .tbody {
- .tr:not(.no-results) {
- // &.row-type--AGGREGATE,
- &.row-type--ACCOUNTS {
- border-top: 1px solid #bbb;
- }
- &.row-type--CASH_END_PERIOD {
- border-bottom: 3px double #333;
- }
- .td {
- border-bottom: 0;
- padding-top: 0.4rem;
- padding-bottom: 0.4rem;
- }
-
- &.row-type--TOTAL {
- font-weight: 500;
-
- &:not(:first-child) .td {
- border-top: 1px solid #bbb;
- }
- }
- }
-
- .tr.is-expanded {
- .td.total,
- .td.date-period {
- .cell-inner {
- display: none;
- }
- }
- }
- }
+
}
}
}