mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
* feat: inventory valuation csv and xlsx export * feat(server): inventory valuation sheet exporting * feat(webapp): inventory valuation sheet dyanmic columns * feat: inventory valuation dynamic columns * feat: inventory valuation TS types
40 lines
1.1 KiB
TypeScript
40 lines
1.1 KiB
TypeScript
import { Inject, Service } from 'typedi';
|
|
import { InventoryValuationSheetService } from './InventoryValuationSheetService';
|
|
import {
|
|
IInventoryValuationReportQuery,
|
|
IInventoryValuationTable,
|
|
} from '@/interfaces';
|
|
import { InventoryValuationSheetTable } from './InventoryValuationSheetTable';
|
|
|
|
@Service()
|
|
export class InventoryValuationSheetTableInjectable {
|
|
@Inject()
|
|
private sheet: InventoryValuationSheetService;
|
|
|
|
/**
|
|
* Retrieves the inventory valuation json table format.
|
|
* @param {number} tenantId -
|
|
* @param {IInventoryValuationReportQuery} filter -
|
|
* @returns {Promise<IInventoryValuationTable>}
|
|
*/
|
|
public async table(
|
|
tenantId: number,
|
|
filter: IInventoryValuationReportQuery
|
|
): Promise<IInventoryValuationTable> {
|
|
const { data, query, meta } = await this.sheet.inventoryValuationSheet(
|
|
tenantId,
|
|
filter
|
|
);
|
|
const table = new InventoryValuationSheetTable(data);
|
|
|
|
return {
|
|
table: {
|
|
columns: table.tableColumns(),
|
|
rows: table.tableRows(),
|
|
},
|
|
query,
|
|
meta,
|
|
};
|
|
}
|
|
}
|