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 withCurrentOrganization from '../../Organization/withCurrentOrganization';
import 'style/pages/FinancialStatements/ProfitLossSheet.scss';
import { ProfitLossSheetProvider } from './ProfitLossProvider';
import { ProfitLossSheetLoadingBar, ProfitLossSheetAlerts } from './components';

View File

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