shareneus 1.5.89 → 1.5.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/accounting/invoice/invoice-pdf/invoice-pdf.service.d.ts +15 -15
- package/dist/accounting/invoice/invoice-pdf/invoice-pdf.service.js +9 -6
- package/dist/purchases/bills/bill-pdf/bill-pdf.service.d.ts +15 -15
- package/dist/purchases/bills/bill-pdf/bill-pdf.service.js +9 -6
- package/dist/shared/header-footer-section/pdf-header-footer.section.js +4 -3
- package/dist/shared/table-section/pdf-table.config.d.ts +2 -0
- package/dist/shared/table-section/pdf-table.config.js +3 -1
- package/dist/shared/table-section/pdf-table.header.js +2 -1
- package/dist/shared/table-section/pdf-table.row.d.ts +2 -0
- package/dist/shared/table-section/pdf-table.row.js +5 -4
- package/dist/shared/table-section/pdf-table.section.js +13 -10
- package/package.json +1 -1
|
@@ -26,17 +26,17 @@ export declare function CreateInvoicePDFService(PDFInvoiceData?: any, PrintConfi
|
|
|
26
26
|
alignment: string;
|
|
27
27
|
margin: number[];
|
|
28
28
|
}) | undefined;
|
|
29
|
-
pageSize: "A4" | "LETTER" | "LEGAL" | {
|
|
30
|
-
width: number;
|
|
31
|
-
height: number;
|
|
32
|
-
};
|
|
33
|
-
pageOrientation: "portrait" | "landscape";
|
|
34
29
|
pageMargins: [number, number, number, number];
|
|
35
30
|
content: any[];
|
|
36
31
|
info: {
|
|
37
32
|
title: string;
|
|
38
33
|
subject: string;
|
|
39
34
|
};
|
|
35
|
+
pageOrientation?: "portrait" | "landscape" | undefined;
|
|
36
|
+
pageSize: "A4" | "LETTER" | "LEGAL" | {
|
|
37
|
+
width: number;
|
|
38
|
+
height: number;
|
|
39
|
+
};
|
|
40
40
|
};
|
|
41
41
|
export declare function DownloadInvoicePDFService(filename?: string, PDFInvoiceData?: any, PrintConfigData?: any, printCopies?: string[]): {
|
|
42
42
|
footer?: (() => {
|
|
@@ -66,17 +66,17 @@ export declare function DownloadInvoicePDFService(filename?: string, PDFInvoiceD
|
|
|
66
66
|
alignment: string;
|
|
67
67
|
margin: number[];
|
|
68
68
|
}) | undefined;
|
|
69
|
-
pageSize: "A4" | "LETTER" | "LEGAL" | {
|
|
70
|
-
width: number;
|
|
71
|
-
height: number;
|
|
72
|
-
};
|
|
73
|
-
pageOrientation: "portrait" | "landscape";
|
|
74
69
|
pageMargins: [number, number, number, number];
|
|
75
70
|
content: any[];
|
|
76
71
|
info: {
|
|
77
72
|
title: string;
|
|
78
73
|
subject: string;
|
|
79
74
|
};
|
|
75
|
+
pageOrientation?: "portrait" | "landscape" | undefined;
|
|
76
|
+
pageSize: "A4" | "LETTER" | "LEGAL" | {
|
|
77
|
+
width: number;
|
|
78
|
+
height: number;
|
|
79
|
+
};
|
|
80
80
|
};
|
|
81
81
|
export declare function GetInvoicePdfDataUrl(PDFInvoiceData?: any, PrintConfigData?: any, printCopies?: string[]): {
|
|
82
82
|
footer?: (() => {
|
|
@@ -106,15 +106,15 @@ export declare function GetInvoicePdfDataUrl(PDFInvoiceData?: any, PrintConfigDa
|
|
|
106
106
|
alignment: string;
|
|
107
107
|
margin: number[];
|
|
108
108
|
}) | undefined;
|
|
109
|
-
pageSize: "A4" | "LETTER" | "LEGAL" | {
|
|
110
|
-
width: number;
|
|
111
|
-
height: number;
|
|
112
|
-
};
|
|
113
|
-
pageOrientation: "portrait" | "landscape";
|
|
114
109
|
pageMargins: [number, number, number, number];
|
|
115
110
|
content: any[];
|
|
116
111
|
info: {
|
|
117
112
|
title: string;
|
|
118
113
|
subject: string;
|
|
119
114
|
};
|
|
115
|
+
pageOrientation?: "portrait" | "landscape" | undefined;
|
|
116
|
+
pageSize: "A4" | "LETTER" | "LEGAL" | {
|
|
117
|
+
width: number;
|
|
118
|
+
height: number;
|
|
119
|
+
};
|
|
120
120
|
};
|
|
@@ -63,15 +63,18 @@ function GetInvoicePdfDataUrl(PDFInvoiceData = {}, PrintConfigData = {}, printCo
|
|
|
63
63
|
}
|
|
64
64
|
function buildPdfDocDefinition(PDFInvoiceData = {}, PrintConfigData = {}, printCopies = []) {
|
|
65
65
|
const PrintConfig = normalizePrintConfig(PDFInvoiceData, PrintConfigData);
|
|
66
|
-
const
|
|
67
|
-
const pageSize = (0, pdf_header_footer_section_1.resolvePageSize)(PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.PSize,
|
|
68
|
-
const
|
|
69
|
-
const availableWidth = (0, pdf_table_section_1.getAvailablePageWidth)(pageSize, pageOrientation, pageMargins);
|
|
66
|
+
const requestedPageOrientation = (0, pdf_header_footer_section_1.resolvePageOrientation)(PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.PageOrientation);
|
|
67
|
+
const pageSize = (0, pdf_header_footer_section_1.resolvePageSize)(PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.PSize, requestedPageOrientation);
|
|
68
|
+
const basePageMargins = (0, pdf_header_footer_section_1.resolvePageMargins)(PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.pageMargins);
|
|
70
69
|
const copyLabels = normalizeCopyLabels(printCopies);
|
|
71
70
|
const watermark = (0, pdf_header_footer_section_1.buildWatermark)(PrintConfig);
|
|
72
71
|
const background = (0, pdf_header_footer_section_1.buildLogoWatermarkBackground)(PrintConfig, PDFInvoiceData);
|
|
73
72
|
const pageHeader = (0, pdf_header_footer_section_1.buildPageNumberHeader)(PrintConfig);
|
|
74
73
|
const pageFooter = (0, pdf_header_footer_section_1.buildFooter)(PrintConfig);
|
|
74
|
+
const pageMargins = pageHeader !== null
|
|
75
|
+
? [basePageMargins[0], Math.max(basePageMargins[1], 18), basePageMargins[2], basePageMargins[3]]
|
|
76
|
+
: basePageMargins;
|
|
77
|
+
const availableWidth = (0, pdf_table_section_1.getAvailablePageWidth)(pageSize, requestedPageOrientation, pageMargins);
|
|
75
78
|
const content = [];
|
|
76
79
|
copyLabels.forEach((copyLabel, index) => {
|
|
77
80
|
const invoiceHeaderContent = (0, pdf_header_footer_section_1.buildDocumentHeaderSection)(PrintConfig, PDFInvoiceData);
|
|
@@ -109,10 +112,10 @@ function buildPdfDocDefinition(PDFInvoiceData = {}, PrintConfigData = {}, printC
|
|
|
109
112
|
}
|
|
110
113
|
}, ...invoiceTotalsAndNotesContent, ...signatureContent);
|
|
111
114
|
});
|
|
112
|
-
const dd = Object.assign(Object.assign(Object.assign(Object.assign({ pageSize: pageSize, pageOrientation:
|
|
115
|
+
const dd = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ pageSize: pageSize }, (typeof pageSize === 'string' ? { pageOrientation: requestedPageOrientation } : {})), { pageMargins: pageMargins, content: content, info: {
|
|
113
116
|
title: 'invoice',
|
|
114
117
|
subject: Array.isArray(printCopies) ? printCopies.join(', ') : ''
|
|
115
|
-
} }, (background ? { background } : {})), (watermark ? { watermark } : {})), (pageHeader !== null ? { header: pageHeader } : {})), (pageFooter !== null ? { footer: pageFooter } : {}));
|
|
118
|
+
} }), (background ? { background } : {})), (watermark ? { watermark } : {})), (pageHeader !== null ? { header: pageHeader } : {})), (pageFooter !== null ? { footer: pageFooter } : {}));
|
|
116
119
|
return dd;
|
|
117
120
|
}
|
|
118
121
|
function normalizeCopyLabels(printCopies = []) {
|
|
@@ -26,17 +26,17 @@ export declare function CreateBillPDFService(PDFInvoiceData?: any, PrintConfigDa
|
|
|
26
26
|
alignment: string;
|
|
27
27
|
margin: number[];
|
|
28
28
|
}) | undefined;
|
|
29
|
-
pageSize: "A4" | "LETTER" | "LEGAL" | {
|
|
30
|
-
width: number;
|
|
31
|
-
height: number;
|
|
32
|
-
};
|
|
33
|
-
pageOrientation: "portrait" | "landscape";
|
|
34
29
|
pageMargins: [number, number, number, number];
|
|
35
30
|
content: any[];
|
|
36
31
|
info: {
|
|
37
32
|
title: string;
|
|
38
33
|
subject: string;
|
|
39
34
|
};
|
|
35
|
+
pageOrientation?: "portrait" | "landscape" | undefined;
|
|
36
|
+
pageSize: "A4" | "LETTER" | "LEGAL" | {
|
|
37
|
+
width: number;
|
|
38
|
+
height: number;
|
|
39
|
+
};
|
|
40
40
|
};
|
|
41
41
|
export declare function DownloadBillPDFService(filename?: string, PDFInvoiceData?: any, PrintConfigData?: any, printCopies?: string[]): {
|
|
42
42
|
footer?: (() => {
|
|
@@ -66,17 +66,17 @@ export declare function DownloadBillPDFService(filename?: string, PDFInvoiceData
|
|
|
66
66
|
alignment: string;
|
|
67
67
|
margin: number[];
|
|
68
68
|
}) | undefined;
|
|
69
|
-
pageSize: "A4" | "LETTER" | "LEGAL" | {
|
|
70
|
-
width: number;
|
|
71
|
-
height: number;
|
|
72
|
-
};
|
|
73
|
-
pageOrientation: "portrait" | "landscape";
|
|
74
69
|
pageMargins: [number, number, number, number];
|
|
75
70
|
content: any[];
|
|
76
71
|
info: {
|
|
77
72
|
title: string;
|
|
78
73
|
subject: string;
|
|
79
74
|
};
|
|
75
|
+
pageOrientation?: "portrait" | "landscape" | undefined;
|
|
76
|
+
pageSize: "A4" | "LETTER" | "LEGAL" | {
|
|
77
|
+
width: number;
|
|
78
|
+
height: number;
|
|
79
|
+
};
|
|
80
80
|
};
|
|
81
81
|
export declare function GetBillPdfDataUrl(PDFInvoiceData?: any, PrintConfigData?: any, printCopies?: string[]): {
|
|
82
82
|
footer?: (() => {
|
|
@@ -106,15 +106,15 @@ export declare function GetBillPdfDataUrl(PDFInvoiceData?: any, PrintConfigData?
|
|
|
106
106
|
alignment: string;
|
|
107
107
|
margin: number[];
|
|
108
108
|
}) | undefined;
|
|
109
|
-
pageSize: "A4" | "LETTER" | "LEGAL" | {
|
|
110
|
-
width: number;
|
|
111
|
-
height: number;
|
|
112
|
-
};
|
|
113
|
-
pageOrientation: "portrait" | "landscape";
|
|
114
109
|
pageMargins: [number, number, number, number];
|
|
115
110
|
content: any[];
|
|
116
111
|
info: {
|
|
117
112
|
title: string;
|
|
118
113
|
subject: string;
|
|
119
114
|
};
|
|
115
|
+
pageOrientation?: "portrait" | "landscape" | undefined;
|
|
116
|
+
pageSize: "A4" | "LETTER" | "LEGAL" | {
|
|
117
|
+
width: number;
|
|
118
|
+
height: number;
|
|
119
|
+
};
|
|
120
120
|
};
|
|
@@ -63,15 +63,18 @@ function GetBillPdfDataUrl(PDFInvoiceData = {}, PrintConfigData = {}, printCopie
|
|
|
63
63
|
}
|
|
64
64
|
function buildPdfDocDefinition(PDFInvoiceData = {}, PrintConfigData = {}, printCopies = []) {
|
|
65
65
|
const PrintConfig = normalizePrintConfig(PDFInvoiceData, PrintConfigData);
|
|
66
|
-
const
|
|
67
|
-
const pageSize = (0, pdf_header_footer_section_1.resolvePageSize)(PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.PSize,
|
|
68
|
-
const
|
|
69
|
-
const availableWidth = (0, pdf_table_section_1.getAvailablePageWidth)(pageSize, pageOrientation, pageMargins);
|
|
66
|
+
const requestedPageOrientation = (0, pdf_header_footer_section_1.resolvePageOrientation)(PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.PageOrientation);
|
|
67
|
+
const pageSize = (0, pdf_header_footer_section_1.resolvePageSize)(PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.PSize, requestedPageOrientation);
|
|
68
|
+
const basePageMargins = (0, pdf_header_footer_section_1.resolvePageMargins)(PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.pageMargins);
|
|
70
69
|
const copyLabels = normalizeCopyLabels(printCopies);
|
|
71
70
|
const watermark = (0, pdf_header_footer_section_1.buildWatermark)(PrintConfig);
|
|
72
71
|
const background = (0, pdf_header_footer_section_1.buildLogoWatermarkBackground)(PrintConfig, PDFInvoiceData);
|
|
73
72
|
const pageHeader = (0, pdf_header_footer_section_1.buildPageNumberHeader)(PrintConfig);
|
|
74
73
|
const pageFooter = (0, pdf_header_footer_section_1.buildFooter)(PrintConfig);
|
|
74
|
+
const pageMargins = pageHeader !== null
|
|
75
|
+
? [basePageMargins[0], Math.max(basePageMargins[1], 18), basePageMargins[2], basePageMargins[3]]
|
|
76
|
+
: basePageMargins;
|
|
77
|
+
const availableWidth = (0, pdf_table_section_1.getAvailablePageWidth)(pageSize, requestedPageOrientation, pageMargins);
|
|
75
78
|
const content = [];
|
|
76
79
|
copyLabels.forEach((copyLabel, index) => {
|
|
77
80
|
const invoiceHeaderContent = (0, pdf_header_footer_section_1.buildDocumentHeaderSection)(PrintConfig, PDFInvoiceData);
|
|
@@ -109,10 +112,10 @@ function buildPdfDocDefinition(PDFInvoiceData = {}, PrintConfigData = {}, printC
|
|
|
109
112
|
}
|
|
110
113
|
}, ...invoiceTotalsAndNotesContent, ...signatureContent);
|
|
111
114
|
});
|
|
112
|
-
const dd = Object.assign(Object.assign(Object.assign(Object.assign({ pageSize: pageSize, pageOrientation:
|
|
115
|
+
const dd = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({ pageSize: pageSize }, (typeof pageSize === 'string' ? { pageOrientation: requestedPageOrientation } : {})), { pageMargins: pageMargins, content: content, info: {
|
|
113
116
|
title: 'invoice',
|
|
114
117
|
subject: Array.isArray(printCopies) ? printCopies.join(', ') : ''
|
|
115
|
-
} }, (background ? { background } : {})), (watermark ? { watermark } : {})), (pageHeader !== null ? { header: pageHeader } : {})), (pageFooter !== null ? { footer: pageFooter } : {}));
|
|
118
|
+
} }), (background ? { background } : {})), (watermark ? { watermark } : {})), (pageHeader !== null ? { header: pageHeader } : {})), (pageFooter !== null ? { footer: pageFooter } : {}));
|
|
116
119
|
return dd;
|
|
117
120
|
}
|
|
118
121
|
function normalizeCopyLabels(printCopies = []) {
|
|
@@ -29,13 +29,14 @@ function resolvePageOrientation(value) {
|
|
|
29
29
|
}
|
|
30
30
|
function resolvePageSize(value, orientation = DEFAULT_PAGE_ORIENTATION) {
|
|
31
31
|
const raw = String(value !== null && value !== void 0 ? value : '').trim().toLowerCase();
|
|
32
|
-
|
|
32
|
+
const normalized = raw.replace(/[\s_-]/g, '');
|
|
33
|
+
if (normalized === 'halfa4') {
|
|
33
34
|
return { width: A4_WIDTH, height: HALF_A4_HEIGHT };
|
|
34
35
|
}
|
|
35
|
-
if (
|
|
36
|
+
if (normalized === 'letter') {
|
|
36
37
|
return 'LETTER';
|
|
37
38
|
}
|
|
38
|
-
if (
|
|
39
|
+
if (normalized === 'legal') {
|
|
39
40
|
return 'LEGAL';
|
|
40
41
|
}
|
|
41
42
|
return 'A4';
|
|
@@ -169,6 +169,7 @@ function getHeaderCellStyle() {
|
|
|
169
169
|
return {
|
|
170
170
|
bold: true,
|
|
171
171
|
fontSize: pdf_table_config_1.pdfTableStyleConfig.headerFontSize,
|
|
172
|
-
fillColor: pdf_table_config_1.pdfTableStyleConfig.headerBgColor
|
|
172
|
+
fillColor: pdf_table_config_1.pdfTableStyleConfig.headerBgColor,
|
|
173
|
+
color: pdf_table_config_1.pdfTableStyleConfig.headerFontColor
|
|
173
174
|
};
|
|
174
175
|
}
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
export declare function buildDataRow(item: any, index: number, headerConfig: any[], fixedTo?: number): ({
|
|
2
2
|
text: string;
|
|
3
3
|
fontSize: number;
|
|
4
|
+
color: string;
|
|
4
5
|
alignment: string;
|
|
5
6
|
stack?: undefined;
|
|
6
7
|
} | {
|
|
7
8
|
stack: any[];
|
|
8
9
|
text?: undefined;
|
|
9
10
|
fontSize?: undefined;
|
|
11
|
+
color?: undefined;
|
|
10
12
|
alignment?: undefined;
|
|
11
13
|
})[];
|
|
12
14
|
export declare function getFirstFieldValue(item: any, dbFields?: string[]): string;
|
|
@@ -12,12 +12,12 @@ function buildDataRow(item, index, headerConfig, fixedTo = 2) {
|
|
|
12
12
|
if (column.type === 'tax') {
|
|
13
13
|
const taxValue = getTaxValue(item, column.dbField, column.taxKind);
|
|
14
14
|
const renderedTaxValue = formatNumericLikeValue(taxValue, fixedTo);
|
|
15
|
-
return { text: renderedTaxValue, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, alignment: getNumericAlignment(renderedTaxValue) };
|
|
15
|
+
return { text: renderedTaxValue, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor, alignment: getNumericAlignment(renderedTaxValue) };
|
|
16
16
|
}
|
|
17
17
|
const header = column.header;
|
|
18
18
|
if (header.text === 'S.No') {
|
|
19
19
|
const serial = String(index + 1);
|
|
20
|
-
return { text: serial, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, alignment: getNumericAlignment(serial) };
|
|
20
|
+
return { text: serial, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor, alignment: getNumericAlignment(serial) };
|
|
21
21
|
}
|
|
22
22
|
const mainValue = formatFieldValue(item, header, fixedTo);
|
|
23
23
|
const stackedLines = ((_a = header.stackFields) !== null && _a !== void 0 ? _a : [])
|
|
@@ -26,19 +26,20 @@ function buildDataRow(item, index, headerConfig, fixedTo = 2) {
|
|
|
26
26
|
if (!stackValue) {
|
|
27
27
|
return null;
|
|
28
28
|
}
|
|
29
|
-
return { text: `${stackField.text}: ${stackValue}`, fontSize: pdf_table_config_1.pdfTableStyleConfig.stackFieldFontSize, italics: true };
|
|
29
|
+
return { text: `${stackField.text}: ${stackValue}`, fontSize: pdf_table_config_1.pdfTableStyleConfig.stackFieldFontSize, color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor, italics: true };
|
|
30
30
|
})
|
|
31
31
|
.filter((line) => !!line);
|
|
32
32
|
if (stackedLines.length === 0) {
|
|
33
33
|
return {
|
|
34
34
|
text: mainValue,
|
|
35
35
|
fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize,
|
|
36
|
+
color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor,
|
|
36
37
|
alignment: getCellAlignment(header.text, mainValue)
|
|
37
38
|
};
|
|
38
39
|
}
|
|
39
40
|
return {
|
|
40
41
|
stack: [
|
|
41
|
-
{ text: mainValue, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize },
|
|
42
|
+
{ text: mainValue, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor },
|
|
42
43
|
...stackedLines
|
|
43
44
|
]
|
|
44
45
|
};
|
|
@@ -144,9 +144,9 @@ function buildSectionLabelRow(columnCount, descriptionColumnIndex, label) {
|
|
|
144
144
|
const normalizedDescriptionIndex = descriptionColumnIndex >= 0 ? descriptionColumnIndex : 0;
|
|
145
145
|
return Array.from({ length: columnCount }, (_, index) => {
|
|
146
146
|
if (index === normalizedDescriptionIndex) {
|
|
147
|
-
return { text: label, bold: true, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize };
|
|
147
|
+
return { text: label, bold: true, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor };
|
|
148
148
|
}
|
|
149
|
-
return { text: '', fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize };
|
|
149
|
+
return { text: '', fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor };
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
152
|
function getDescriptionColumnIndexFromColumns(columns) {
|
|
@@ -162,29 +162,29 @@ function buildFallbackDataRow(item, index, fallbackHeaderRow, fixedTo) {
|
|
|
162
162
|
if (header.taxKind === 'rate') {
|
|
163
163
|
const value = (0, pdf_table_row_1.getFirstFieldValue)(item, ['CGSTPerc']);
|
|
164
164
|
const renderedValue = formatNumericLikeValue(value, fixedTo);
|
|
165
|
-
return { text: renderedValue, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, alignment: (0, pdf_table_row_1.getNumericAlignment)(renderedValue) };
|
|
165
|
+
return { text: renderedValue, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor, alignment: (0, pdf_table_row_1.getNumericAlignment)(renderedValue) };
|
|
166
166
|
}
|
|
167
167
|
else if (header.taxKind === 'amount') {
|
|
168
168
|
const value = (0, pdf_table_row_1.getFirstFieldValue)(item, ['CGSTAmt']);
|
|
169
169
|
const renderedValue = formatNumericLikeValue(value, fixedTo);
|
|
170
|
-
return { text: renderedValue, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, alignment: (0, pdf_table_row_1.getNumericAlignment)(renderedValue) };
|
|
170
|
+
return { text: renderedValue, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor, alignment: (0, pdf_table_row_1.getNumericAlignment)(renderedValue) };
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
if (header.text === 'SGST') {
|
|
174
174
|
if (header.taxKind === 'rate') {
|
|
175
175
|
const value = (0, pdf_table_row_1.getFirstFieldValue)(item, ['SGSTPerc']);
|
|
176
176
|
const renderedValue = formatNumericLikeValue(value, fixedTo);
|
|
177
|
-
return { text: renderedValue, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, alignment: (0, pdf_table_row_1.getNumericAlignment)(renderedValue) };
|
|
177
|
+
return { text: renderedValue, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor, alignment: (0, pdf_table_row_1.getNumericAlignment)(renderedValue) };
|
|
178
178
|
}
|
|
179
179
|
else if (header.taxKind === 'amount') {
|
|
180
180
|
const value = (0, pdf_table_row_1.getFirstFieldValue)(item, ['SGSTAmt']);
|
|
181
181
|
const renderedValue = formatNumericLikeValue(value, fixedTo);
|
|
182
|
-
return { text: renderedValue, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, alignment: (0, pdf_table_row_1.getNumericAlignment)(renderedValue) };
|
|
182
|
+
return { text: renderedValue, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor, alignment: (0, pdf_table_row_1.getNumericAlignment)(renderedValue) };
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
if (header.text === 'S.No') {
|
|
186
186
|
const value = String(index + 1);
|
|
187
|
-
return { text: value, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, alignment: (0, pdf_table_row_1.getNumericAlignment)(value) };
|
|
187
|
+
return { text: value, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor, alignment: (0, pdf_table_row_1.getNumericAlignment)(value) };
|
|
188
188
|
}
|
|
189
189
|
const mainValue = formatNumericLikeValue((0, pdf_table_row_1.getFirstFieldValue)(item, header.dbFields), fixedTo);
|
|
190
190
|
const stackedLines = ((_a = header.stackFields) !== null && _a !== void 0 ? _a : [])
|
|
@@ -193,19 +193,20 @@ function buildFallbackDataRow(item, index, fallbackHeaderRow, fixedTo) {
|
|
|
193
193
|
if (!stackValue) {
|
|
194
194
|
return null;
|
|
195
195
|
}
|
|
196
|
-
return { text: `${stackField.text}: ${stackValue}`, fontSize: pdf_table_config_1.pdfTableStyleConfig.stackFieldFontSize, italics: true };
|
|
196
|
+
return { text: `${stackField.text}: ${stackValue}`, fontSize: pdf_table_config_1.pdfTableStyleConfig.stackFieldFontSize, color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor, italics: true };
|
|
197
197
|
})
|
|
198
198
|
.filter((line) => !!line);
|
|
199
199
|
if (stackedLines.length === 0) {
|
|
200
200
|
return {
|
|
201
201
|
text: mainValue,
|
|
202
202
|
fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize,
|
|
203
|
+
color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor,
|
|
203
204
|
alignment: (0, pdf_table_row_1.getCellAlignment)(header.text, mainValue)
|
|
204
205
|
};
|
|
205
206
|
}
|
|
206
207
|
return {
|
|
207
208
|
stack: [
|
|
208
|
-
{ text: mainValue, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize },
|
|
209
|
+
{ text: mainValue, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor },
|
|
209
210
|
...stackedLines
|
|
210
211
|
]
|
|
211
212
|
};
|
|
@@ -272,7 +273,8 @@ function buildTotalLabelCell(text) {
|
|
|
272
273
|
return {
|
|
273
274
|
text,
|
|
274
275
|
bold: true,
|
|
275
|
-
fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize
|
|
276
|
+
fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize,
|
|
277
|
+
color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor
|
|
276
278
|
};
|
|
277
279
|
}
|
|
278
280
|
function buildTotalValueCell(text, headerText = '') {
|
|
@@ -280,6 +282,7 @@ function buildTotalValueCell(text, headerText = '') {
|
|
|
280
282
|
text,
|
|
281
283
|
bold: true,
|
|
282
284
|
fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize,
|
|
285
|
+
color: pdf_table_config_1.pdfTableStyleConfig.bodyFontColor,
|
|
283
286
|
alignment: headerText ? (0, pdf_table_row_1.getCellAlignment)(headerText, text) : (0, pdf_table_row_1.getNumericAlignment)(text)
|
|
284
287
|
};
|
|
285
288
|
}
|