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,378 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConsultationFeeReceiptPrintService = void 0;
4
+ const date_fns_1 = require("date-fns");
5
+ const my_date_1 = require("../utils/my-date");
6
+ const tr_utils_1 = require("../utils/tr-utils");
7
+ const shared_pdf_service_1 = require("./shared-pdf.service");
8
+ class ConsultationFeeReceiptPrintService {
9
+ static GetPrint(consultationData) {
10
+ if (tr_utils_1.TrUtils.IsNull(consultationData.Name)) {
11
+ consultationData.Name = '';
12
+ }
13
+ let dd = {
14
+ info: {
15
+ title: 'Consultation',
16
+ },
17
+ footer: this.FooterContent(consultationData),
18
+ header: function (currentPage, pageCount, pageSize) {
19
+ return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', marginRight: 25, fontSize: 8, marginTop: 2 };
20
+ },
21
+ pageMargins: [35, 15, 15, 435.945],
22
+ pageSize: 'A4',
23
+ content: [
24
+ this.GetMainHeaderDetails(consultationData, consultationData.Entity, consultationData.HeaderName, consultationData.Image, consultationData.HColor, consultationData.AColor, null),
25
+ this.GetItemsTable(consultationData.Items, consultationData.ShowTaxColumn),
26
+ {
27
+ columns: [{ text: '', width: '*' }, { text: this.finalReturnTotal(consultationData), width: '*', bold: true, fontSize: 10, alignment: 'center' },
28
+ this.GetTotalDeetails(consultationData)]
29
+ },
30
+ ],
31
+ styles: {
32
+ headerstyle: {
33
+ fontFamily: 'Calibri',
34
+ fontSize: 9
35
+ },
36
+ Sign: {
37
+ fontSize: 8,
38
+ margin: [0, 30, 0, 5]
39
+ },
40
+ forCompany: {
41
+ // margin: [0, 10, 30, 0],
42
+ marginRight: 5,
43
+ marginTop: 10,
44
+ fontSize: 9,
45
+ alignment: 'left'
46
+ },
47
+ tableheader: {
48
+ bold: true,
49
+ fontFamily: 'Calibri',
50
+ margin: [0, 1, 0, 5],
51
+ alignment: 'center'
52
+ },
53
+ tableheader1: {
54
+ bold: true,
55
+ fontFamily: 'Calibri',
56
+ margin: [0, 2, 0, 2],
57
+ alignment: 'center'
58
+ },
59
+ tableExample: {
60
+ fontSize: 9
61
+ }, ws_adrs_left: {
62
+ fontSize: 8,
63
+ alignment: 'left',
64
+ }
65
+ }
66
+ };
67
+ return dd;
68
+ }
69
+ static FooterContent(consultationData) {
70
+ var _a;
71
+ if (consultationData.Entity.Header === 2) {
72
+ return {
73
+ table: {
74
+ widths: ['auto'],
75
+ body: [
76
+ [{
77
+ text: consultationData.Entity.FootText, alignment: 'center', fontSize: 9
78
+ }]
79
+ ]
80
+ }, margin: [25, -50, 25, 10]
81
+ };
82
+ }
83
+ else {
84
+ return {
85
+ stack: [{ text: (_a = consultationData.Doc) === null || _a === void 0 ? void 0 : _a.Name, bold: true, alignment: 'right', marginBottom: 5 }, shared_pdf_service_1.SharedPDFService.HeaderAfterLine1(), { columns: [shared_pdf_service_1.SharedPDFService.GetEntityAddress(consultationData.Entity)] }],
86
+ margin: [25, -50, 25, 10]
87
+ };
88
+ }
89
+ }
90
+ static GetMainHeaderDetails(CnstData, Entity, HeaderName, Image, HColor, AColor, text) {
91
+ var _a;
92
+ return [
93
+ this.GetHeaderBasedOnCondition(CnstData, Entity, HeaderName, Image, HColor, AColor, text),
94
+ shared_pdf_service_1.SharedPDFService.HeaderAfterLine1(),
95
+ {
96
+ columns: [{
97
+ stack: [{ text: CnstData.Pat.Name, fontSize: 10, marginTop: 5 },
98
+ { 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 }]
99
+ },
100
+ {
101
+ stack: [{ text: 'Bill No : ' + CnstData.Code, style: ['headerstyle'] },
102
+ { text: 'Date : ' + my_date_1.MyDate.ConvertUTCDateToReadable(CnstData.CrDate), style: ['headerstyle'] }], marginTop: 5, width: 120
103
+ }]
104
+ }
105
+ ];
106
+ }
107
+ static GetHeaderBasedOnCondition(CnstData, Entity, HeaderName, Image, HColor, AColor, text) {
108
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
109
+ if (Entity.Header === 2) {
110
+ return {
111
+ columns: [
112
+ shared_pdf_service_1.SharedPDFService.GetConsultationMainHeader(Entity, null, AColor, HColor, text), { stack: [{ text: (_a = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _a === void 0 ? void 0 : _a.Name, fontSize: 12, bold: true, alignment: 'right' },
113
+ { text: (_b = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _b === void 0 ? void 0 : _b.Intro1, fontSize: 9, alignment: 'right' },
114
+ { text: (_c = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _c === void 0 ? void 0 : _c.Intro2, fontSize: 9, alignment: 'right' },
115
+ { text: (_d = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _d === void 0 ? void 0 : _d.Intro3, fontSize: 9, alignment: 'right' },
116
+ { text: 'Registration ID- ' + ((_e = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _e === void 0 ? void 0 : _e.CounReg), fontSize: 9, alignment: 'right', marginBottom: 5 }], width: '40%' }
117
+ ]
118
+ };
119
+ }
120
+ else {
121
+ return { columns: [shared_pdf_service_1.SharedPDFService.GetImage(Image, Entity.PrLogo), { stack: [{ text: (_f = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _f === void 0 ? void 0 : _f.Name, fontSize: 12, bold: true, alignment: 'right' },
122
+ { text: (_g = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _g === void 0 ? void 0 : _g.Intro1, fontSize: 9, alignment: 'right' },
123
+ { text: (_h = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _h === void 0 ? void 0 : _h.Intro2, fontSize: 9, alignment: 'right' },
124
+ { text: (_j = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _j === void 0 ? void 0 : _j.Intro3, fontSize: 9, alignment: 'right' },
125
+ { text: 'Registration ID- ' + ((_k = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _k === void 0 ? void 0 : _k.CounReg), fontSize: 9, alignment: 'right', marginBottom: 5 }], width: '40%' }] };
126
+ }
127
+ }
128
+ static GetPhoneNumber(phone) {
129
+ if (!tr_utils_1.TrUtils.IsNull(phone)) {
130
+ return ' | ' + phone;
131
+ }
132
+ else {
133
+ return '';
134
+ }
135
+ }
136
+ static getDoctorName(DocName) {
137
+ if (!tr_utils_1.TrUtils.IsNull(DocName)) {
138
+ return DocName;
139
+ }
140
+ else {
141
+ return '';
142
+ }
143
+ }
144
+ static GetPhone(Phone) {
145
+ if (tr_utils_1.TrUtils.IsNull(Phone)) {
146
+ return '';
147
+ }
148
+ else {
149
+ return Phone;
150
+ }
151
+ }
152
+ static DifferenceInYears(DOB) {
153
+ if (tr_utils_1.TrUtils.IsNull(DOB)) {
154
+ return 'DOB Not Specified';
155
+ }
156
+ const result = (0, date_fns_1.differenceInYears)(my_date_1.MyDate.GetDateTimeNowInUTC(), new Date(DOB));
157
+ return result + ' Years';
158
+ }
159
+ static HeaderLayOut() {
160
+ return {
161
+ hLineWidth: function (i, node) {
162
+ return (i === 0 || i === 1 || i === node.table.body.length) ? 1 : 0;
163
+ },
164
+ vLineWidth: function (i, node) {
165
+ return (i === 0 || i === node.table.widths.length) ? 1 : 0;
166
+ },
167
+ hLineColor: function (i, node) {
168
+ return 'gray';
169
+ },
170
+ vLineColor: function (i, node) {
171
+ return 'gray';
172
+ },
173
+ };
174
+ }
175
+ static GetHeaderInfo(consultationData) {
176
+ let TaxInfo = [];
177
+ if (!tr_utils_1.TrUtils.IsEmpty(consultationData.Entity.GSTIN)) {
178
+ TaxInfo.push({ text: 'GSTIN : ' + consultationData.Entity.GSTIN, marginTop: 2, marginLeft: 5, alignment: 'left', fontSize: 9, width: 'auto' });
179
+ }
180
+ if (!tr_utils_1.TrUtils.IsEmpty(consultationData.Entity.DLNo)) {
181
+ TaxInfo.push({ text: 'D.L.NO : ' + consultationData.Entity.DLNo, marginTop: 2, marginLeft: 5, alignment: 'left', fontSize: 9, width: '*' });
182
+ }
183
+ TaxInfo.push(this.GetBillofSupplyName(consultationData.Settings));
184
+ return TaxInfo;
185
+ }
186
+ static finalReturnTotal(consultationData) {
187
+ // if (!TrUtils.IsFixedZero(consultationData.CustRetRoundedTotal)) {
188
+ // return 'Returns Total : ' + consultationData.CustRetRoundedTotal
189
+ // } else {
190
+ return '';
191
+ // }
192
+ }
193
+ static GetTotalDeetails(consultationData) {
194
+ let TotalData = [];
195
+ TotalData.push({ name: 'Total', value: 500 });
196
+ return {
197
+ style: ['columnheader', 'TotalsStyles'],
198
+ lineHeight: 0.7,
199
+ marginBottom: 5,
200
+ width: 'auto',
201
+ table: {
202
+ body: this.GrandTotalTable(TotalData)
203
+ },
204
+ layout: 'noBorders'
205
+ };
206
+ }
207
+ static GrandTotalTable(data) {
208
+ var body = [];
209
+ data.forEach((row) => {
210
+ if (!tr_utils_1.TrUtils.IsFixedZero(row.value) || row.name === 'Total') {
211
+ var dataRow = [];
212
+ dataRow.push({ text: (row.name).toString(), noWrap: true, bold: true, style: ['headerstyle'], fontSize: 10 });
213
+ dataRow.push({ text: ':', style: ['headerstyle'], bold: true, fontSize: 10 });
214
+ if (!tr_utils_1.TrUtils.IsNull(row.value)) {
215
+ dataRow.push({ text: (row.value).toString(), noWrap: true, alignment: 'right', bold: true, style: ['headerstyle'], fontSize: 10, marginRight: 5 });
216
+ }
217
+ else {
218
+ dataRow.push({ text: '', noWrap: true, alignment: 'right', style: ['headerstyle'] });
219
+ }
220
+ body.push(dataRow);
221
+ }
222
+ });
223
+ return body;
224
+ }
225
+ static GetBillofSupplyName(Settings) {
226
+ return { text: (Settings === null || Settings === void 0 ? void 0 : Settings.Tax) === 'BS' ? 'Bill of Supply' : null, alignment: 'right', marginRight: 5, marginTop: 2, marginBottom: 3, fontSize: 9, width: 'auto' };
227
+ }
228
+ static GetDiscountOverall(consultationData) {
229
+ let OveralDisc = tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(consultationData.Disc)) +
230
+ tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(consultationData.CustPartsDiscTotal));
231
+ return tr_utils_1.TrUtils.FixPriceValue(OveralDisc);
232
+ }
233
+ static CustomerAndVehicleDetailsAfterLine(size) {
234
+ let length = 575;
235
+ if (size === 'A3') {
236
+ length = 820;
237
+ }
238
+ else if (size === 'Custom') {
239
+ length = 575;
240
+ }
241
+ return {
242
+ canvas: [
243
+ {
244
+ type: 'line',
245
+ lineColor: 'gray',
246
+ x1: 0,
247
+ y1: 0,
248
+ x2: 540,
249
+ y2: 0,
250
+ lineWidth: 1
251
+ }
252
+ ]
253
+ };
254
+ }
255
+ static GetSignatures(CName, For, Type) {
256
+ return {
257
+ columns: [{
258
+ stack: [
259
+ this.CompanyName(CName),
260
+ // { columns: [this.Authorizedsignature(), this.SurveyorSignature(For, Type), this.CustomerSignature()] }
261
+ ]
262
+ }],
263
+ };
264
+ }
265
+ static CompanyName(CName) {
266
+ return {
267
+ style: 'forCompany',
268
+ text: ['For ', { text: CName, }],
269
+ };
270
+ }
271
+ static Authorizedsignature() {
272
+ return {
273
+ style: 'Sign',
274
+ text: ['Authorized Signatory'],
275
+ };
276
+ }
277
+ static CustomerSignature() {
278
+ return {
279
+ style: 'Sign',
280
+ text: ['Customer Signature'], marginLeft: 90
281
+ };
282
+ }
283
+ static GetItemsTable(Items, ShowTaxColumn) {
284
+ return {
285
+ style: 'tableExample',
286
+ marginTop: 3,
287
+ marginBottom: 5,
288
+ table: {
289
+ widths: this.GetWidths(ShowTaxColumn),
290
+ headerRows: 1,
291
+ body: this.BuildTableBodyForLaborAndParts(Items, ShowTaxColumn)
292
+ },
293
+ layout: {
294
+ hLineWidth: function (i, node) {
295
+ return (i === 0 || i === 1 || (i === 20) || i === node.table.body.length) ? 1 : 0;
296
+ },
297
+ vLineWidth: function (i, node) {
298
+ return (i === 0 || i === node.table.widths.length) ? 1 : 0.5;
299
+ },
300
+ // hLineStyle: function (i, node) {
301
+ // return (i === 0 || i === 1) ? { dash: { length: 5, space: 5 } } : null;
302
+ // },
303
+ hLineColor: function (i, node) {
304
+ return 'gray';
305
+ },
306
+ vLineColor: function (i, node) {
307
+ return 'gray';
308
+ },
309
+ }
310
+ };
311
+ }
312
+ static GetWidths(ShowTaxColumn) {
313
+ // if (ShowTaxColumn) {
314
+ return [25, '*', 50, 60, 60, 70, 60];
315
+ // } else {
316
+ // return ['*', 100, 50, 20, 50, 50];
317
+ // }
318
+ }
319
+ static GetAddress(Entity) {
320
+ let Addres = Entity.Adrs1;
321
+ if (!tr_utils_1.TrUtils.IsEmpty(Entity.Adrs2)) {
322
+ Addres = Addres + ',' + Entity.Adrs2;
323
+ }
324
+ Addres = Addres + ',' + Entity.City + shared_pdf_service_1.SharedPDFService.getPinCode(Entity.PIN);
325
+ return {
326
+ style: 'tableExample',
327
+ table: {
328
+ widths: ['auto', '*'],
329
+ body: [
330
+ [{ text: 'Address -', bold: true }, { text: Addres }],
331
+ [{ text: 'For Appointments' }, { text: 'Call: ' + Entity.Phone + ', ' + shared_pdf_service_1.SharedPDFService.GetEmail(Entity.Email) }],
332
+ ]
333
+ }, layout: 'noBorders',
334
+ };
335
+ }
336
+ static GetPINCode(PIN) {
337
+ if (tr_utils_1.TrUtils.IsNull(PIN)) {
338
+ return '';
339
+ }
340
+ else {
341
+ return '-' + PIN;
342
+ }
343
+ }
344
+ static BuildTableBodyForLaborAndParts(Items, ShowTaxColumn) {
345
+ let body = this.GetHeaderNames(ShowTaxColumn);
346
+ let dataRow = [];
347
+ dataRow.push({ text: '1', });
348
+ dataRow.push({ text: 'Doctor', });
349
+ dataRow.push({ text: '43423423', });
350
+ dataRow.push({ text: '1', alignment: 'right' });
351
+ dataRow.push({ text: '500', alignment: 'right' });
352
+ dataRow.push({ text: '', alignment: 'right' });
353
+ dataRow.push({ text: '500', alignment: 'right' });
354
+ body.push(dataRow);
355
+ return body;
356
+ }
357
+ static GetHeaderNames(ShowTaxColumn) {
358
+ let HeadingNames;
359
+ // if (ShowTaxColumn) {
360
+ HeadingNames = [[{ text: 'S.No', style: 'tableheader1', Field: 'SNo', alignment: 'left', line: true },
361
+ { text: 'Services', style: 'tableheader1', Field: 'Doctor' },
362
+ { text: 'SAC', style: 'tableheader1', Field: 'SAC' },
363
+ { text: 'Qty', style: 'tableheader1', Field: 'Qty', alignment: 'right' },
364
+ { text: 'Price', style: 'tableheader1', Field: 'UnPr', alignment: 'right' },
365
+ { text: 'Discount', style: 'tableheader1', Field: 'Disc' },
366
+ { text: 'Amount', style: 'tableheader1', Field: 'Amount', alignment: 'right' }]];
367
+ // } else {
368
+ // HeadingNames = [[{ text: 'Description', style: 'tableheader1', Field: 'Desc', alignment: 'left', line: true },
369
+ // { text: 'Batches', style: 'tableheader1', Field: 'Batches', alignment: 'left' },
370
+ // { text: 'Ex.Dt', style: 'tableheader1', Field: 'ExDate', alignment: 'left' },
371
+ // { text: 'Qty', style: 'tableheader1', Field: 'Qty', alignment: 'right' },
372
+ // { text: 'Price', style: 'tableheader1', Field: 'UnPr', alignment: 'right' },
373
+ // { text: 'Line Total', style: 'tableheader1', Field: 'LineTotal', alignment: 'right' }]];
374
+ // }
375
+ return HeadingNames;
376
+ }
377
+ }
378
+ exports.ConsultationFeeReceiptPrintService = ConsultationFeeReceiptPrintService;
@@ -0,0 +1,220 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConsultationFullPrintService = void 0;
4
+ const date_fns_1 = require("date-fns");
5
+ const my_date_1 = require("../utils/my-date");
6
+ const tr_utils_1 = require("../utils/tr-utils");
7
+ const shared_pdf_service_1 = require("./shared-pdf.service");
8
+ class ConsultationFullPrintService {
9
+ static GetPrint(consultationData) {
10
+ if (tr_utils_1.TrUtils.IsNull(consultationData.Name)) {
11
+ consultationData.Name = '';
12
+ }
13
+ let dd = {
14
+ info: {
15
+ title: 'Consultation',
16
+ },
17
+ footer: shared_pdf_service_1.SharedPDFService.FooterContent(consultationData),
18
+ header: function (currentPage, pageCount, pageSize) {
19
+ return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', marginRight: 25, fontSize: 8, marginTop: 2 };
20
+ },
21
+ pageMargins: [35, 15, 15, 80],
22
+ pageSize: 'A4',
23
+ content: [
24
+ this.GetMainHeaderDetails(consultationData, consultationData.Entity, consultationData.HeaderName, consultationData.Image, consultationData.HColor, consultationData.AColor, null),
25
+ ],
26
+ styles: {
27
+ temp2header: {
28
+ fontSize: 15,
29
+ bold: true,
30
+ alignment: 'left',
31
+ // margin: [0, 10, 0, 0],
32
+ },
33
+ headerstyle: {
34
+ fontFamily: 'Calibri',
35
+ fontSize: 9
36
+ },
37
+ Sign: {
38
+ fontSize: 8,
39
+ margin: [0, 30, 0, 5]
40
+ },
41
+ forCompany: {
42
+ // margin: [0, 10, 30, 0],
43
+ marginRight: 5,
44
+ marginTop: 10,
45
+ fontSize: 9,
46
+ alignment: 'left'
47
+ },
48
+ tableheader: {
49
+ bold: true,
50
+ fontFamily: 'Calibri',
51
+ margin: [0, 1, 0, 5],
52
+ alignment: 'center'
53
+ },
54
+ tableheader1: {
55
+ bold: true,
56
+ fontFamily: 'Calibri',
57
+ margin: [0, 2, 0, 2],
58
+ alignment: 'center'
59
+ },
60
+ tableExample: {
61
+ fontSize: 9
62
+ },
63
+ ws_adrs_left: {
64
+ fontSize: 8,
65
+ alignment: 'left',
66
+ }
67
+ }
68
+ };
69
+ return dd;
70
+ }
71
+ static GetMainHeaderDetails(CnstData, Entity, HeaderName, Image, HColor, AColor, text) {
72
+ var _a;
73
+ return [
74
+ this.GetHeaderBasedOnCondition(CnstData, Entity, HeaderName, Image, HColor, AColor, text),
75
+ shared_pdf_service_1.SharedPDFService.HeaderAfterLine1(),
76
+ {
77
+ columns: [{
78
+ stack: [{ text: CnstData.Pat.Name, fontSize: 10, marginTop: 5, bold: true },
79
+ { 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 }]
80
+ },
81
+ {
82
+ stack: [
83
+ { text: this.GetCnsltDate(CnstData), style: ['headerstyle'] }
84
+ ], marginTop: 5, width: 120
85
+ }]
86
+ }
87
+ ];
88
+ }
89
+ static GetCnsltDate(CnstData) {
90
+ if (!tr_utils_1.TrUtils.IsNull(CnstData.ClDate)) {
91
+ return my_date_1.MyDate.GetWeekDateAndTime(CnstData.ClDate);
92
+ }
93
+ else {
94
+ return my_date_1.MyDate.GetWeekDateAndTime(CnstData.CrDate);
95
+ }
96
+ }
97
+ static GetHeaderBasedOnCondition(CnstData, Entity, HeaderName, Image, HColor, AColor, text) {
98
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
99
+ if (Entity.Header === 2) {
100
+ return {
101
+ columns: [
102
+ shared_pdf_service_1.SharedPDFService.GetConsultationMainHeader(Entity, null, AColor, HColor, text),
103
+ { 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' },
104
+ { text: (_c = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _c === void 0 ? void 0 : _c.Intro1, fontSize: 9, alignment: 'right' },
105
+ { text: (_d = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _d === void 0 ? void 0 : _d.Intro2, fontSize: 9, alignment: 'right' },
106
+ { text: (_e = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _e === void 0 ? void 0 : _e.Intro3, fontSize: 9, alignment: 'right' },
107
+ { 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 }
108
+ ]
109
+ };
110
+ }
111
+ else {
112
+ return { columns: [shared_pdf_service_1.SharedPDFService.GetImage(Image, Entity.PrLogo), { 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, bold: true, alignment: 'right' },
113
+ { text: (_j = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _j === void 0 ? void 0 : _j.Intro1, fontSize: 9, alignment: 'right' },
114
+ { text: (_k = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _k === void 0 ? void 0 : _k.Intro2, fontSize: 9, alignment: 'right' },
115
+ { text: (_l = CnstData === null || CnstData === void 0 ? void 0 : CnstData.Doc) === null || _l === void 0 ? void 0 : _l.Intro3, fontSize: 9, alignment: 'right' },
116
+ { 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 }
117
+ ] };
118
+ }
119
+ }
120
+ static GetPhoneNumber(phone) {
121
+ if (!tr_utils_1.TrUtils.IsNull(phone)) {
122
+ return ' | ' + phone;
123
+ }
124
+ else {
125
+ return '';
126
+ }
127
+ }
128
+ static getDoctorName(DocName) {
129
+ if (!tr_utils_1.TrUtils.IsNull(DocName)) {
130
+ return DocName;
131
+ }
132
+ else {
133
+ return '';
134
+ }
135
+ }
136
+ static GetPhone(Phone) {
137
+ if (tr_utils_1.TrUtils.IsNull(Phone)) {
138
+ return '';
139
+ }
140
+ else {
141
+ return Phone;
142
+ }
143
+ }
144
+ static DifferenceInYears(DOB) {
145
+ if (tr_utils_1.TrUtils.IsNull(DOB)) {
146
+ return 'DOB Not Specified';
147
+ }
148
+ const result = (0, date_fns_1.differenceInYears)(my_date_1.MyDate.GetDateTimeNowInUTC(), new Date(DOB));
149
+ return result + ' Years';
150
+ }
151
+ static HeaderLayOut() {
152
+ return {
153
+ hLineWidth: function (i, node) {
154
+ return (i === 0 || i === 1 || i === node.table.body.length) ? 1 : 0;
155
+ },
156
+ vLineWidth: function (i, node) {
157
+ return (i === 0 || i === node.table.widths.length) ? 1 : 0;
158
+ },
159
+ // hLineStyle: function (i, node) {
160
+ // return (i === 0 || i === 1) ? { dash: { length: 5, space: 5 } } : null;
161
+ // },
162
+ hLineColor: function (i, node) {
163
+ return 'gray';
164
+ },
165
+ vLineColor: function (i, node) {
166
+ return 'gray';
167
+ },
168
+ };
169
+ }
170
+ static GetHeaderInfo(consultationData) {
171
+ let TaxInfo = [];
172
+ if (!tr_utils_1.TrUtils.IsEmpty(consultationData.Entity.GSTIN)) {
173
+ TaxInfo.push({ text: 'GSTIN : ' + consultationData.Entity.GSTIN, marginTop: 2, marginLeft: 5, alignment: 'left', fontSize: 9, width: 'auto' });
174
+ }
175
+ if (!tr_utils_1.TrUtils.IsEmpty(consultationData.Entity.DLNo)) {
176
+ TaxInfo.push({ text: 'D.L.NO : ' + consultationData.Entity.DLNo, marginTop: 2, marginLeft: 5, alignment: 'left', fontSize: 9, width: '*' });
177
+ }
178
+ TaxInfo.push(this.GetBillofSupplyName(consultationData.Settings));
179
+ return TaxInfo;
180
+ }
181
+ static finalReturnTotal(consultationData) {
182
+ // if (!TrUtils.IsFixedZero(consultationData.CustRetRoundedTotal)) {
183
+ // return 'Returns Total : ' + consultationData.CustRetRoundedTotal
184
+ // } else {
185
+ return '';
186
+ // }
187
+ }
188
+ static GetBillofSupplyName(Settings) {
189
+ return { text: (Settings === null || Settings === void 0 ? void 0 : Settings.Tax) === 'BS' ? 'Bill of Supply' : null, alignment: 'right', marginRight: 5, marginTop: 2, marginBottom: 3, fontSize: 9, width: 'auto' };
190
+ }
191
+ static GetSignatures(CName, For, Type) {
192
+ return {
193
+ columns: [{
194
+ stack: [
195
+ this.CompanyName(CName),
196
+ // { columns: [this.Authorizedsignature(), this.SurveyorSignature(For, Type), this.CustomerSignature()] }
197
+ ]
198
+ }],
199
+ };
200
+ }
201
+ static CompanyName(CName) {
202
+ return {
203
+ style: 'forCompany',
204
+ text: ['For ', { text: CName, }],
205
+ };
206
+ }
207
+ static Authorizedsignature() {
208
+ return {
209
+ style: 'Sign',
210
+ text: ['Authorized Signatory'],
211
+ };
212
+ }
213
+ static CustomerSignature() {
214
+ return {
215
+ style: 'Sign',
216
+ text: ['Customer Signature'], marginLeft: 90
217
+ };
218
+ }
219
+ }
220
+ exports.ConsultationFullPrintService = ConsultationFullPrintService;