refactor(webapp): AR/AP aging summary table columns

This commit is contained in:
Ahmed Bouhuolia
2023-08-26 01:54:33 +02:00
parent 4e66d1ac98
commit 321de4d327
9 changed files with 174 additions and 140 deletions

View File

@@ -12,8 +12,13 @@ import {
import { tableRowMapper } from '@/utils';
import AgingReport from './AgingReport';
import { AgingSummaryRowType } from './_constants';
import { FinancialTable } from '../FinancialTable';
import { FinancialSheetStructure } from '../FinancialSheetStructure';
export default abstract class AgingSummaryTable extends AgingReport {
export default abstract class AgingSummaryTable extends R.compose(
FinancialSheetStructure,
FinancialTable
)(AgingReport) {
protected readonly report: IAgingSummaryData;
protected readonly query: IAgingSummaryQuery;
protected readonly agingPeriods: IAgingPeriod[];
@@ -193,11 +198,11 @@ export default abstract class AgingSummaryTable extends AgingReport {
* @returns {ITableColumn}
*/
public tableColumns = (): ITableColumn[] => {
return [
return R.compose(this.tableColumnsCellIndexing)([
this.contactNameTableColumn(),
{ label: 'Current', key: 'current' },
...this.agingTableColumns(),
{ label: 'Total', key: 'total' },
];
]);
};
}

View File

@@ -12,7 +12,7 @@ export const FinancialTable = (Base) =>
* @param {ITableColumn[]} columns
* @returns {ITableColumn[]}
*/
protected tableColumnsCellIndexing = (
public tableColumnsCellIndexing = (
columns: ITableColumn[]
): ITableColumn[] => {
const cellIndex = increment(-1);