feat(server): wip priting financial reports

This commit is contained in:
Ahmed Bouhuolia
2024-02-11 01:14:31 +02:00
parent 9395ef094a
commit b11c531cf5
23 changed files with 438 additions and 2 deletions

View File

@@ -7,6 +7,7 @@ import {
} from '@/interfaces/PurchasesByItemsSheet';
import { PurchasesByItemsTableInjectable } from './PurchasesByItemsTableInjectable';
import { PurchasesByItemsService } from './PurchasesByItemsService';
import { PurchasesByItemsPdf } from './PurchasesByItemsPdf';
@Service()
export class PurcahsesByItemsApplication {
@@ -19,6 +20,9 @@ export class PurcahsesByItemsApplication {
@Inject()
private purchasesByItemsExport: PurchasesByItemsExport;
@Inject()
private purchasesByItemsPdf: PurchasesByItemsPdf;
/**
* Retrieves the purchases by items in json format.
* @param {number} tenantId
@@ -70,4 +74,17 @@ export class PurcahsesByItemsApplication {
): Promise<Buffer> {
return this.purchasesByItemsExport.xlsx(tenantId, query);
}
/**
* Retrieves the purchases by items in pdf format.
* @param {number} tenantId
* @param {IPurchasesByItemsReportQuery} filter
* @returns {Promise<Buffer>}
*/
public pdf(
tenantId: number,
filter: IPurchasesByItemsReportQuery
): Promise<Buffer> {
return this.purchasesByItemsPdf.pdf(tenantId, filter);
}
}