shareneus 1.3.1 → 1.3.3

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/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DebitNotePdfService = exports.DCWithoutPricePdfService = exports.DCLandscapeWithoutPricePdfService = exports.DCLandscapePdfService = exports.CustomerBalancesService = exports.SalesByCustomerPDFService = exports.CustWiseSalesDetailsService = exports.CreditNoteTotalsService = exports.CreditNotePdfService = exports.ConsultationPDFService = exports.ConsultationFullPrintService = exports.ConsultationFeeReceiptPrintService = exports.CNPrintService = exports.ChecklistsPDFService = exports.CheckListPrintService = exports.CategoryWiseItemPDFService = exports.SalesReceiptprintService = exports.AppointmentTotalsService = exports.AnalysisPDFService = exports.VenBalanceXlsxFileService = exports.TallySalesImportXlsxFileService = exports.StockXlsxFileService = exports.IssueSparesXlsxFileService = exports.ScheduledDrugXlsxFileService = exports.ScheduledDrugSummaryXlsxFileService = exports.SalesByServiceSummaryXlsxFileService = exports.SummaryXlsxFileService = exports.ServiceAdvisorWisePartXlsxFileService = exports.ServiceAdvisorWiseLaborXlsxFileService = exports.RepairOrdersXlsxFileService = exports.PaymentsMadeXlsxFileService = exports.PaymentReceiveXlsxFileService = exports.OperatorWiseSummaryXlsxFileService = exports.OperatorWiseDetailsXlsxFileService = exports.ManfWiseSalesXlsxFileService = exports.ItemsWiseSalesXlsxFileService = exports.ItemWiseMOSummaryXlsxFileService = exports.ItemWiseMODetailsXlsxFileService = exports.ItemWiseDoctorSaleXlsxFileService = exports.InvoicesWiseXlsxFileService = exports.InsuranceExpireXlsxFileService = exports.GSTR2ExcelService = exports.GSTR1ExcelService = exports.GSTROXlsxFileService = exports.ExpiringDrugsXlsxFileService = exports.SalesByCustomerXlsxFileService = exports.CustWiseSalesXlsxFileService = exports.CustBalanceXlsxFileService = exports.CategoryWiseItemXlsxFileService = exports.AnalysisXlsxFileService = void 0;
4
4
  exports.SharedPDFService = exports.SharedInvoiceprintService = exports.WOPrintService = exports.ScheduledDrugSummaryPDFService = exports.ScheduledDrugPDFService = exports.SalesTotalsService = exports.SaleReceiptPrintService = exports.SalesReceiptpdfService = exports.SalesPrintService = exports.SalesPdfService = exports.SalesByServiceSummaryPDF = exports.ROTotalsService = exports.ROPrintService = exports.RoprintService = exports.RepairOrdersReportsPDFService = exports.ReorderPointPDFService = exports.ReceiptPrintService = exports.PurchaseOrderPDFService = exports.PurchaseOrderTotalsService = exports.PurchaseOrderPrintService = exports.PosReceiptPrintService = exports.POTotalsService = exports.PaymentsReportPDFService = exports.ReceiptPDFService = exports.PackShipPrintService = exports.PackShipPDFService = exports.OperatorWiseSalesSummaryPDF = exports.OperatorWiseSalesDetailsPDF = exports.MaterialOutprintService = exports.MeetingPdfService = exports.ManfWiseSalesService = exports.ItemWiseSalesPDFService = exports.ItemWiseMOSummaryPDF = exports.ItemWiseMODetailsPDF = exports.ItemWiseDoctorSalePDFService = exports.ItemDetaisPdf = exports.IssuePartsprintService = exports.InvoiceTotalsService = exports.InvoiceLandscapePdfService = exports.InvPrintService = exports.InvoiceprintService = exports.InsuranceExpirePDF = exports.ExpiringDrugPDFService = exports.EstPrintService = exports.EquipmentDesignPdf = exports.DeliveryChallanTotalsService = exports.DeliveryChallanPrintService = exports.DeliveryChallanPdfService = exports.DebitNoteTotalsService = exports.DebitNotePrintService = void 0;
5
- exports.InvoiceLetterheadPdfService = exports.HCInvoiceprintService = exports.InvoicePortraitPrintService = exports.MyDate = exports.TrUtils = exports.VendorDebitNoteTotalsService = exports.VendorDebitNotePrintService = exports.VendorDebitNotePdfService = exports.VendorCreditNoteTotalsService = exports.VendorCreditNotePrintService = exports.VendorCreditNotePDFService = exports.VendorBalancesService = exports.TransferOrderPrintService = exports.TechnicianPrintService = exports.TechnicianpdfService = exports.TaskReportsPDfService = exports.TaskPDfService = exports.PrintSharedService = void 0;
5
+ exports.ConsultationLetterHeadPDFService = exports.InvoiceLetterheadPdfService = exports.HCInvoiceprintService = exports.InvoicePortraitPrintService = exports.MyDate = exports.TrUtils = exports.VendorDebitNoteTotalsService = exports.VendorDebitNotePrintService = exports.VendorDebitNotePdfService = exports.VendorCreditNoteTotalsService = exports.VendorCreditNotePrintService = exports.VendorCreditNotePDFService = exports.VendorBalancesService = exports.TransferOrderPrintService = exports.TechnicianPrintService = exports.TechnicianpdfService = exports.TaskReportsPDfService = exports.TaskPDfService = exports.PrintSharedService = void 0;
6
6
  var analysis_excel_service_1 = require("./excel-files/analysis-excel.service");
7
7
  Object.defineProperty(exports, "AnalysisXlsxFileService", { enumerable: true, get: function () { return analysis_excel_service_1.AnalysisXlsxFileService; } });
8
8
  var category_wise_item_excel_service_1 = require("./excel-files/category-wise-item-excel.service");
@@ -239,3 +239,5 @@ var hc_inv_pdf_service_1 = require("./services/hc-inv-pdf.service");
239
239
  Object.defineProperty(exports, "HCInvoiceprintService", { enumerable: true, get: function () { return hc_inv_pdf_service_1.HCInvoiceprintService; } });
240
240
  var invoice_letterhead_pdf_service_1 = require("./services/invoice-letterhead-pdf.service");
241
241
  Object.defineProperty(exports, "InvoiceLetterheadPdfService", { enumerable: true, get: function () { return invoice_letterhead_pdf_service_1.InvoiceLetterheadPdfService; } });
242
+ var consultation_letterhead_pdf_service_1 = require("./services/consultation-letterhead-pdf.service");
243
+ Object.defineProperty(exports, "ConsultationLetterHeadPDFService", { enumerable: true, get: function () { return consultation_letterhead_pdf_service_1.ConsultationLetterHeadPDFService; } });
@@ -0,0 +1,420 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConsultationLetterHeadPDFService = void 0;
4
+ const date_fns_1 = require("date-fns");
5
+ const tr_utils_1 = require("../utils/tr-utils");
6
+ const my_date_1 = require("../utils/my-date");
7
+ const shared_pdf_service_1 = require("./shared-pdf.service");
8
+ class ConsultationLetterHeadPDFService {
9
+ static GetConsultationPrint(CnstData, Remarks, LetterHead) {
10
+ let dd = {
11
+ info: {
12
+ title: 'Consultation',
13
+ },
14
+ footer: this.FooterContent(CnstData),
15
+ header: function (currentPage, pageCount, pageSize) {
16
+ return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', marginRight: 25, fontSize: 8, marginTop: 2 };
17
+ },
18
+ pageMargins: [10, LetterHead.Top, 10, LetterHead.Bottom],
19
+ pageSize: 'A4',
20
+ content: [
21
+ // { text: CnstData.Entity.CName, style: ['headerstyle'], alignment: 'center', fontSize: 20 },
22
+ // { text: 'Expiring Drugs (' + this.GetDate(DatesDetails) + ')', style: ['headerstyle'], alignment: 'center', fontSize: 12 },
23
+ this.GetMainHeaderDetails(CnstData, CnstData.Entity, CnstData.HeaderName, CnstData.Image, CnstData.HColor, CnstData.AColor, null),
24
+ {
25
+ columns: [this.GetHeight(CnstData),
26
+ this.GetWeight(CnstData),
27
+ this.GetBP(CnstData), this.GetTemperature(CnstData),
28
+ this.GetSPO2(CnstData), this.GetPulse(CnstData)], fontSize: 8, marginTop: 5
29
+ },
30
+ this.GetComplaintsTable(CnstData.Comps, 'Complaints:'),
31
+ this.GetDiagnosisTable(CnstData.Diags, 'Diagnosis:'),
32
+ this.GetRxTable(CnstData.Rx, Remarks),
33
+ this.GetComplaintsTable(CnstData.Tests, 'Lab Investigations:'),
34
+ this.GetDiagnosisTable(CnstData.Advice, 'Advices:'),
35
+ // { text: 'Lab Investigations:', bold: true, marginTop: 5, fontSize: 12 },
36
+ // { text: this.GetComplaints(CnstData.Tests), fontSize: 9, marginTop: 5, marginBottom: 10 },
37
+ // { text: 'Advices:', bold: true, marginTop: 5, fontSize: 12 },
38
+ // { text: this.GetDiagnosis(CnstData.Advice), fontSize: 9, marginTop: 5, marginBottom: 10 },
39
+ this.CustomSection(CnstData.Sections)
40
+ // this.GetSignatures(CnstData.Entity.CName, CnstData.Type, CnstData.For),
41
+ ],
42
+ styles: {
43
+ temp2header: {
44
+ fontSize: 15,
45
+ bold: true,
46
+ alignment: 'left',
47
+ // margin: [0, 10, 0, 0],
48
+ },
49
+ headerstyle: {
50
+ fontSize: 9
51
+ },
52
+ Sign: {
53
+ fontSize: 8,
54
+ margin: [0, 30, 0, 5]
55
+ },
56
+ forCompany: {
57
+ marginRight: 5,
58
+ marginTop: 10,
59
+ fontSize: 9,
60
+ alignment: 'left'
61
+ },
62
+ tableheader: {
63
+ bold: true,
64
+ margin: [0, 1, 0, 5],
65
+ alignment: 'center'
66
+ },
67
+ tableheader1: {
68
+ bold: true,
69
+ margin: [0, 2, 0, 2],
70
+ alignment: 'center'
71
+ },
72
+ tableExample: {
73
+ fontSize: 9
74
+ },
75
+ ws_adrs_left: {
76
+ fontSize: 8,
77
+ alignment: 'left',
78
+ }
79
+ }
80
+ };
81
+ return dd;
82
+ }
83
+ static GetRxTable(Rx, Remarks) {
84
+ if (!tr_utils_1.TrUtils.IsNull(Rx) && Rx.length !== 0) {
85
+ return {
86
+ stack: [
87
+ { text: 'Rx:', bold: true, fontSize: 12 },
88
+ this.GetItemsTable(Rx, Remarks),
89
+ ]
90
+ };
91
+ }
92
+ else {
93
+ return {};
94
+ }
95
+ }
96
+ static GetDiagnosisTable(diagnosis, heading) {
97
+ if (!tr_utils_1.TrUtils.IsNull(diagnosis) && diagnosis.length !== 0) {
98
+ return {
99
+ stack: [
100
+ { text: heading, bold: true, marginTop: 5, fontSize: 12 },
101
+ { text: this.GetDiagnosis(diagnosis), fontSize: 9, marginTop: 5, marginBottom: 10 },
102
+ ]
103
+ };
104
+ }
105
+ else {
106
+ return {};
107
+ }
108
+ }
109
+ static GetComplaintsTable(complaints, heading) {
110
+ if (!tr_utils_1.TrUtils.IsNull(complaints) && complaints.length !== 0) {
111
+ return {
112
+ stack: [
113
+ { text: heading, bold: true, marginTop: 5, fontSize: 12 },
114
+ { text: this.GetComplaints(complaints), fontSize: 9, marginTop: 5, marginBottom: 10 },
115
+ ]
116
+ };
117
+ }
118
+ else {
119
+ return {};
120
+ }
121
+ }
122
+ static FooterContent(CnstData) {
123
+ var _a, _b;
124
+ return {
125
+ stack: [{ text: ((_a = CnstData.Doc) === null || _a === void 0 ? void 0 : _a.Sltn) + ' ' + ((_b = CnstData.Doc) === null || _b === void 0 ? void 0 : _b.Name), bold: true, alignment: 'right', marginBottom: 10 }, this.HeaderAfterLine1()],
126
+ margin: [10, 0, 10, 10]
127
+ };
128
+ }
129
+ static HeaderAfterLine1() {
130
+ return {
131
+ canvas: [
132
+ {
133
+ type: 'line',
134
+ lineColor: 'grey',
135
+ x1: 0,
136
+ y1: 0,
137
+ x2: 576,
138
+ y2: 0,
139
+ lineWidth: 1.5
140
+ }
141
+ ]
142
+ };
143
+ }
144
+ static CustomSection(sections) {
145
+ let Sec = [];
146
+ sections === null || sections === void 0 ? void 0 : sections.forEach((sec) => {
147
+ var _a;
148
+ Sec.push({ text: sec.Name + ' :', bold: true, style: 'header', marginTop: 5, marginBottom: 5 });
149
+ let UnOrderlist = [];
150
+ (_a = sec.Items) === null || _a === void 0 ? void 0 : _a.forEach((item) => {
151
+ UnOrderlist.push({
152
+ style: 'tableExample',
153
+ table: {
154
+ body: [
155
+ [{ text: item.Desc, bold: true }, '-', { text: item.Notes }]
156
+ ]
157
+ },
158
+ layout: 'noBorders'
159
+ });
160
+ });
161
+ Sec.push({ ul: UnOrderlist, fontSize: 10 });
162
+ });
163
+ return Sec;
164
+ }
165
+ static GetWeight(CnstData) {
166
+ var _a, _b, _c, _d, _e;
167
+ if (!tr_utils_1.TrUtils.IsNull((_a = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Vitals) === null || _a === void 0 ? void 0 : _a.Weight) && !tr_utils_1.TrUtils.IsNull((_c = (_b = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Vitals) === null || _b === void 0 ? void 0 : _b.Weight) === null || _c === void 0 ? void 0 : _c.V)) {
168
+ return { text: 'Weight :' + ((_e = (_d = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Vitals) === null || _d === void 0 ? void 0 : _d.Weight) === null || _e === void 0 ? void 0 : _e.V) + ' kg', Width: 80 };
169
+ }
170
+ else {
171
+ return { text: 'Weight :', Width: 80 };
172
+ }
173
+ }
174
+ static GetTemperature(CnstData) {
175
+ var _a, _b, _c, _d, _e;
176
+ if (!tr_utils_1.TrUtils.IsNull((_a = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Vitals) === null || _a === void 0 ? void 0 : _a.Temp) && !tr_utils_1.TrUtils.IsNull((_c = (_b = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Vitals) === null || _b === void 0 ? void 0 : _b.Temp) === null || _c === void 0 ? void 0 : _c.V)) {
177
+ return { text: 'Temperature :' + ((_e = (_d = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Vitals) === null || _d === void 0 ? void 0 : _d.Temp) === null || _e === void 0 ? void 0 : _e.V) + ' F', Width: 80 };
178
+ }
179
+ else {
180
+ return { text: 'Temperature :', Width: 80 };
181
+ }
182
+ }
183
+ static GetSPO2(CnstData) {
184
+ var _a, _b, _c, _d, _e;
185
+ if (!tr_utils_1.TrUtils.IsNull((_a = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Vitals) === null || _a === void 0 ? void 0 : _a.SPO2) && !tr_utils_1.TrUtils.IsNull((_c = (_b = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Vitals) === null || _b === void 0 ? void 0 : _b.SPO2) === null || _c === void 0 ? void 0 : _c.V)) {
186
+ return { text: 'SPO2 :' + ((_e = (_d = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Vitals) === null || _d === void 0 ? void 0 : _d.SPO2) === null || _e === void 0 ? void 0 : _e.V) + ' mmHg', Width: 80 };
187
+ }
188
+ else {
189
+ return { text: 'SPO2 :', Width: 80 };
190
+ }
191
+ }
192
+ static GetPulse(CnstData) {
193
+ var _a, _b, _c, _d, _e;
194
+ if (!tr_utils_1.TrUtils.IsNull((_a = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Vitals) === null || _a === void 0 ? void 0 : _a.Pulse) && !tr_utils_1.TrUtils.IsNull((_c = (_b = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Vitals) === null || _b === void 0 ? void 0 : _b.Pulse) === null || _c === void 0 ? void 0 : _c.V)) {
195
+ return { text: 'Pulse :' + ((_e = (_d = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Vitals) === null || _d === void 0 ? void 0 : _d.Pulse) === null || _e === void 0 ? void 0 : _e.V) + ' bpm', Width: 80 };
196
+ }
197
+ else {
198
+ return { text: 'Pulse :', Width: 80 };
199
+ }
200
+ }
201
+ static GetHeight(CnstData) {
202
+ var _a, _b, _c, _d, _e, _f, _g;
203
+ if (!tr_utils_1.TrUtils.IsNull((_a = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Vitals) === null || _a === void 0 ? void 0 : _a.Height) && !tr_utils_1.TrUtils.IsNull((_c = (_b = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Vitals) === null || _b === void 0 ? void 0 : _b.Height) === null || _c === void 0 ? void 0 : _c.V)) {
204
+ return { text: 'Height :' + ((_e = (_d = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Vitals) === null || _d === void 0 ? void 0 : _d.Height) === null || _e === void 0 ? void 0 : _e.V) + ' ' + ((_g = (_f = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Vitals) === null || _f === void 0 ? void 0 : _f.Height) === null || _g === void 0 ? void 0 : _g.U), Width: 80 };
205
+ }
206
+ else {
207
+ return { text: 'Height :', Width: 80 };
208
+ }
209
+ }
210
+ static GetBP(CnstData) {
211
+ var _a, _b, _c, _d, _e;
212
+ if (!tr_utils_1.TrUtils.IsNull((_a = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Vitals) === null || _a === void 0 ? void 0 : _a.BP) && !tr_utils_1.TrUtils.IsNull((_c = (_b = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Vitals) === null || _b === void 0 ? void 0 : _b.Height) === null || _c === void 0 ? void 0 : _c.U)) {
213
+ return { text: 'BP :' + ((_e = (_d = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Vitals) === null || _d === void 0 ? void 0 : _d.BP) === null || _e === void 0 ? void 0 : _e.V) + ' mmHg', Width: 80 };
214
+ }
215
+ else {
216
+ return { text: 'BP :', Width: 80 };
217
+ }
218
+ }
219
+ static GetMainHeaderDetails(CnstData, Entity, HeaderName, Image, HColor, AColor, text) {
220
+ var _a;
221
+ return [
222
+ // this.GetHeaderBasedOnCondition(CnstData, Entity, HeaderName, Image, HColor, AColor, text),
223
+ // SharedPDFService.HeaderAfterLine1(),
224
+ {
225
+ columns: [{
226
+ stack: [{ text: CnstData.Pat.Name, fontSize: 10, marginTop: 5, bold: true },
227
+ { text: CnstData.Pat.Code + ' | ' + this.DifferenceInYears(CnstData.Pat.DOB) + ' | ' + CnstData.Pat.Sex + this.GetPhoneNumber((_a = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Pat) === null || _a === void 0 ? void 0 : _a.Ph), fontSize: 10, marginBottom: 5 }]
228
+ },
229
+ {
230
+ stack: [
231
+ { text: this.GetCnsltDate(CnstData), style: ['headerstyle'] }
232
+ ], marginTop: 5, width: 120
233
+ }]
234
+ }
235
+ // { text: CnstData.Pat.Name, fontSize: 10, marginTop: 5 },
236
+ // { text: CnstData.Pat.Code + ' | ' + this.DifferenceInYears(CnstData.Pat.DOB) + ' | ' + CnstData.Pat.Sex + this.GetPhoneNumber(CnstData?.Pat?.Ph), fontSize: 10, marginBottom: 5 },
237
+ ];
238
+ }
239
+ static GetCnsltDate(CnstData) {
240
+ if (!tr_utils_1.TrUtils.IsNull(CnstData.ClDate)) {
241
+ return my_date_1.MyDate.GetWeekDateAndTime(CnstData.ClDate);
242
+ }
243
+ else {
244
+ return my_date_1.MyDate.GetWeekDateAndTime(CnstData.CrDate);
245
+ }
246
+ }
247
+ static GetHeaderBasedOnCondition(CnstData, Entity, HeaderName, Image, HColor, AColor, text) {
248
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
249
+ if (Entity.Header === 2) {
250
+ return {
251
+ columns: [
252
+ shared_pdf_service_1.SharedPDFService.GetConsultationMainHeader(Entity, null, AColor, HColor, text),
253
+ {
254
+ stack: [{ text: ((_a = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _a === void 0 ? void 0 : _a.Sltn) + ' ' + ((_b = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _b === void 0 ? void 0 : _b.Name), fontSize: 15, bold: true, alignment: 'right' },
255
+ { text: (_c = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _c === void 0 ? void 0 : _c.Intro1, fontSize: 9, alignment: 'right' },
256
+ { text: (_d = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _d === void 0 ? void 0 : _d.Intro2, fontSize: 9, alignment: 'right' },
257
+ { text: (_e = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _e === void 0 ? void 0 : _e.Intro3, fontSize: 9, alignment: 'right' },
258
+ { text: 'Registration ID- ' + ((_f = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _f === void 0 ? void 0 : _f.CounReg), fontSize: 9, alignment: 'right', marginBottom: 5 }], width: '40%', marginTop: 15
259
+ }
260
+ ]
261
+ };
262
+ }
263
+ else {
264
+ return {
265
+ columns: [shared_pdf_service_1.SharedPDFService.GetImage(Image, Entity.PrLogo), {
266
+ stack: [{ text: ((_g = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _g === void 0 ? void 0 : _g.Sltn) + ' ' + ((_h = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _h === void 0 ? void 0 : _h.Name), fontSize: 15, alignment: 'right', bold: true },
267
+ { text: (_j = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _j === void 0 ? void 0 : _j.Intro1, fontSize: 9, alignment: 'right' },
268
+ { text: (_k = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _k === void 0 ? void 0 : _k.Intro2, fontSize: 9, alignment: 'right' },
269
+ { text: (_l = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _l === void 0 ? void 0 : _l.Intro3, fontSize: 9, alignment: 'right' },
270
+ { text: 'Registration ID- ' + ((_m = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _m === void 0 ? void 0 : _m.CounReg), fontSize: 9, alignment: 'right', marginBottom: 5 }], marginTop: 25
271
+ }]
272
+ };
273
+ }
274
+ }
275
+ static GetPhoneNumber(phone) {
276
+ if (!tr_utils_1.TrUtils.IsNull(phone)) {
277
+ return ' | ' + phone;
278
+ }
279
+ else {
280
+ return '';
281
+ }
282
+ }
283
+ static DifferenceInYears(DOB) {
284
+ if (tr_utils_1.TrUtils.IsNull(DOB)) {
285
+ return 'DOB Not Specified';
286
+ }
287
+ let Datei = my_date_1.MyDate.GetDateTimeNowInUTC();
288
+ const result = (0, date_fns_1.differenceInYears)(Datei, new Date(DOB));
289
+ return result + ' Years';
290
+ }
291
+ static GetDiagnosis(Diags) {
292
+ let Diagnosis = '';
293
+ Diags === null || Diags === void 0 ? void 0 : Diags.forEach((item, index) => {
294
+ Diagnosis = Diagnosis + item.Desc;
295
+ if ((index + 1) !== Diags.length) {
296
+ Diagnosis = Diagnosis + ', ';
297
+ }
298
+ });
299
+ return Diagnosis;
300
+ }
301
+ static GetComplaints(Comps) {
302
+ let Complaints = '';
303
+ Comps === null || Comps === void 0 ? void 0 : Comps.forEach((item, index) => {
304
+ Complaints = Complaints + item.Desc;
305
+ if ((index + 1) !== Comps.length) {
306
+ Complaints = Complaints + ', ';
307
+ }
308
+ });
309
+ return Complaints;
310
+ }
311
+ static GetDate(DatesDetails) {
312
+ if (DatesDetails.Date === 'CustomRange') {
313
+ return my_date_1.MyDate.GetWeekAndDate(DatesDetails.StDate) + ' - ' + my_date_1.MyDate.GetWeekAndDate(DatesDetails.EnDate);
314
+ }
315
+ else {
316
+ return 'till ' + my_date_1.MyDate.GetWeekAndDate(DatesDetails.EnDate);
317
+ }
318
+ }
319
+ static CustomerAndVehicleDetailsAfterLine() {
320
+ return {
321
+ canvas: [
322
+ {
323
+ type: 'line',
324
+ lineColor: 'gray',
325
+ x1: 0,
326
+ y1: 0,
327
+ x2: 575,
328
+ y2: 0,
329
+ lineWidth: 1
330
+ }
331
+ ]
332
+ };
333
+ }
334
+ static GetSignatures(CName, For, Type) {
335
+ return {
336
+ columns: [{
337
+ stack: [
338
+ this.CompanyName(CName),
339
+ ]
340
+ }],
341
+ };
342
+ }
343
+ static CompanyName(CName) {
344
+ return {
345
+ style: 'forCompany',
346
+ text: ['For ', { text: CName, }],
347
+ };
348
+ }
349
+ static GetItemsTable(Items, Remarks) {
350
+ if (!tr_utils_1.TrUtils.IsNull(Items)) {
351
+ return {
352
+ style: 'tableExample',
353
+ marginTop: 3,
354
+ marginBottom: 5,
355
+ table: {
356
+ widths: [20, '*', 45, 50, 200],
357
+ headerRows: 1,
358
+ body: this.BuildTableBodyForLaborAndParts(Items, Remarks)
359
+ },
360
+ layout: {
361
+ hLineWidth: function (i, node) {
362
+ return (i === 0 || i === 1 || i === node.table.body.length) ? 1 : 0.5;
363
+ },
364
+ vLineWidth: function (i, node) {
365
+ return (i === 0 || i === node.table.widths.length) ? 1 : 0.5;
366
+ },
367
+ // hLineStyle: function (i, node) {
368
+ // return (i === 0 || i === 1) ? { dash: { length: 5, space: 5 } } : null;
369
+ // },
370
+ hLineColor: function (i, node) {
371
+ return (i === 0 || i === 1 || i === node.table.body.length) ? 'gray' : 'lightgrey';
372
+ },
373
+ vLineColor: function (i, node) {
374
+ return 'gray';
375
+ },
376
+ }
377
+ };
378
+ }
379
+ else {
380
+ return {};
381
+ }
382
+ }
383
+ static BuildTableBodyForLaborAndParts(Items, Remarks) {
384
+ let body = this.GetHeaderNames();
385
+ Items === null || Items === void 0 ? void 0 : Items.forEach((item, index) => {
386
+ let dataRow = [];
387
+ dataRow.push({ text: index + 1, rowSpan: item.Dosage.length });
388
+ dataRow.push({ text: item.Desc, bold: true, rowSpan: item.Dosage.length });
389
+ item.Dosage.forEach((dose, index) => {
390
+ if (index === 0) {
391
+ dataRow.push({ text: dose.Dose, alignment: 'left', style: ['headerstyle'], });
392
+ dataRow.push({ text: dose.Dur, alignment: 'left', style: ['headerstyle'], });
393
+ dataRow.push({ text: Remarks[dose.Dose], alignment: 'left', style: ['headerstyle'], });
394
+ body.push(dataRow);
395
+ }
396
+ else {
397
+ let dataRow1 = [];
398
+ dataRow1.push({ text: dose.Dose, alignment: 'left', style: ['headerstyle'], });
399
+ dataRow1.push({ text: dose.Dur, alignment: 'left', style: ['headerstyle'], });
400
+ dataRow1.push({ text: dose.Dose, alignment: 'left', style: ['headerstyle'], });
401
+ dataRow1.push({ text: dose.Dur, alignment: 'left', style: ['headerstyle'], });
402
+ dataRow1.push({ text: Remarks[dose.Dose], alignment: 'left', style: ['headerstyle'], fontFamily: 'telugu' });
403
+ body.push(dataRow1);
404
+ }
405
+ });
406
+ });
407
+ return body;
408
+ }
409
+ static GetHeaderNames() {
410
+ let HeadingNames;
411
+ HeadingNames = [[{ text: 'SNo', style: 'tableheader1', Field: 'SNo', alignment: 'left', line: true },
412
+ { text: 'Medicine', style: 'tableheader1', Field: 'Name', alignment: 'left', line: true },
413
+ { text: 'Dosage', style: 'tableheader1', Field: 'Dosage', alignment: 'left' },
414
+ { text: 'Duration', style: 'tableheader1', Field: 'Freq', alignment: 'left' },
415
+ { text: 'Remarks', style: 'tableheader1', Field: 'Freq', alignment: 'left' },
416
+ ]];
417
+ return HeadingNames;
418
+ }
419
+ }
420
+ exports.ConsultationLetterHeadPDFService = ConsultationLetterHeadPDFService;
@@ -25,6 +25,9 @@ class HCInvoiceprintService {
25
25
  title: this.GetFileName(ROPrintData),
26
26
  },
27
27
  background: function (currentPage, pageSize) {
28
+ if (size !== 'full') {
29
+ pageSize.height = pageSize.height - 435.945;
30
+ }
28
31
  return shared_pdf_service_1.SharedPDFService.GetWatermarkImage(ROPrintData.Image, pageSize, ROPrintData.Entity.Wmark);
29
32
  },
30
33
  header: function (currentPage, pageCount) {
@@ -96,13 +96,13 @@ class InvoicePortraitPrintService {
96
96
  columns: [{ image: InvoicePDFData.Image, width: 60, height: 60, marginBottom: 5 },
97
97
  {
98
98
  stack: [
99
- { text: InvoicePDFData.Entity.CName, style: ['headerstyle'], alignment: 'center', fontSize: 15 },
100
- { text: this.GetAddress(InvoicePDFData.Entity), alignment: 'center', style: ['headerstyle'] },
99
+ { text: InvoicePDFData.Entity.CName, style: ['headerstyle'], alignment: 'left', fontSize: 15 },
100
+ { text: this.GetAddress(InvoicePDFData.Entity), alignment: 'left', style: ['headerstyle'] },
101
101
  {
102
102
  columns: this.GetHeaderInfo(InvoicePDFData, 0)
103
103
  },
104
- { text: InvoicePDFData.HeaderName, alignment: 'center', style: ['Receiptheader1'], marginTop: 5 }
105
- ], marginLeft: -80
104
+ { text: InvoicePDFData.HeaderName, alignment: 'left', style: ['Receiptheader1'], marginTop: 5 }
105
+ ]
106
106
  }
107
107
  ], columnGap: 10
108
108
  };
@@ -156,13 +156,13 @@ class PosReceiptPrintService {
156
156
  columns: [{ image: InvoicePDFData.Image, width: 60, height: 60, marginBottom: 5 },
157
157
  {
158
158
  stack: [
159
- { text: InvoicePDFData.Entity.CName, style: ['headerstyle'], alignment: 'center', fontSize: 15 },
160
- { text: this.GetAddress(InvoicePDFData.Entity), alignment: 'center', style: ['headerstyle'] },
159
+ { text: InvoicePDFData.Entity.CName, style: ['headerstyle'], alignment: 'left', fontSize: 15 },
160
+ { text: this.GetAddress(InvoicePDFData.Entity), alignment: 'left', style: ['headerstyle'] },
161
161
  {
162
162
  columns: this.GetHeaderInfo(InvoicePDFData, 0)
163
163
  },
164
164
  { text: InvoicePDFData.HeaderName, alignment: 'center', style: ['Receiptheader1'], marginTop: 5 }
165
- ], marginLeft: -80
165
+ ]
166
166
  }
167
167
  ], columnGap: 10
168
168
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.3.1",
3
+ "version": "1.3.3",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",