feat(server): styling financial reports

This commit is contained in:
Ahmed Bouhuolia
2024-02-20 21:36:16 +02:00
parent c06a8d9ca3
commit f6f6bc31b6
12 changed files with 147 additions and 13 deletions

View File

@@ -23,4 +23,42 @@ table tr.row-type--total.row-id--assets td,
table tr.row-type--total.row-id--liability-equity td {
border-bottom: 3px double #000;
}
table .column--name,
table .cell--name {
width: 400px;
}
table .column--total {
width: 25%;
}
table td.cell--total,
table td.cell--previous_year,
table td.cell--previous_year_change,
table td.cell--previous_year_percentage,
table td.cell--previous_period,
table td.cell--previous_period_change,
table td.cell--previous_period_percentage,
table td.cell--percentage_of_row,
table td.cell--percentage_of_column,
table td[class*="cell--date-range"] {
text-align: right;
}
table .column--total,
table .column--previous_year,
table .column--previous_year_change,
table .column--previous_year_percentage,
table .column--previous_period,
table .column--previous_period_change,
table .column--previous_period_percentage,
table .column--percentage_of_row,
table .column--percentage_of_column,
table [class*="column--date-range"] {
text-align: right;
}
`;

View File

@@ -76,7 +76,7 @@ export default class CashFlowTable implements ICashFlowTable {
*/
private commonColumns = () => {
return R.compose(
R.concat([{ key: 'label', accessor: 'label' }]),
R.concat([{ key: 'name', accessor: 'label' }]),
R.when(
R.always(this.isDisplayColumnsBy(DISPLAY_COLUMNS_BY.DATE_PERIODS)),
R.concat(this.datePeriodsColumnsAccessors())

View File

@@ -23,8 +23,11 @@ export class CashflowSheetMeta {
const formattedFromDate = moment(query.fromDate).format('YYYY/MM/DD');
const formattedDateRange = `From ${formattedFromDate} | To ${formattedToDate}`;
const sheetName = 'Statement of Cash Flow';
return {
...meta,
sheetName,
formattedToDate,
formattedFromDate,
formattedDateRange,

View File

@@ -8,7 +8,7 @@ export const HtmlTableCustomCss = `
table tr.row-type--accounts td {
border-top: 1px solid #bbb;
}
table tr.row-id--cash-end-period {
table tr.row-id--cash-end-period td {
border-bottom: 3px double #333;
}
table tr.row-type--total {
@@ -19,4 +19,15 @@ table tr.row-type--total td {
}
table tr.row-type--total:not(:first-child) td {
border-top: 1px solid #bbb;
}`;
}
table .column--name,
table .cell--name {
width: 400px;
}
table .column--total,
table .cell--total,
table [class*="column--date-range"],
table [class*="cell--date-range"] {
text-align: right;
}
`;

View File

@@ -7,4 +7,11 @@ table tr td:not(:first-child) {
}
table tr:last-child td {
border-bottom: 1px solid #ececec;
}`;
}
table .cell--credit,
table .cell--debit,
table .column--credit,
table .column--debit{
text-align: right;
}
`;

View File

@@ -26,4 +26,44 @@ table tr.row-type--total td {
border-top: 1px solid #bbb;
color: #000;
}
table tr.row-id--net-income td{
border-bottom: 3px double #000;
}
table .column--name,
table .cell--name {
width: 400px;
}
table .column--total {
width: 25%;
}
table td.cell--total,
table td.cell--previous_year,
table td.cell--previous_year_change,
table td.cell--previous_year_percentage,
table td.cell--previous_period,
table td.cell--previous_period_change,
table td.cell--previous_period_percentage,
table td.cell--percentage_of_row,
table td.cell--percentage_of_column,
table td[class*="cell--date-range"] {
text-align: right;
}
table .column--total,
table .column--previous_year,
table .column--previous_year_change,
table .column--previous_year_percentage,
table .column--previous_period,
table .column--previous_period_change,
table .column--previous_period_percentage,
table .column--percentage_of_row,
table .column--percentage_of_column,
table [class*="column--date-range"] {
text-align: right;
}
`;

View File

@@ -1,7 +1,6 @@
export enum ROW_TYPE {
TOTAL = 'TOTAL',
ITEM = 'ITEM'
ITEM = 'ITEM',
}
export const HtmlTableCustomCss = `
@@ -10,4 +9,15 @@ table tr.row-type--total td {
border-bottom: 3px double #000;
font-weight: 600;
}
`;
table .column--item_name{
width: 300px;
}
table .column--quantity_purchases,
table .column--purchase_amount,
table .column--average_cost,
table .cell--quantity_purchases,
table .cell--purchase_amount,
table .cell--average_cost{
text-align: right;
}
`;

View File

@@ -9,4 +9,15 @@ table tr.row-type--total td {
border-bottom: 3px double #000;
font-weight: 600;
}
table .column--item_name{
width: 300px;
}
table .column--average_price,
table .column--sold_quantity,
table .column--sold_amount,
table .cell--average_price,
table .cell--sold_quantity,
table .cell--sold_amount{
text-align: right;
}
`;

View File

@@ -19,12 +19,13 @@ export class TrialBalanceSheetTable extends R.compose(
FinancialSheetStructure
)(FinancialSheet) {
/**
* Trial balance sheet data.
* @param {ITrialBalanceSheetData}
*/
public data: ITrialBalanceSheetData;
/**
* Balance sheet query.
* Trial balance sheet query.
* @param {ITrialBalanceSheetQuery}
*/
public query: ITrialBalanceSheetQuery;
@@ -135,7 +136,7 @@ export class TrialBalanceSheetTable extends R.compose(
return R.compose(
this.tableColumnsCellIndexing,
R.concat([
{ key: 'account_name', label: 'Account' },
{ key: 'account', label: 'Account' },
{ key: 'debit', label: 'Debit' },
{ key: 'credit', label: 'Credit' },
{ key: 'total', label: 'Total' },

View File

@@ -9,4 +9,17 @@ table tr.row-type--total td{
font-weight: 500;
border-bottom: 3px double #000;
}
table .column--account {
width: 400px;
}
table .column--debit,
table .column--credit,
table .column--total,
table .cell--debit,
table .cell--credit,
table .cell--total{
text-align: right;
}
`;