mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
feat: export reports csv and xlsx (#286)
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
import { IARAgingSummaryQuery, IARAgingSummaryTable } from '@/interfaces';
|
||||
import { Inject, Service } from 'typedi';
|
||||
import ARAgingSummaryTable from './ARAgingSummaryTable';
|
||||
import ARAgingSummaryService from './ARAgingSummaryService';
|
||||
|
||||
@Service()
|
||||
export class ARAgingSummaryTableInjectable {
|
||||
@Inject()
|
||||
private ARAgingSummarySheet: ARAgingSummaryService;
|
||||
|
||||
/**
|
||||
* Retrieves A/R aging summary in table format.
|
||||
* @param {number} tenantId
|
||||
* @param {IARAgingSummaryQuery} query
|
||||
* @returns {Promise<IARAgingSummaryTable>}
|
||||
*/
|
||||
public async table(
|
||||
tenantId: number,
|
||||
query: IARAgingSummaryQuery
|
||||
): Promise<IARAgingSummaryTable> {
|
||||
const report = await this.ARAgingSummarySheet.ARAgingSummary(
|
||||
tenantId,
|
||||
query
|
||||
);
|
||||
const table = new ARAgingSummaryTable(report.data, query, {});
|
||||
|
||||
return {
|
||||
table: {
|
||||
columns: table.tableColumns(),
|
||||
rows: table.tableRows(),
|
||||
},
|
||||
meta: report.meta,
|
||||
query,
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user