mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 22:00:31 +00:00
feat(server): financial reports meta
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
import { Inject } from 'typedi';
|
||||
import { FinancialSheetMeta } from '../FinancialSheetMeta';
|
||||
import { IAgingSummaryMeta, IAgingSummaryQuery } from '@/interfaces';
|
||||
import moment from 'moment';
|
||||
|
||||
export class AgingSummaryMeta {
|
||||
@Inject()
|
||||
private financialSheetMeta: FinancialSheetMeta;
|
||||
|
||||
/**
|
||||
* Retrieve the aging summary meta.
|
||||
* @param {number} tenantId -
|
||||
* @returns {IBalanceSheetMeta}
|
||||
*/
|
||||
public async meta(
|
||||
tenantId: number,
|
||||
query: IAgingSummaryQuery
|
||||
): Promise<IAgingSummaryMeta> {
|
||||
const commonMeta = await this.financialSheetMeta.meta(tenantId);
|
||||
const formattedAsDate = moment(query.asDate).format('YYYY/MM/DD');
|
||||
const formattedDateRange = `As ${formattedAsDate}`;
|
||||
|
||||
return {
|
||||
...commonMeta,
|
||||
sheetName: 'A/P Aging Summary',
|
||||
formattedAsDate,
|
||||
formattedDateRange,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user