shareneus 1.6.79 → 1.6.81
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.
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.CreateInvoicePDFService = CreateInvoicePDFService;
|
|
7
7
|
exports.DownloadInvoicePDFService = DownloadInvoicePDFService;
|
|
8
8
|
exports.GetInvoicePdfDataUrl = GetInvoicePdfDataUrl;
|
|
9
|
+
const pdf_party_details_section_1 = require("../../../shared/party-details-section/pdf-party-details.section");
|
|
9
10
|
const pdf_table_section_1 = require("../../../shared/table-section/pdf-table.section");
|
|
10
11
|
const pdf_totals_section_1 = require("../../../shared/totals-section/pdf-totals.section");
|
|
11
12
|
const pdf_shared_utils_1 = require("../../../shared/header-footer-section/pdf-shared.utils");
|
|
@@ -67,11 +68,11 @@ function GetInvoicePdfDataUrl(PDFInvoiceData = {}, PrintConfigData = {}, printCo
|
|
|
67
68
|
}
|
|
68
69
|
function CustomerInfo(InvoicePDFData) {
|
|
69
70
|
let CustomerTable = [
|
|
70
|
-
[{ text: 'Name', style: ['headerstyle'] }, { text: ':', style: ['headerstyle'] }, { text: InvoicePDFData.Customer.Name, style: ['headerstyle'] }],
|
|
71
|
-
[{ text: '
|
|
71
|
+
[{ text: 'Name', style: ['headerstyle'], fontSize: 9 }, { text: ':', style: ['headerstyle'], fontSize: 9 }, { text: InvoicePDFData.Customer.Name, style: ['headerstyle'], fontSize: 9 }],
|
|
72
|
+
[{ text: 'Address', style: ['headerstyle'], fontSize: 9 }, { text: ':', style: ['headerstyle'], fontSize: 9 }, { text: InvoicePDFData.Customer.Adrs1, style: ['headerstyle'], fontSize: 9 }],
|
|
72
73
|
];
|
|
73
74
|
if (InvoicePDFData.Customer.Code) {
|
|
74
|
-
CustomerTable.unshift([{ text: 'UHID', style: ['headerstyle'] }, { text: ':', style: ['headerstyle'] }, { text: InvoicePDFData.Customer.Code, style: ['headerstyle'] }]);
|
|
75
|
+
CustomerTable.unshift([{ text: 'UHID', style: ['headerstyle'], fontSize: 9 }, { text: ':', style: ['headerstyle'], fontSize: 9 }, { text: InvoicePDFData.Customer.Code, style: ['headerstyle'], fontSize: 9 }]);
|
|
75
76
|
}
|
|
76
77
|
return CustomerTable;
|
|
77
78
|
}
|
|
@@ -101,7 +102,7 @@ function GetPartyDetails(Entity, InvoicePDFData) {
|
|
|
101
102
|
[{
|
|
102
103
|
// marginTop: 4,
|
|
103
104
|
marginLeft: 5,
|
|
104
|
-
marginBottom:
|
|
105
|
+
marginBottom: 10,
|
|
105
106
|
// stack: [{ text: 'UHID : ' + InvoicePDFData.Customer.Code, style: ['headerstyle'] },
|
|
106
107
|
// { text: 'Name : ' + InvoicePDFData.Customer.Name, style: ['headerstyle'] },
|
|
107
108
|
// { text: 'Doctor : ' + InvoicePDFData.Name, style: ['headerstyle'] }],
|
|
@@ -120,9 +121,10 @@ function GetPartyDetails(Entity, InvoicePDFData) {
|
|
|
120
121
|
table: {
|
|
121
122
|
lineHeight: 0.5,
|
|
122
123
|
body: [
|
|
123
|
-
[{ text: 'Receipt No', style: ['headerstyle'] }, { text: ':', style: ['headerstyle'] }, { text: InvoicePDFData._id, style: ['headerstyle'] }],
|
|
124
|
-
[{ text: 'Date', style: ['headerstyle'] }, { text: ':', style: ['headerstyle'] }, { text: InvoicePDFData.CrDate, style: ['headerstyle'] }],
|
|
124
|
+
[{ text: 'Receipt No', style: ['headerstyle'], fontSize: 9 }, { text: ':', style: ['headerstyle'], fontSize: 9 }, { text: InvoicePDFData._id, style: ['headerstyle'], fontSize: 9 }],
|
|
125
|
+
[{ text: 'Date', style: ['headerstyle'], fontSize: 9 }, { text: ':', style: ['headerstyle'], fontSize: 9 }, { text: InvoicePDFData.CrDate, style: ['headerstyle'], fontSize: 9 }],
|
|
125
126
|
// [{text:'Doctor', style: ['headerstyle']}, {text:':', style: ['headerstyle']}, {text: InvoicePDFData.Name, style: ['headerstyle']}]
|
|
127
|
+
[{ text: 'Doctor', style: ['headerstyle'], fontSize: 9 }, { text: ':', style: ['headerstyle'], fontSize: 9 }, { text: InvoicePDFData.Name, style: ['headerstyle'], fontSize: 9 }]
|
|
126
128
|
]
|
|
127
129
|
}, layout: 'noBorders'
|
|
128
130
|
}]
|
|
@@ -227,15 +229,34 @@ function buildPdfDocDefinition(PDFInvoiceData = {}, PrintConfigData = {}, printC
|
|
|
227
229
|
const content = [];
|
|
228
230
|
copyLabels.forEach((copyLabel, index) => {
|
|
229
231
|
var _a, _b;
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
232
|
+
let invoiceHeaderContent;
|
|
233
|
+
let invoicePartyDetailsContent;
|
|
234
|
+
let invoiceContentSections;
|
|
235
|
+
if (PrintConfigData.IsPoSPrint) {
|
|
236
|
+
invoiceHeaderContent = [GetMainHeaderInfo(PDFInvoiceData === null || PDFInvoiceData === void 0 ? void 0 : PDFInvoiceData.Entity, PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.Image, (_a = PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.headerStyles) === null || _a === void 0 ? void 0 : _a.OrgNameClr, (_b = PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.headerStyles) === null || _b === void 0 ? void 0 : _b.AdrsClr, PDFInvoiceData)];
|
|
237
|
+
invoicePartyDetailsContent = [GetPartyDetails(PDFInvoiceData === null || PDFInvoiceData === void 0 ? void 0 : PDFInvoiceData.Entity, PDFInvoiceData)];
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
invoiceHeaderContent = (0, pdf_header_footer_section_1.buildDocumentHeaderSection)(PrintConfig, PDFInvoiceData);
|
|
241
|
+
invoicePartyDetailsContent = (0, pdf_party_details_section_1.buildInvoicePartyDetailsSection)(PDFInvoiceData, PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.Customer, PrintConfig);
|
|
242
|
+
}
|
|
236
243
|
const invoiceTotalsAndNotesContent = (0, pdf_totals_section_1.buildInvoiceTotalsAndNotesSection)(PDFInvoiceData, availableWidth, PrintConfigData);
|
|
237
244
|
const signatureContent = (0, pdf_totals_section_1.buildSignatureSection)(PrintConfig, PDFInvoiceData, availableWidth);
|
|
238
245
|
const tableData = (0, pdf_table_section_1.buildInvoiceTableData)(PDFInvoiceData, PrintConfig, availableWidth);
|
|
246
|
+
if (PrintConfigData.IsPoSPrint) {
|
|
247
|
+
invoiceContentSections = [
|
|
248
|
+
...invoiceHeaderContent,
|
|
249
|
+
...invoicePartyDetailsContent,
|
|
250
|
+
];
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
const invoiceHeadingContent = (0, pdf_header_footer_section_1.buildDocumentHeadingSection)(PDFInvoiceData, PrintConfig, availableWidth);
|
|
254
|
+
invoiceContentSections = [
|
|
255
|
+
...invoiceHeaderContent,
|
|
256
|
+
...invoiceHeadingContent,
|
|
257
|
+
...invoicePartyDetailsContent,
|
|
258
|
+
];
|
|
259
|
+
}
|
|
239
260
|
if (index > 0) {
|
|
240
261
|
content.push({ text: '', pageBreak: 'before' });
|
|
241
262
|
}
|
|
@@ -248,7 +269,7 @@ function buildPdfDocDefinition(PDFInvoiceData = {}, PrintConfigData = {}, printC
|
|
|
248
269
|
margin: [0, 0, 0, 2]
|
|
249
270
|
});
|
|
250
271
|
}
|
|
251
|
-
content.push(...
|
|
272
|
+
content.push(...invoiceContentSections, {
|
|
252
273
|
table: {
|
|
253
274
|
lineHeight: 2,
|
|
254
275
|
headerRows: tableData.headerRows.length,
|