feat(ProfitLoss): WIP

This commit is contained in:
a.bouhuolia
2022-01-29 21:57:39 +02:00
parent 34501a9a61
commit fa455152a3
3 changed files with 8 additions and 47 deletions

View File

@@ -12,7 +12,6 @@ import withDashboardActions from 'containers/Dashboard/withDashboardActions';
import withProfitLossActions from './withProfitLossActions'; import withProfitLossActions from './withProfitLossActions';
import withCurrentOrganization from '../../Organization/withCurrentOrganization'; import withCurrentOrganization from '../../Organization/withCurrentOrganization';
import 'style/pages/FinancialStatements/ProfitLossSheet.scss';
import { ProfitLossSheetProvider } from './ProfitLossProvider'; import { ProfitLossSheetProvider } from './ProfitLossProvider';
import { ProfitLossSheetLoadingBar, ProfitLossSheetAlerts } from './components'; import { ProfitLossSheetLoadingBar, ProfitLossSheetAlerts } from './components';

View File

@@ -10,7 +10,7 @@ const getReportColWidth = (data, accessor, labelText) => {
return getColumnWidth( return getColumnWidth(
data, data,
accessor, accessor,
{ magicSpacing: 9, minWidth: 100 }, { magicSpacing: 10, minWidth: 100 },
labelText, labelText,
); );
}; };
@@ -260,7 +260,7 @@ const assocColumnsToTotalColumn = R.curry((data, column, columnAccessor) => {
}); });
/** /**
* * Retrieves the total column.
*/ */
const totalColumn = R.curry((data, column) => { const totalColumn = R.curry((data, column) => {
const hasChildren = isNodeHasChildren(column); const hasChildren = isNodeHasChildren(column);
@@ -275,7 +275,7 @@ const totalColumn = R.curry((data, column) => {
Cell: CellTextSpan, Cell: CellTextSpan,
width, width,
disableSortBy: true, disableSortBy: true,
align: hasChildren ? 'center' : 'right', align: hasChildren ? Align.Center : Align.Right,
}; };
}); });
@@ -323,6 +323,9 @@ const dateRangeSoloColumnAttrs = (data, column) => {
}; };
}; };
/**
* Retrieves date range column.
*/
const dateRangeColumn = R.curry((data, column) => { const dateRangeColumn = R.curry((data, column) => {
const isDateColumnHasColumns = isNodeHasChildren(column); const isDateColumnHasColumns = isNodeHasChildren(column);
@@ -331,7 +334,7 @@ const dateRangeColumn = R.curry((data, column) => {
key: column.key, key: column.key,
disableSortBy: true, disableSortBy: true,
textOverview: true, textOverview: true,
align: Align.Center, align: isDateColumnHasColumns ? Align.Center : Align.Center,
}; };
return R.compose( return R.compose(
R.when( R.when(
@@ -374,5 +377,6 @@ const dynamicColumnMapper = R.curry((data, column) => {
* @returns * @returns
*/ */
export const dynamicColumns = (columns, data) => { export const dynamicColumns = (columns, data) => {
debugger;
return R.map(dynamicColumnMapper(data), columns); return R.map(dynamicColumnMapper(data), columns);
}; };

View File

@@ -1,42 +0,0 @@
.financial-sheet{
&--profit-loss-sheet{
.financial-sheet__table{
.thead,
.tbody{
.tr .td:not(:first-child),
.tr .th:not(:first-child) {
text-align: right;
}
}
.tbody{
.tr .td{
border-bottom: 0;
padding-top: 0.4rem;
padding-bottom: 0.4rem;
}
.tr.row_type--total{
font-weight: 500;
}
.tr.row_type--section_total .td{
border-top: 1px solid #BBB
}
.tr.row_type--section_total + .tr .td{
border-top: 1px solid #666;
}
.tr.row_type--net_income_total.row_type--total .td{
border-bottom: 3px double #333;
}
.tr.is-expanded{
.td.total,
.td.total-period{
.cell-text{
display: none;
}
}
}
}
}
}
}