mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 23:00:34 +00:00
feat(server): styling financial reports pdf
This commit is contained in:
@@ -41,7 +41,7 @@ export class VendorBalanceSummaryReport extends ContactBalanceSummaryReport {
|
||||
|
||||
/**
|
||||
* Customer section mapper.
|
||||
* @param {IVendor} vendor
|
||||
* @param {IVendor} vendor
|
||||
* @returns {IVendorBalanceSummaryVendor}
|
||||
*/
|
||||
private vendorMapper = (vendor: IVendor): IVendorBalanceSummaryVendor => {
|
||||
@@ -58,7 +58,7 @@ export class VendorBalanceSummaryReport extends ContactBalanceSummaryReport {
|
||||
|
||||
/**
|
||||
* Mappes the vendor model object to vendor balance summary section.
|
||||
* @param {IVendor[]} vendors - Customers.
|
||||
* @param {IVendor[]} vendors - Customers.
|
||||
* @returns {IVendorBalanceSummaryVendor[]}
|
||||
*/
|
||||
private vendorsMapper = (
|
||||
@@ -77,7 +77,7 @@ export class VendorBalanceSummaryReport extends ContactBalanceSummaryReport {
|
||||
|
||||
/**
|
||||
* Retrieve the vendors sections of the report.
|
||||
* @param {IVendor} vendors
|
||||
* @param {IVendor} vendors
|
||||
* @returns {IVendorBalanceSummaryVendor[]}
|
||||
*/
|
||||
private getVendorsSection(vendors: IVendor[]): IVendorBalanceSummaryVendor[] {
|
||||
|
||||
@@ -72,6 +72,5 @@ export class VendorBalanceSummaryApplication {
|
||||
*/
|
||||
public pdf(tenantId: number, query: IVendorBalanceSummaryQuery) {
|
||||
return this.vendorBalanceSummaryPdf.pdf(tenantId, query);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import { Inject, Service } from 'typedi';
|
||||
import { IVendorBalanceSummaryQuery } from '@/interfaces';
|
||||
import { TableSheetPdf } from '../TableSheetPdf';
|
||||
import { VendorBalanceSummaryTableInjectable } from './VendorBalanceSummaryTableInjectable';
|
||||
import { HtmlTableCustomCss } from './constants';
|
||||
|
||||
@Service()
|
||||
export class VendorBalanceSummaryPdf {
|
||||
@@ -22,13 +23,13 @@ export class VendorBalanceSummaryPdf {
|
||||
query: IVendorBalanceSummaryQuery
|
||||
): Promise<Buffer> {
|
||||
const table = await this.vendorBalanceSummaryTable.table(tenantId, query);
|
||||
|
||||
|
||||
return this.tableSheetPdf.convertToPdf(
|
||||
tenantId,
|
||||
table.table,
|
||||
table.meta.sheetName,
|
||||
table.meta.formattedAsDate
|
||||
table.meta.formattedAsDate,
|
||||
HtmlTableCustomCss
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
export const HtmlTableCustomCss = `
|
||||
table tr.row-type--total td {
|
||||
font-weight: 600;
|
||||
border-top: 1px solid #bbb;
|
||||
border-bottom: 3px double #333;
|
||||
}`;
|
||||
Reference in New Issue
Block a user