mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
feat(server): journal sheet csv/xlsx export
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
import { Inject } from 'typedi';
|
||||
import { JournalSheetService } from './JournalSheetService';
|
||||
import { JournalSheetTableInjectable } from './JournalSheetTableInjectable';
|
||||
import { IJournalReportQuery, IJournalTable } from '@/interfaces';
|
||||
import { JournalSheetExportInjectable } from './JournalSheetExport';
|
||||
|
||||
export class JournalSheetApplication {
|
||||
@Inject()
|
||||
private journalSheetTable: JournalSheetTableInjectable;
|
||||
|
||||
@Inject()
|
||||
private journalSheet: JournalSheetService;
|
||||
|
||||
@Inject()
|
||||
private journalExport: JournalSheetExportInjectable;
|
||||
|
||||
/**
|
||||
* Retrieves the journal sheet.
|
||||
* @param {number} tenantId
|
||||
* @param {IJournalReportQuery} query
|
||||
* @returns {}
|
||||
*/
|
||||
public sheet(tenantId: number, query: IJournalReportQuery) {
|
||||
return this.journalSheet.journalSheet(tenantId, query);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the journal sheet in table format.
|
||||
* @param {number} tenantId
|
||||
* @param {IJournalReportQuery} query
|
||||
* @returns {Promise<IJournalTable>}
|
||||
*/
|
||||
public table(
|
||||
tenantId: number,
|
||||
query: IJournalReportQuery
|
||||
): Promise<IJournalTable> {
|
||||
return this.journalSheetTable.table(tenantId, query);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the journal sheet in xlsx format.
|
||||
* @param {number} tenantId
|
||||
* @param {IJournalReportQuery} query
|
||||
* @returns
|
||||
*/
|
||||
public xlsx(tenantId: number, query: IJournalReportQuery) {
|
||||
return this.journalExport.xlsx(tenantId, query);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves the journal sheet in csv format.
|
||||
* @param {number} tenantId
|
||||
* @param {IJournalReportQuery} query
|
||||
* @returns
|
||||
*/
|
||||
public csv(tenantId: number, query: IJournalReportQuery) {
|
||||
return this.journalExport.csv(tenantId, query);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user