mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 15:20:34 +00:00
feat(server): styling financial reports pdf
This commit is contained in:
@@ -1,41 +1,57 @@
|
|||||||
|
@import "../base.scss";
|
||||||
|
|
||||||
.sheet{}
|
html,
|
||||||
|
body {
|
||||||
|
font-size: 14px;
|
||||||
|
}
|
||||||
|
body{
|
||||||
|
font-weight: 400;
|
||||||
|
letter-spacing: 0;
|
||||||
|
line-height: 1.28581;
|
||||||
|
text-transform: none;
|
||||||
|
color: #000;
|
||||||
|
font-family: Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Open Sans, Helvetica Neue, Icons16, sans-serif;
|
||||||
|
}
|
||||||
|
.sheet{
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
.sheet__company-name{
|
.sheet__company-name{
|
||||||
margin: 0;
|
margin: 0;
|
||||||
font-size: 1.6rem;
|
font-size: 1.4rem;
|
||||||
}
|
}
|
||||||
.sheet__sheet-type {
|
.sheet__sheet-type {
|
||||||
margin: 0
|
margin: 0
|
||||||
}
|
}
|
||||||
.sheet__sheet-date {
|
.sheet__sheet-date {
|
||||||
margin-top: 0.5rem;
|
margin-top: 0.35rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sheet__header {
|
.sheet__header {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-bottom: 2rem;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sheet__table {
|
.sheet__table {
|
||||||
border-top: 1px solid #000;
|
border-top: 1px solid #000;
|
||||||
table-layout: fixed;
|
table-layout: fixed;
|
||||||
border-spacing: 0;
|
border-spacing: 0;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
font-size: inherit;
|
||||||
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sheet__table thead th {
|
.sheet__table thead th {
|
||||||
color: #000;
|
color: #000;
|
||||||
border-bottom: 1px solid #000000;
|
border-bottom: 1px solid #000000;
|
||||||
padding: 0.5rem;
|
padding: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sheet__table tbody td {
|
.sheet__table tbody td {
|
||||||
border-bottom: 0;
|
border-bottom: 0;
|
||||||
padding-top: 0.32rem;
|
padding-top: 0.28rem;
|
||||||
padding-bottom: 0.32rem;
|
padding-bottom: 0.28rem;
|
||||||
padding-left: 0.5rem;
|
padding-left: 0.5rem;
|
||||||
padding-right: 0.5rem;
|
padding-right: 0.5rem;
|
||||||
color: #252A31;
|
color: #252A31;
|
||||||
border-bottom: 1px solid rgb(37, 42, 49);
|
border-bottom: 1px solid transparent;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,6 +1,9 @@
|
|||||||
block head
|
block head
|
||||||
style
|
style
|
||||||
//- include ../../css/modules/financial-sheet.css
|
include ../../css/modules/financial-sheet.css
|
||||||
|
|
||||||
|
style.
|
||||||
|
#{customCSS}
|
||||||
|
|
||||||
block content
|
block content
|
||||||
.sheet
|
.sheet
|
||||||
@@ -13,9 +16,9 @@ block content
|
|||||||
thead
|
thead
|
||||||
tr
|
tr
|
||||||
each column in table.columns
|
each column in table.columns
|
||||||
th= column.label
|
th(style=column.style)= column.label
|
||||||
tbody
|
tbody
|
||||||
each row in table.rows
|
each row in table.rows
|
||||||
tr
|
tr(class=row.classNames)
|
||||||
each cell in row.cells
|
each cell in row.cells
|
||||||
td!= cell.value
|
td!= cell.value
|
||||||
@@ -66,12 +66,10 @@ module.exports = {
|
|||||||
// sourcemaps: true, // Allow to enable/disable sourcemaps or pass object to configure it.
|
// sourcemaps: true, // Allow to enable/disable sourcemaps or pass object to configure it.
|
||||||
// minify: true, // Allow to enable/disable minify the source.
|
// minify: true, // Allow to enable/disable minify the source.
|
||||||
},
|
},
|
||||||
// {
|
{
|
||||||
// src: './assets/sass/editor-style.scss',
|
src: `${RESOURCES_PATH}/scss/modules/financial-sheet.scss`,
|
||||||
// dest: './assets/css',
|
dest: `${RESOURCES_PATH}/css/modules`,
|
||||||
// sourcemaps: true,
|
},
|
||||||
// minify: true,
|
|
||||||
// },
|
|
||||||
],
|
],
|
||||||
// RTL builds.
|
// RTL builds.
|
||||||
rtl: [
|
rtl: [
|
||||||
@@ -114,7 +112,7 @@ module.exports = {
|
|||||||
// SASS Configuration for all builds.
|
// SASS Configuration for all builds.
|
||||||
sass: {
|
sass: {
|
||||||
errLogToConsole: true,
|
errLogToConsole: true,
|
||||||
// outputStyle: 'compact',
|
// outputStyle: 'compact',
|
||||||
},
|
},
|
||||||
|
|
||||||
// CSS MQ Packer configuration for all builds and style tasks.
|
// CSS MQ Packer configuration for all builds and style tasks.
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { Inject, Service } from 'typedi';
|
|||||||
import { IAPAgingSummaryQuery } from '@/interfaces';
|
import { IAPAgingSummaryQuery } from '@/interfaces';
|
||||||
import { TableSheetPdf } from '../TableSheetPdf';
|
import { TableSheetPdf } from '../TableSheetPdf';
|
||||||
import { APAgingSummaryTableInjectable } from './APAgingSummaryTableInjectable';
|
import { APAgingSummaryTableInjectable } from './APAgingSummaryTableInjectable';
|
||||||
|
import { HtmlTableCss } from './_constants';
|
||||||
|
|
||||||
@Service()
|
@Service()
|
||||||
export class APAgingSummaryPdfInjectable {
|
export class APAgingSummaryPdfInjectable {
|
||||||
@@ -27,7 +28,8 @@ export class APAgingSummaryPdfInjectable {
|
|||||||
tenantId,
|
tenantId,
|
||||||
table.table,
|
table.table,
|
||||||
table.meta.sheetName,
|
table.meta.sheetName,
|
||||||
table.meta.formattedAsDate
|
table.meta.formattedAsDate,
|
||||||
|
HtmlTableCss
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { Inject, Service } from 'typedi';
|
|||||||
import { IARAgingSummaryQuery } from '@/interfaces';
|
import { IARAgingSummaryQuery } from '@/interfaces';
|
||||||
import { TableSheetPdf } from '../TableSheetPdf';
|
import { TableSheetPdf } from '../TableSheetPdf';
|
||||||
import { ARAgingSummaryTableInjectable } from './ARAgingSummaryTableInjectable';
|
import { ARAgingSummaryTableInjectable } from './ARAgingSummaryTableInjectable';
|
||||||
|
import { HtmlTableCss } from './_constants';
|
||||||
|
|
||||||
@Service()
|
@Service()
|
||||||
export class ARAgingSummaryPdfInjectable {
|
export class ARAgingSummaryPdfInjectable {
|
||||||
@@ -27,7 +28,8 @@ export class ARAgingSummaryPdfInjectable {
|
|||||||
tenantId,
|
tenantId,
|
||||||
table.table,
|
table.table,
|
||||||
table.meta.sheetName,
|
table.meta.sheetName,
|
||||||
table.meta.formattedDateRange
|
table.meta.formattedDateRange,
|
||||||
|
HtmlTableCss
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,3 +2,11 @@ export enum AgingSummaryRowType {
|
|||||||
Contact = 'contact',
|
Contact = 'contact',
|
||||||
Total = 'total',
|
Total = 'total',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const HtmlTableCss = `
|
||||||
|
table tr.row-type--total td{
|
||||||
|
font-weight: 500;
|
||||||
|
border-top: 1px solid #bbb;
|
||||||
|
border-bottom: 3px double #333;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { Inject, Service } from 'typedi';
|
|||||||
import { IBalanceSheetQuery } from '@/interfaces';
|
import { IBalanceSheetQuery } from '@/interfaces';
|
||||||
import { BalanceSheetTableInjectable } from './BalanceSheetTableInjectable';
|
import { BalanceSheetTableInjectable } from './BalanceSheetTableInjectable';
|
||||||
import { TableSheetPdf } from '../TableSheetPdf';
|
import { TableSheetPdf } from '../TableSheetPdf';
|
||||||
|
import { HtmlTableCustomCss } from './constants';
|
||||||
|
|
||||||
@Service()
|
@Service()
|
||||||
export class BalanceSheetPdfInjectable {
|
export class BalanceSheetPdfInjectable {
|
||||||
@@ -27,7 +28,8 @@ export class BalanceSheetPdfInjectable {
|
|||||||
tenantId,
|
tenantId,
|
||||||
table.table,
|
table.table,
|
||||||
table.meta.sheetName,
|
table.meta.sheetName,
|
||||||
table.meta.formattedDateRange
|
table.meta.formattedDateRange,
|
||||||
|
HtmlTableCustomCss
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,3 +12,15 @@ export enum IROW_TYPE {
|
|||||||
NET_INCOME = 'NET_INCOME',
|
NET_INCOME = 'NET_INCOME',
|
||||||
TOTAL = 'TOTAL',
|
TOTAL = 'TOTAL',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const HtmlTableCustomCss = `
|
||||||
|
table tr.row-type--total td {
|
||||||
|
font-weight: 600;
|
||||||
|
border-top: 1px solid #bbb;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
table tr.row-type--total.row-id--assets td,
|
||||||
|
table tr.row-type--total.row-id--liability-equity td {
|
||||||
|
border-bottom: 3px double #000;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { Inject } from 'typedi';
|
|||||||
import { CashflowTableInjectable } from './CashflowTableInjectable';
|
import { CashflowTableInjectable } from './CashflowTableInjectable';
|
||||||
import { TableSheetPdf } from '../TableSheetPdf';
|
import { TableSheetPdf } from '../TableSheetPdf';
|
||||||
import { ICashFlowStatementQuery } from '@/interfaces';
|
import { ICashFlowStatementQuery } from '@/interfaces';
|
||||||
|
import { HtmlTableCustomCss } from './constants';
|
||||||
|
|
||||||
export class CashflowTablePdfInjectable {
|
export class CashflowTablePdfInjectable {
|
||||||
@Inject()
|
@Inject()
|
||||||
@@ -21,13 +22,13 @@ export class CashflowTablePdfInjectable {
|
|||||||
query: ICashFlowStatementQuery
|
query: ICashFlowStatementQuery
|
||||||
): Promise<Buffer> {
|
): Promise<Buffer> {
|
||||||
const table = await this.cashflowTable.table(tenantId, query);
|
const table = await this.cashflowTable.table(tenantId, query);
|
||||||
const sheetName = 'Cashflow Sheet';
|
|
||||||
|
|
||||||
return this.tableSheetPdf.convertToPdf(
|
return this.tableSheetPdf.convertToPdf(
|
||||||
tenantId,
|
tenantId,
|
||||||
table.table,
|
table.table,
|
||||||
sheetName,
|
table.meta.sheetName,
|
||||||
table.meta.formattedDateRange
|
table.meta.formattedDateRange,
|
||||||
|
HtmlTableCustomCss
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,22 @@
|
|||||||
|
|
||||||
|
|
||||||
export const DISPLAY_COLUMNS_BY = {
|
export const DISPLAY_COLUMNS_BY = {
|
||||||
DATE_PERIODS: 'date_periods',
|
DATE_PERIODS: 'date_periods',
|
||||||
TOTAL: 'total',
|
TOTAL: 'total',
|
||||||
};
|
};
|
||||||
|
|
||||||
export const MAP_CONFIG = { childrenPath: 'children', pathFormat: 'array' };
|
export const MAP_CONFIG = { childrenPath: 'children', pathFormat: 'array' };
|
||||||
|
export const HtmlTableCustomCss = `
|
||||||
|
table tr.row-type--accounts td {
|
||||||
|
border-top: 1px solid #bbb;
|
||||||
|
}
|
||||||
|
table tr.row-id--cash-end-period {
|
||||||
|
border-bottom: 3px double #333;
|
||||||
|
}
|
||||||
|
table tr.row-type--total {
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
table tr.row-type--total td {
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
table tr.row-type--total:not(:first-child) td {
|
||||||
|
border-top: 1px solid #bbb;
|
||||||
|
}`;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { ICustomerBalanceSummaryQuery } from '@/interfaces';
|
|||||||
|
|
||||||
import { TableSheetPdf } from '../TableSheetPdf';
|
import { TableSheetPdf } from '../TableSheetPdf';
|
||||||
import { CustomerBalanceSummaryTableInjectable } from './CustomerBalanceSummaryTableInjectable';
|
import { CustomerBalanceSummaryTableInjectable } from './CustomerBalanceSummaryTableInjectable';
|
||||||
|
import { HtmlTableCustomCss } from './constants';
|
||||||
|
|
||||||
@Service()
|
@Service()
|
||||||
export class CustomerBalanceSummaryPdf {
|
export class CustomerBalanceSummaryPdf {
|
||||||
@@ -28,7 +29,8 @@ export class CustomerBalanceSummaryPdf {
|
|||||||
tenantId,
|
tenantId,
|
||||||
table.table,
|
table.table,
|
||||||
table.meta.sheetName,
|
table.meta.sheetName,
|
||||||
table.meta.formattedDateRange
|
table.meta.formattedDateRange,
|
||||||
|
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;
|
||||||
|
}`;
|
||||||
@@ -2,6 +2,7 @@ import { Inject, Service } from 'typedi';
|
|||||||
import { TableSheetPdf } from '../TableSheetPdf';
|
import { TableSheetPdf } from '../TableSheetPdf';
|
||||||
import { GeneralLedgerTableInjectable } from './GeneralLedgerTableInjectable';
|
import { GeneralLedgerTableInjectable } from './GeneralLedgerTableInjectable';
|
||||||
import { IGeneralLedgerSheetQuery } from '@/interfaces';
|
import { IGeneralLedgerSheetQuery } from '@/interfaces';
|
||||||
|
import { HtmlTableCustomCss } from './constants';
|
||||||
|
|
||||||
@Service()
|
@Service()
|
||||||
export class GeneralLedgerPdf {
|
export class GeneralLedgerPdf {
|
||||||
@@ -27,7 +28,8 @@ export class GeneralLedgerPdf {
|
|||||||
tenantId,
|
tenantId,
|
||||||
table.table,
|
table.table,
|
||||||
table.meta.sheetName,
|
table.meta.sheetName,
|
||||||
table.meta.formattedDateRange
|
table.meta.formattedDateRange,
|
||||||
|
HtmlTableCustomCss
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
export const HtmlTableCustomCss = `
|
||||||
|
table tr:last-child td {
|
||||||
|
border-bottom: 1px solid #ececec;
|
||||||
|
}
|
||||||
|
table tr.row-type--account td,
|
||||||
|
table tr.row-type--opening-balance td,
|
||||||
|
table tr.row-type--closing-balance td{
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
table tr.row-type--closing-balance td {
|
||||||
|
border-bottom: 1px solid #ececec;
|
||||||
|
}
|
||||||
|
`;
|
||||||
@@ -2,6 +2,7 @@ import { Inject, Service } from 'typedi';
|
|||||||
import { InventoryDetailsTableInjectable } from './InventoryDetailsTableInjectable';
|
import { InventoryDetailsTableInjectable } from './InventoryDetailsTableInjectable';
|
||||||
import { TableSheetPdf } from '../TableSheetPdf';
|
import { TableSheetPdf } from '../TableSheetPdf';
|
||||||
import { IInventoryDetailsQuery } from '@/interfaces';
|
import { IInventoryDetailsQuery } from '@/interfaces';
|
||||||
|
import { HtmlTableCustomCss } from './constant';
|
||||||
|
|
||||||
@Service()
|
@Service()
|
||||||
export class InventoryDetailsTablePdf {
|
export class InventoryDetailsTablePdf {
|
||||||
@@ -27,7 +28,8 @@ export class InventoryDetailsTablePdf {
|
|||||||
tenantId,
|
tenantId,
|
||||||
table.table,
|
table.table,
|
||||||
table.meta.sheetName,
|
table.meta.sheetName,
|
||||||
table.meta.formattedDateRange
|
table.meta.formattedDateRange,
|
||||||
|
HtmlTableCustomCss
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
export const HtmlTableCustomCss = `
|
||||||
|
table tr.row-type--item td,
|
||||||
|
table tr.row-type--opening-entry td,
|
||||||
|
table tr.row-type--closing-entry td{
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
`;
|
||||||
@@ -2,6 +2,7 @@ import { Inject, Service } from "typedi";
|
|||||||
import { InventoryValuationSheetTableInjectable } from "./InventoryValuationSheetTableInjectable";
|
import { InventoryValuationSheetTableInjectable } from "./InventoryValuationSheetTableInjectable";
|
||||||
import { TableSheetPdf } from "../TableSheetPdf";
|
import { TableSheetPdf } from "../TableSheetPdf";
|
||||||
import { IInventoryValuationReportQuery } from "@/interfaces";
|
import { IInventoryValuationReportQuery } from "@/interfaces";
|
||||||
|
import { HtmlTableCustomCss } from "./_constants";
|
||||||
|
|
||||||
|
|
||||||
@Service()
|
@Service()
|
||||||
@@ -28,7 +29,8 @@ export class InventoryValuationSheetPdf {
|
|||||||
tenantId,
|
tenantId,
|
||||||
table.table,
|
table.table,
|
||||||
table.meta.sheetName,
|
table.meta.sheetName,
|
||||||
table.meta.formattedDateRange
|
table.meta.formattedDateRange,
|
||||||
|
HtmlTableCustomCss
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,3 +2,11 @@ export enum ROW_TYPE {
|
|||||||
ITEM = 'ITEM',
|
ITEM = 'ITEM',
|
||||||
TOTAL = 'TOTAL',
|
TOTAL = 'TOTAL',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const HtmlTableCustomCss = `
|
||||||
|
table tr.row-type--total td {
|
||||||
|
border-top: 1px solid #bbb;
|
||||||
|
font-weight: 600;
|
||||||
|
border-bottom: 3px double #000;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { IJournalReportQuery } from '@/interfaces';
|
|||||||
import { TableSheetPdf } from '../TableSheetPdf';
|
import { TableSheetPdf } from '../TableSheetPdf';
|
||||||
import { JournalSheetTableInjectable } from './JournalSheetTableInjectable';
|
import { JournalSheetTableInjectable } from './JournalSheetTableInjectable';
|
||||||
import { Inject, Service } from 'typedi';
|
import { Inject, Service } from 'typedi';
|
||||||
|
import { HtmlTableCustomCss } from './constant';
|
||||||
|
|
||||||
@Service()
|
@Service()
|
||||||
export class JournalSheetPdfInjectable {
|
export class JournalSheetPdfInjectable {
|
||||||
@@ -27,7 +28,8 @@ export class JournalSheetPdfInjectable {
|
|||||||
tenantId,
|
tenantId,
|
||||||
table.table,
|
table.table,
|
||||||
table.meta.sheetName,
|
table.meta.sheetName,
|
||||||
table.meta.formattedDateRange
|
table.meta.formattedDateRange,
|
||||||
|
HtmlTableCustomCss
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
export const HtmlTableCustomCss = `
|
||||||
|
table tr.row-type--total td{
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
table tr td:not(:first-child) {
|
||||||
|
border-left: 1px solid #ececec;
|
||||||
|
}
|
||||||
|
table tr:last-child td {
|
||||||
|
border-bottom: 1px solid #ececec;
|
||||||
|
}`;
|
||||||
@@ -2,6 +2,7 @@ import { Inject, Service } from 'typedi';
|
|||||||
import { IProfitLossSheetQuery } from '@/interfaces';
|
import { IProfitLossSheetQuery } from '@/interfaces';
|
||||||
import { ProfitLossSheetTableInjectable } from './ProfitLossSheetTableInjectable';
|
import { ProfitLossSheetTableInjectable } from './ProfitLossSheetTableInjectable';
|
||||||
import { TableSheetPdf } from '../TableSheetPdf';
|
import { TableSheetPdf } from '../TableSheetPdf';
|
||||||
|
import { HtmlTableCustomCss } from './constants';
|
||||||
|
|
||||||
@Service()
|
@Service()
|
||||||
export class ProfitLossTablePdfInjectable {
|
export class ProfitLossTablePdfInjectable {
|
||||||
@@ -27,7 +28,8 @@ export class ProfitLossTablePdfInjectable {
|
|||||||
tenantId,
|
tenantId,
|
||||||
table.table,
|
table.table,
|
||||||
table.meta.sheetName,
|
table.meta.sheetName,
|
||||||
table.meta.formattedDateRange
|
table.meta.formattedDateRange,
|
||||||
|
HtmlTableCustomCss
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,3 +19,11 @@ export const TOTAL_NODE_TYPES = [
|
|||||||
ProfitLossNodeType.AGGREGATE,
|
ProfitLossNodeType.AGGREGATE,
|
||||||
ProfitLossNodeType.EQUATION
|
ProfitLossNodeType.EQUATION
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const HtmlTableCustomCss =`
|
||||||
|
table tr.row-type--total td {
|
||||||
|
font-weight: 600;
|
||||||
|
border-top: 1px solid #bbb;
|
||||||
|
color: #000;
|
||||||
|
}
|
||||||
|
`;
|
||||||
@@ -2,6 +2,7 @@ import { Inject, Service } from 'typedi';
|
|||||||
import { TableSheetPdf } from '../TableSheetPdf';
|
import { TableSheetPdf } from '../TableSheetPdf';
|
||||||
import { PurchasesByItemsTableInjectable } from './PurchasesByItemsTableInjectable';
|
import { PurchasesByItemsTableInjectable } from './PurchasesByItemsTableInjectable';
|
||||||
import { IPurchasesByItemsReportQuery } from '@/interfaces/PurchasesByItemsSheet';
|
import { IPurchasesByItemsReportQuery } from '@/interfaces/PurchasesByItemsSheet';
|
||||||
|
import { HtmlTableCustomCss } from './_types';
|
||||||
|
|
||||||
@Service()
|
@Service()
|
||||||
export class PurchasesByItemsPdf {
|
export class PurchasesByItemsPdf {
|
||||||
@@ -27,7 +28,8 @@ export class PurchasesByItemsPdf {
|
|||||||
tenantId,
|
tenantId,
|
||||||
table.table,
|
table.table,
|
||||||
table.meta.sheetName,
|
table.meta.sheetName,
|
||||||
table.meta.formattedDateRange
|
table.meta.formattedDateRange,
|
||||||
|
HtmlTableCustomCss
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,3 +3,11 @@ export enum ROW_TYPE {
|
|||||||
TOTAL = 'TOTAL',
|
TOTAL = 'TOTAL',
|
||||||
ITEM = 'ITEM'
|
ITEM = 'ITEM'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const HtmlTableCustomCss = `
|
||||||
|
table tr.row-type--total td {
|
||||||
|
border-top: 1px solid #bbb;
|
||||||
|
border-bottom: 3px double #000;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
`;
|
||||||
@@ -2,6 +2,7 @@ import { Inject, Service } from 'typedi';
|
|||||||
import { ISalesByItemsReportQuery } from '@/interfaces';
|
import { ISalesByItemsReportQuery } from '@/interfaces';
|
||||||
import { SalesByItemsTableInjectable } from './SalesByItemsTableInjectable';
|
import { SalesByItemsTableInjectable } from './SalesByItemsTableInjectable';
|
||||||
import { TableSheetPdf } from '../TableSheetPdf';
|
import { TableSheetPdf } from '../TableSheetPdf';
|
||||||
|
import { HtmlTableCustomCss } from './constants';
|
||||||
|
|
||||||
@Service()
|
@Service()
|
||||||
export class SalesByItemsPdfInjectable {
|
export class SalesByItemsPdfInjectable {
|
||||||
@@ -27,7 +28,8 @@ export class SalesByItemsPdfInjectable {
|
|||||||
tenantId,
|
tenantId,
|
||||||
table.table,
|
table.table,
|
||||||
table.meta.sheetName,
|
table.meta.sheetName,
|
||||||
table.meta.formattedDateRange
|
table.meta.formattedDateRange,
|
||||||
|
HtmlTableCustomCss
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,12 @@
|
|||||||
|
|
||||||
|
|
||||||
export enum ROW_TYPE {
|
export enum ROW_TYPE {
|
||||||
ITEM = 'ITEM',
|
ITEM = 'ITEM',
|
||||||
TOTAL = 'TOTAL',
|
TOTAL = 'TOTAL',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const HtmlTableCustomCss = `
|
||||||
|
table tr.row-type--total td {
|
||||||
|
border-top: 1px solid #bbb;
|
||||||
|
border-bottom: 3px double #000;
|
||||||
|
font-weight: 600;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { Inject, Service } from 'typedi';
|
|||||||
import { ITrialBalanceSheetQuery } from '@/interfaces';
|
import { ITrialBalanceSheetQuery } from '@/interfaces';
|
||||||
import { TableSheetPdf } from '../TableSheetPdf';
|
import { TableSheetPdf } from '../TableSheetPdf';
|
||||||
import { TrialBalanceSheetTableInjectable } from './TrialBalanceSheetTableInjectable';
|
import { TrialBalanceSheetTableInjectable } from './TrialBalanceSheetTableInjectable';
|
||||||
|
import { HtmlTableCustomCss } from './_constants';
|
||||||
|
|
||||||
@Service()
|
@Service()
|
||||||
export class TrialBalanceSheetPdfInjectable {
|
export class TrialBalanceSheetPdfInjectable {
|
||||||
@@ -27,7 +28,8 @@ export class TrialBalanceSheetPdfInjectable {
|
|||||||
tenantId,
|
tenantId,
|
||||||
table.table,
|
table.table,
|
||||||
table.meta.sheetName,
|
table.meta.sheetName,
|
||||||
table.meta.formattedDateRange
|
table.meta.formattedDateRange,
|
||||||
|
HtmlTableCustomCss
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import * as R from 'ramda';
|
|||||||
import FinancialSheet from '../FinancialSheet';
|
import FinancialSheet from '../FinancialSheet';
|
||||||
import { FinancialTable } from '../FinancialTable';
|
import { FinancialTable } from '../FinancialTable';
|
||||||
import {
|
import {
|
||||||
IBalanceSheetStatementData,
|
|
||||||
ITableColumn,
|
ITableColumn,
|
||||||
ITableColumnAccessor,
|
ITableColumnAccessor,
|
||||||
ITableRow,
|
ITableRow,
|
||||||
|
|||||||
@@ -1,5 +1,12 @@
|
|||||||
|
|
||||||
export enum IROW_TYPE {
|
export enum IROW_TYPE {
|
||||||
ACCOUNT = 'ACCOUNT',
|
ACCOUNT = 'ACCOUNT',
|
||||||
TOTAL = 'TOTAL',
|
TOTAL = 'TOTAL',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export const HtmlTableCustomCss = `
|
||||||
|
table tr.row-type--total td{
|
||||||
|
border-top: 1px solid #bbb;
|
||||||
|
font-weight: 500;
|
||||||
|
border-bottom: 3px double #000;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export class VendorBalanceSummaryReport extends ContactBalanceSummaryReport {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Customer section mapper.
|
* Customer section mapper.
|
||||||
* @param {IVendor} vendor
|
* @param {IVendor} vendor
|
||||||
* @returns {IVendorBalanceSummaryVendor}
|
* @returns {IVendorBalanceSummaryVendor}
|
||||||
*/
|
*/
|
||||||
private vendorMapper = (vendor: IVendor): 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.
|
* Mappes the vendor model object to vendor balance summary section.
|
||||||
* @param {IVendor[]} vendors - Customers.
|
* @param {IVendor[]} vendors - Customers.
|
||||||
* @returns {IVendorBalanceSummaryVendor[]}
|
* @returns {IVendorBalanceSummaryVendor[]}
|
||||||
*/
|
*/
|
||||||
private vendorsMapper = (
|
private vendorsMapper = (
|
||||||
@@ -77,7 +77,7 @@ export class VendorBalanceSummaryReport extends ContactBalanceSummaryReport {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the vendors sections of the report.
|
* Retrieve the vendors sections of the report.
|
||||||
* @param {IVendor} vendors
|
* @param {IVendor} vendors
|
||||||
* @returns {IVendorBalanceSummaryVendor[]}
|
* @returns {IVendorBalanceSummaryVendor[]}
|
||||||
*/
|
*/
|
||||||
private getVendorsSection(vendors: IVendor[]): IVendorBalanceSummaryVendor[] {
|
private getVendorsSection(vendors: IVendor[]): IVendorBalanceSummaryVendor[] {
|
||||||
|
|||||||
@@ -72,6 +72,5 @@ export class VendorBalanceSummaryApplication {
|
|||||||
*/
|
*/
|
||||||
public pdf(tenantId: number, query: IVendorBalanceSummaryQuery) {
|
public pdf(tenantId: number, query: IVendorBalanceSummaryQuery) {
|
||||||
return this.vendorBalanceSummaryPdf.pdf(tenantId, query);
|
return this.vendorBalanceSummaryPdf.pdf(tenantId, query);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { Inject, Service } from 'typedi';
|
|||||||
import { IVendorBalanceSummaryQuery } from '@/interfaces';
|
import { IVendorBalanceSummaryQuery } from '@/interfaces';
|
||||||
import { TableSheetPdf } from '../TableSheetPdf';
|
import { TableSheetPdf } from '../TableSheetPdf';
|
||||||
import { VendorBalanceSummaryTableInjectable } from './VendorBalanceSummaryTableInjectable';
|
import { VendorBalanceSummaryTableInjectable } from './VendorBalanceSummaryTableInjectable';
|
||||||
|
import { HtmlTableCustomCss } from './constants';
|
||||||
|
|
||||||
@Service()
|
@Service()
|
||||||
export class VendorBalanceSummaryPdf {
|
export class VendorBalanceSummaryPdf {
|
||||||
@@ -23,12 +24,12 @@ export class VendorBalanceSummaryPdf {
|
|||||||
): Promise<Buffer> {
|
): Promise<Buffer> {
|
||||||
const table = await this.vendorBalanceSummaryTable.table(tenantId, query);
|
const table = await this.vendorBalanceSummaryTable.table(tenantId, query);
|
||||||
|
|
||||||
|
|
||||||
return this.tableSheetPdf.convertToPdf(
|
return this.tableSheetPdf.convertToPdf(
|
||||||
tenantId,
|
tenantId,
|
||||||
table.table,
|
table.table,
|
||||||
table.meta.sheetName,
|
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