shareneus 1.0.5

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.
Files changed (125) hide show
  1. package/dist/aggregation/aggregation.js +60 -0
  2. package/dist/enums/cache-enums.js +37 -0
  3. package/dist/enums/code-enums.js +288 -0
  4. package/dist/enums/enums.js +362 -0
  5. package/dist/enums/industry-enums.js +24 -0
  6. package/dist/excel-files/GSTR-RO-excel.service.js +935 -0
  7. package/dist/excel-files/GSTR1-excel.service.js +295 -0
  8. package/dist/excel-files/GSTR2-excel.service.js +295 -0
  9. package/dist/excel-files/analysis-excel.service.js +297 -0
  10. package/dist/excel-files/category-wise-item-excel.service.js +274 -0
  11. package/dist/excel-files/cust-balance-excel.service.js +287 -0
  12. package/dist/excel-files/cust-wise-sales-details.js +320 -0
  13. package/dist/excel-files/cust-wise-sales-summary-excel.service.js +302 -0
  14. package/dist/excel-files/expiring-drugs-excel.service.js +292 -0
  15. package/dist/excel-files/insurance-expire-excel.service.js +301 -0
  16. package/dist/excel-files/invoice-wise-excel.service.js +857 -0
  17. package/dist/excel-files/item-wise-doctor-sale-excel.service.js +258 -0
  18. package/dist/excel-files/item-wise-mout-details.js +292 -0
  19. package/dist/excel-files/item-wise-mout-summary.js +286 -0
  20. package/dist/excel-files/items-wise-sales-excel.service.js +314 -0
  21. package/dist/excel-files/manf-wise-sales-excel.service.js +276 -0
  22. package/dist/excel-files/operator-wise-details.js +265 -0
  23. package/dist/excel-files/operator-wise-summary.js +266 -0
  24. package/dist/excel-files/payment-receive-excel.service.js +225 -0
  25. package/dist/excel-files/payments-made-excel.service.js +302 -0
  26. package/dist/excel-files/repair-orders-excel.service.js +255 -0
  27. package/dist/excel-files/sa-wise-labor-sales-excel.service.js +232 -0
  28. package/dist/excel-files/sa-wise-part-sales-excel.service.js +232 -0
  29. package/dist/excel-files/sale-summary-excel.service.js +326 -0
  30. package/dist/excel-files/sales-by-service-details-excel.service.js +1 -0
  31. package/dist/excel-files/sales-by-service-summary-excel.service.js +422 -0
  32. package/dist/excel-files/scheduled-drug-summary-excel.service.js +367 -0
  33. package/dist/excel-files/scheduled-drugs-excel.service.js +366 -0
  34. package/dist/excel-files/spares-issue-excel.service.js +492 -0
  35. package/dist/excel-files/stock-excel.service.js +283 -0
  36. package/dist/excel-files/tally-sales-import.service.js +765 -0
  37. package/dist/excel-files/ven-balance-excel.service.js +293 -0
  38. package/dist/index.js +237 -0
  39. package/dist/services/analysis-pdf.service.js +105 -0
  40. package/dist/services/appointment-total.service.js +253 -0
  41. package/dist/services/auto-sales-receipt-pdf.service.js +539 -0
  42. package/dist/services/category-wise-item-pdf.service.js +98 -0
  43. package/dist/services/checklist-pdf.js +140 -0
  44. package/dist/services/checklists-pdf.js +124 -0
  45. package/dist/services/cn-print.service.js +211 -0
  46. package/dist/services/consultation-fee-receipt.service.js +378 -0
  47. package/dist/services/consultation-full-pdf.service.js +220 -0
  48. package/dist/services/consultation-pdf.service.js +360 -0
  49. package/dist/services/credit-note-pdf.service.js +578 -0
  50. package/dist/services/credit-note-totals.service.js +328 -0
  51. package/dist/services/cust-wise-sales-details-pdf.service.js +118 -0
  52. package/dist/services/cust-wise-sales-summary-pdf.service.js +111 -0
  53. package/dist/services/customer-balances-pdf.service.js +169 -0
  54. package/dist/services/dc-landscape-pdf.service.js +903 -0
  55. package/dist/services/dc-landscape-without-price-pdf.service.js +853 -0
  56. package/dist/services/dc-without-price-pdf.service.js +489 -0
  57. package/dist/services/debit-note-pdf.service.js +673 -0
  58. package/dist/services/debit-note-print.service.js +234 -0
  59. package/dist/services/debit-note-totals.service.js +293 -0
  60. package/dist/services/delivery-challan-pdf.service.js +434 -0
  61. package/dist/services/delivery-challan-print.service.js +177 -0
  62. package/dist/services/delivery-challan-totals.js +339 -0
  63. package/dist/services/equipment-design-pdf.service.js +144 -0
  64. package/dist/services/est.print-service.js +1053 -0
  65. package/dist/services/expiring-drugs-pdf.service.js +156 -0
  66. package/dist/services/hc-inv-pdf.service.js +837 -0
  67. package/dist/services/insurance-expire-pdf.service.js +99 -0
  68. package/dist/services/inv-pdf.service.js +785 -0
  69. package/dist/services/inv-print.service.js +415 -0
  70. package/dist/services/invoice-landscape-pdf.service.js +909 -0
  71. package/dist/services/invoice-total.service.js +659 -0
  72. package/dist/services/issue-parts-pdf.service.js +763 -0
  73. package/dist/services/item-detais-pdf.js +136 -0
  74. package/dist/services/item-wise-doctor-sale-pdf.service.js +164 -0
  75. package/dist/services/item-wise-mout-details-pdf.js +107 -0
  76. package/dist/services/item-wise-mout-summary-pdf.js +99 -0
  77. package/dist/services/item-wise-sales-pdf.service.js +178 -0
  78. package/dist/services/manf-wise-sales-pdf.service.js +173 -0
  79. package/dist/services/meeting-pdf.js +369 -0
  80. package/dist/services/mout-pdf.service.js +503 -0
  81. package/dist/services/operator-wise-details-pdf.service.js +103 -0
  82. package/dist/services/operator-wise-summary-pdf.js +101 -0
  83. package/dist/services/pack-ship-pdf.service.js +105 -0
  84. package/dist/services/pack-ship-print.service.js +167 -0
  85. package/dist/services/payment-pdf.service.js +373 -0
  86. package/dist/services/payment-report-pdf.service.js +106 -0
  87. package/dist/services/po-totals.service.js +279 -0
  88. package/dist/services/pos-receipt-pdf.js +438 -0
  89. package/dist/services/purchase-order-pdf.service.js +924 -0
  90. package/dist/services/purchase-order-print.service.js +150 -0
  91. package/dist/services/purchase-order-totals.service.js +280 -0
  92. package/dist/services/receipt-print.service.js +50 -0
  93. package/dist/services/reorder-point-pdf.service.js +151 -0
  94. package/dist/services/repair-orders-pdf.service.js +172 -0
  95. package/dist/services/ro-pdf.service.js +1764 -0
  96. package/dist/services/ro-print-service.js +737 -0
  97. package/dist/services/ro-totals.service.js +1241 -0
  98. package/dist/services/sales-by-service-pdf.service.js +116 -0
  99. package/dist/services/sales-pdf.service.js +630 -0
  100. package/dist/services/sales-print.service.js +305 -0
  101. package/dist/services/sales-receipt-pdf.service.js +611 -0
  102. package/dist/services/sales-receipt-print.service.js +425 -0
  103. package/dist/services/sales-totals.service.js +339 -0
  104. package/dist/services/scheduled-drug-pdf.service.js +176 -0
  105. package/dist/services/scheduled-drug-summary-pdf.service.js +188 -0
  106. package/dist/services/separate-wo-print.service.js +351 -0
  107. package/dist/services/shared-inv-pdf.service.js +763 -0
  108. package/dist/services/shared-pdf.service.js +2569 -0
  109. package/dist/services/shared-print.service.js +885 -0
  110. package/dist/services/task-pdf.service.js +220 -0
  111. package/dist/services/task-reports-pdf.service.js +296 -0
  112. package/dist/services/technician-pdf.service.js +238 -0
  113. package/dist/services/technician-print.service.js +87 -0
  114. package/dist/services/transfer-order-pdf.service.js +139 -0
  115. package/dist/services/vendor-balances-pdf.service.js +101 -0
  116. package/dist/services/vendor-credit-note-pdf.service.js +1007 -0
  117. package/dist/services/vendor-credit-note-print.service.js +104 -0
  118. package/dist/services/vendor-credit-note-totals.service.js +327 -0
  119. package/dist/services/vendor-debit-note-pdf.service.js +561 -0
  120. package/dist/services/vendor-debit-note-print.service.js +245 -0
  121. package/dist/services/vendor-debit-note-totals.service.js +305 -0
  122. package/dist/utils/my-date.js +652 -0
  123. package/dist/utils/tr-utils.js +354 -0
  124. package/package.json +24 -0
  125. package/tsconfig.json +109 -0
@@ -0,0 +1,360 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConsultationPDFService = void 0;
4
+ const shared_pdf_service_1 = require("./shared-pdf.service");
5
+ const date_fns_1 = require("date-fns");
6
+ const tr_utils_1 = require("../utils/tr-utils");
7
+ const my_date_1 = require("../utils/my-date");
8
+ class ConsultationPDFService {
9
+ static GetConsultationPrint(CnstData, Remarks) {
10
+ let dd = {
11
+ info: {
12
+ title: 'Consultation',
13
+ },
14
+ footer: shared_pdf_service_1.SharedPDFService.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: [35, 15, 15, 80],
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
+ { text: 'Complaints:', bold: true, marginTop: 5, fontSize: 12 },
31
+ { text: this.GetComplaints(CnstData.Comps), fontSize: 9, marginTop: 5, marginBottom: 10 },
32
+ { text: 'Diagnosis:', bold: true, marginTop: 5, fontSize: 12 },
33
+ { text: this.GetDiagnosis(CnstData.Diags), fontSize: 9, marginTop: 5, marginBottom: 10 },
34
+ { text: 'Rx:', bold: true, fontSize: 12 },
35
+ this.GetItemsTable(CnstData.Rx, Remarks),
36
+ { text: 'Lab Investigations:', bold: true, marginTop: 5, fontSize: 12 },
37
+ { text: this.GetComplaints(CnstData.Tests), fontSize: 9, marginTop: 5, marginBottom: 10 },
38
+ { text: 'Advices:', bold: true, marginTop: 5, fontSize: 12 },
39
+ { text: this.GetDiagnosis(CnstData.Advice), fontSize: 9, marginTop: 5, marginBottom: 10 },
40
+ this.CustomSection(CnstData.Sections)
41
+ // this.GetSignatures(CnstData.Entity.CName, CnstData.Type, CnstData.For),
42
+ ],
43
+ styles: {
44
+ temp2header: {
45
+ fontSize: 15,
46
+ bold: true,
47
+ alignment: 'left',
48
+ // margin: [0, 10, 0, 0],
49
+ },
50
+ headerstyle: {
51
+ fontSize: 9
52
+ },
53
+ Sign: {
54
+ fontSize: 8,
55
+ margin: [0, 30, 0, 5]
56
+ },
57
+ forCompany: {
58
+ marginRight: 5,
59
+ marginTop: 10,
60
+ fontSize: 9,
61
+ alignment: 'left'
62
+ },
63
+ tableheader: {
64
+ bold: true,
65
+ margin: [0, 1, 0, 5],
66
+ alignment: 'center'
67
+ },
68
+ tableheader1: {
69
+ bold: true,
70
+ margin: [0, 2, 0, 2],
71
+ alignment: 'center'
72
+ },
73
+ tableExample: {
74
+ fontSize: 9
75
+ },
76
+ ws_adrs_left: {
77
+ fontSize: 8,
78
+ alignment: 'left',
79
+ }
80
+ }
81
+ };
82
+ return dd;
83
+ }
84
+ static CustomSection(sections) {
85
+ let Sec = [];
86
+ sections === null || sections === void 0 ? void 0 : sections.forEach((sec) => {
87
+ var _a;
88
+ Sec.push({ text: sec.Name + ' :', bold: true, style: 'header', marginTop: 5, marginBottom: 5 });
89
+ let UnOrderlist = [];
90
+ (_a = sec.Items) === null || _a === void 0 ? void 0 : _a.forEach((item) => {
91
+ UnOrderlist.push({
92
+ style: 'tableExample',
93
+ table: {
94
+ body: [
95
+ [{ text: item.Desc, bold: true }, '-', { text: item.Notes }]
96
+ ]
97
+ },
98
+ layout: 'noBorders'
99
+ });
100
+ });
101
+ Sec.push({ ul: UnOrderlist, fontSize: 10 });
102
+ });
103
+ return Sec;
104
+ }
105
+ static GetWeight(CnstData) {
106
+ var _a, _b;
107
+ if (!tr_utils_1.TrUtils.IsNull((_a = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Vitals) === null || _a === void 0 ? void 0 : _a.Weight)) {
108
+ return { text: 'Weight :' + ((_b = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Vitals) === null || _b === void 0 ? void 0 : _b.Weight) + ' kg', Width: 80 };
109
+ }
110
+ else {
111
+ return { text: 'Weight :', Width: 80 };
112
+ }
113
+ }
114
+ static GetTemperature(CnstData) {
115
+ var _a, _b;
116
+ if (!tr_utils_1.TrUtils.IsNull((_a = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Vitals) === null || _a === void 0 ? void 0 : _a.Temp)) {
117
+ return { text: 'Temperature :' + ((_b = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Vitals) === null || _b === void 0 ? void 0 : _b.Temp) + ' F', Width: 80 };
118
+ }
119
+ else {
120
+ return { text: 'Temperature :', Width: 80 };
121
+ }
122
+ }
123
+ static GetSPO2(CnstData) {
124
+ var _a, _b;
125
+ if (!tr_utils_1.TrUtils.IsNull((_a = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Vitals) === null || _a === void 0 ? void 0 : _a.SPO2)) {
126
+ return { text: 'SPO2 :' + ((_b = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Vitals) === null || _b === void 0 ? void 0 : _b.SPO2) + ' mmHg', Width: 80 };
127
+ }
128
+ else {
129
+ return { text: 'SPO2 :', Width: 80 };
130
+ }
131
+ }
132
+ static GetPulse(CnstData) {
133
+ var _a, _b;
134
+ if (!tr_utils_1.TrUtils.IsNull((_a = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Vitals) === null || _a === void 0 ? void 0 : _a.Pulse)) {
135
+ return { text: 'Pulse :' + ((_b = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Vitals) === null || _b === void 0 ? void 0 : _b.Pulse) + ' bpm', Width: 80 };
136
+ }
137
+ else {
138
+ return { text: 'Pulse :', Width: 80 };
139
+ }
140
+ }
141
+ static GetHeight(CnstData) {
142
+ var _a, _b;
143
+ if (!tr_utils_1.TrUtils.IsNull((_a = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Vitals) === null || _a === void 0 ? void 0 : _a.Height)) {
144
+ return { text: 'Height :' + ((_b = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Vitals) === null || _b === void 0 ? void 0 : _b.Height) + ' cm', Width: 80 };
145
+ }
146
+ else {
147
+ return { text: 'Height :', Width: 80 };
148
+ }
149
+ }
150
+ static GetBP(CnstData) {
151
+ var _a, _b;
152
+ if (!tr_utils_1.TrUtils.IsNull((_a = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Vitals) === null || _a === void 0 ? void 0 : _a.BP)) {
153
+ return { text: 'BP :' + ((_b = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Vitals) === null || _b === void 0 ? void 0 : _b.BP) + ' mmHg', Width: 80 };
154
+ }
155
+ else {
156
+ return { text: 'BP :', Width: 80 };
157
+ }
158
+ }
159
+ static GetMainHeaderDetails(CnstData, Entity, HeaderName, Image, HColor, AColor, text) {
160
+ var _a;
161
+ return [
162
+ this.GetHeaderBasedOnCondition(CnstData, Entity, HeaderName, Image, HColor, AColor, text),
163
+ shared_pdf_service_1.SharedPDFService.HeaderAfterLine1(),
164
+ {
165
+ columns: [{
166
+ stack: [{ text: CnstData.Pat.Name, fontSize: 10, marginTop: 5, bold: true },
167
+ { 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 }]
168
+ },
169
+ {
170
+ stack: [
171
+ { text: this.GetCnsltDate(CnstData), style: ['headerstyle'] }
172
+ ], marginTop: 5, width: 120
173
+ }]
174
+ }
175
+ // { text: CnstData.Pat.Name, fontSize: 10, marginTop: 5 },
176
+ // { text: CnstData.Pat.Code + ' | ' + this.DifferenceInYears(CnstData.Pat.DOB) + ' | ' + CnstData.Pat.Sex + this.GetPhoneNumber(CnstData?.Pat?.Ph), fontSize: 10, marginBottom: 5 },
177
+ ];
178
+ }
179
+ static GetCnsltDate(CnstData) {
180
+ if (!tr_utils_1.TrUtils.IsNull(CnstData.ClDate)) {
181
+ return my_date_1.MyDate.GetWeekDateAndTime(CnstData.ClDate);
182
+ }
183
+ else {
184
+ return my_date_1.MyDate.GetWeekDateAndTime(CnstData.CrDate);
185
+ }
186
+ }
187
+ static GetHeaderBasedOnCondition(CnstData, Entity, HeaderName, Image, HColor, AColor, text) {
188
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
189
+ if (Entity.Header === 2) {
190
+ return {
191
+ columns: [
192
+ shared_pdf_service_1.SharedPDFService.GetConsultationMainHeader(Entity, null, AColor, HColor, text),
193
+ {
194
+ 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' },
195
+ { text: (_c = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _c === void 0 ? void 0 : _c.Intro1, fontSize: 9, alignment: 'right' },
196
+ { text: (_d = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _d === void 0 ? void 0 : _d.Intro2, fontSize: 9, alignment: 'right' },
197
+ { text: (_e = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _e === void 0 ? void 0 : _e.Intro3, fontSize: 9, alignment: 'right' },
198
+ { 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
199
+ }
200
+ ]
201
+ };
202
+ }
203
+ else {
204
+ return {
205
+ columns: [shared_pdf_service_1.SharedPDFService.GetImage(Image, Entity.PrLogo), {
206
+ 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 },
207
+ { text: (_j = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _j === void 0 ? void 0 : _j.Intro1, fontSize: 9, alignment: 'right' },
208
+ { text: (_k = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _k === void 0 ? void 0 : _k.Intro2, fontSize: 9, alignment: 'right' },
209
+ { text: (_l = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _l === void 0 ? void 0 : _l.Intro3, fontSize: 9, alignment: 'right' },
210
+ { 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
211
+ }]
212
+ };
213
+ }
214
+ }
215
+ static GetPhoneNumber(phone) {
216
+ if (!tr_utils_1.TrUtils.IsNull(phone)) {
217
+ return ' | ' + phone;
218
+ }
219
+ else {
220
+ return '';
221
+ }
222
+ }
223
+ static DifferenceInYears(DOB) {
224
+ if (tr_utils_1.TrUtils.IsNull(DOB)) {
225
+ return 'DOB Not Specified';
226
+ }
227
+ let Datei = my_date_1.MyDate.GetDateTimeNowInUTC();
228
+ const result = (0, date_fns_1.differenceInYears)(Datei, new Date(DOB));
229
+ return result + ' Years';
230
+ }
231
+ static GetDiagnosis(Diags) {
232
+ let Diagnosis = '';
233
+ Diags === null || Diags === void 0 ? void 0 : Diags.forEach((item, index) => {
234
+ Diagnosis = Diagnosis + item.Desc;
235
+ if ((index + 1) !== Diags.length) {
236
+ Diagnosis = Diagnosis + ', ';
237
+ }
238
+ });
239
+ return Diagnosis;
240
+ }
241
+ static GetComplaints(Comps) {
242
+ let Complaints = '';
243
+ Comps === null || Comps === void 0 ? void 0 : Comps.forEach((item, index) => {
244
+ Complaints = Complaints + item.Desc;
245
+ if ((index + 1) !== Comps.length) {
246
+ Complaints = Complaints + ', ';
247
+ }
248
+ });
249
+ return Complaints;
250
+ }
251
+ static GetDate(DatesDetails) {
252
+ if (DatesDetails.Date === 'CustomRange') {
253
+ return my_date_1.MyDate.GetWeekAndDate(DatesDetails.StDate) + ' - ' + my_date_1.MyDate.GetWeekAndDate(DatesDetails.EnDate);
254
+ }
255
+ else {
256
+ return 'till ' + my_date_1.MyDate.GetWeekAndDate(DatesDetails.EnDate);
257
+ }
258
+ }
259
+ static CustomerAndVehicleDetailsAfterLine() {
260
+ return {
261
+ canvas: [
262
+ {
263
+ type: 'line',
264
+ lineColor: 'gray',
265
+ x1: 0,
266
+ y1: 0,
267
+ x2: 575,
268
+ y2: 0,
269
+ lineWidth: 1
270
+ }
271
+ ]
272
+ };
273
+ }
274
+ static GetSignatures(CName, For, Type) {
275
+ return {
276
+ columns: [{
277
+ stack: [
278
+ this.CompanyName(CName),
279
+ ]
280
+ }],
281
+ };
282
+ }
283
+ static CompanyName(CName) {
284
+ return {
285
+ style: 'forCompany',
286
+ text: ['For ', { text: CName, }],
287
+ };
288
+ }
289
+ static GetItemsTable(Items, Remarks) {
290
+ if (!tr_utils_1.TrUtils.IsNull(Items)) {
291
+ return {
292
+ style: 'tableExample',
293
+ marginTop: 3,
294
+ marginBottom: 5,
295
+ table: {
296
+ widths: [20, '*', 45, 50, 200],
297
+ headerRows: 1,
298
+ body: this.BuildTableBodyForLaborAndParts(Items, Remarks)
299
+ },
300
+ layout: {
301
+ hLineWidth: function (i, node) {
302
+ return (i === 0 || i === 1 || i === node.table.body.length) ? 1 : 0.5;
303
+ },
304
+ vLineWidth: function (i, node) {
305
+ return (i === 0 || i === node.table.widths.length) ? 1 : 0.5;
306
+ },
307
+ // hLineStyle: function (i, node) {
308
+ // return (i === 0 || i === 1) ? { dash: { length: 5, space: 5 } } : null;
309
+ // },
310
+ hLineColor: function (i, node) {
311
+ return (i === 0 || i === 1 || i === node.table.body.length) ? 'gray' : 'lightgrey';
312
+ },
313
+ vLineColor: function (i, node) {
314
+ return 'gray';
315
+ },
316
+ }
317
+ };
318
+ }
319
+ else {
320
+ return {};
321
+ }
322
+ }
323
+ static BuildTableBodyForLaborAndParts(Items, Remarks) {
324
+ let body = this.GetHeaderNames();
325
+ Items === null || Items === void 0 ? void 0 : Items.forEach((item, index) => {
326
+ let dataRow = [];
327
+ dataRow.push({ text: index + 1, rowSpan: item.Dosage.length });
328
+ dataRow.push({ text: item.Desc, bold: true, rowSpan: item.Dosage.length });
329
+ item.Dosage.forEach((dose, index) => {
330
+ if (index === 0) {
331
+ dataRow.push({ text: dose.Dose, alignment: 'left', style: ['headerstyle'], });
332
+ dataRow.push({ text: dose.Dur, alignment: 'left', style: ['headerstyle'], });
333
+ dataRow.push({ text: Remarks[dose.Dose], alignment: 'left', style: ['headerstyle'], });
334
+ body.push(dataRow);
335
+ }
336
+ else {
337
+ let dataRow1 = [];
338
+ dataRow1.push({ text: dose.Dose, alignment: 'left', style: ['headerstyle'], });
339
+ dataRow1.push({ text: dose.Dur, alignment: 'left', style: ['headerstyle'], });
340
+ dataRow1.push({ text: dose.Dose, alignment: 'left', style: ['headerstyle'], });
341
+ dataRow1.push({ text: dose.Dur, alignment: 'left', style: ['headerstyle'], });
342
+ dataRow1.push({ text: Remarks[dose.Dose], alignment: 'left', style: ['headerstyle'], fontFamily: 'telugu' });
343
+ body.push(dataRow1);
344
+ }
345
+ });
346
+ });
347
+ return body;
348
+ }
349
+ static GetHeaderNames() {
350
+ let HeadingNames;
351
+ HeadingNames = [[{ text: 'SNo', style: 'tableheader1', Field: 'SNo', alignment: 'left', line: true },
352
+ { text: 'Medicine', style: 'tableheader1', Field: 'Name', alignment: 'left', line: true },
353
+ { text: 'Dosage', style: 'tableheader1', Field: 'Dosage', alignment: 'left' },
354
+ { text: 'Duration', style: 'tableheader1', Field: 'Freq', alignment: 'left' },
355
+ { text: 'Remarks', style: 'tableheader1', Field: 'Freq', alignment: 'left' },
356
+ ]];
357
+ return HeadingNames;
358
+ }
359
+ }
360
+ exports.ConsultationPDFService = ConsultationPDFService;