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,503 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MaterialOutprintService = void 0;
4
+ const tr_utils_1 = require("../utils/tr-utils");
5
+ const shared_pdf_service_1 = require("./shared-pdf.service");
6
+ const shared_print_service_1 = require("./shared-print.service");
7
+ class MaterialOutprintService {
8
+ static MaterialOutPDF(MOutPrintData) {
9
+ let dd = {
10
+ info: {
11
+ title: this.GetFileName(MOutPrintData),
12
+ },
13
+ background: function (currentPage, pageSize) {
14
+ return shared_pdf_service_1.SharedPDFService.GetWatermarkImage(MOutPrintData.Image, pageSize, MOutPrintData.Entity.Wmark);
15
+ },
16
+ header: function (currentPage, pageCount) {
17
+ return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', marginRight: 7, fontSize: 8, marginTop: 2 };
18
+ },
19
+ pageMargins: [10, 15, 10, 15],
20
+ content: [
21
+ // SharedPDFService.MainHeading(MOutPrintData.Entity.CName, MOutPrintData.Entity.Header, MOutPrintData.Image, MOutPrintData.HColor, null),
22
+ shared_pdf_service_1.SharedPDFService.GetMainHeader(MOutPrintData.Entity, MOutPrintData.Image, MOutPrintData.AColor, MOutPrintData.HColor, null),
23
+ shared_pdf_service_1.SharedPDFService.GetPrintType(MOutPrintData.HeaderName),
24
+ shared_pdf_service_1.SharedPDFService.HeaderAfterLine(),
25
+ this.GetVendorDetails(MOutPrintData),
26
+ this.VendorDetailsAfterLine(),
27
+ this.GetDisplayTable(),
28
+ this.getPartsData(MOutPrintData),
29
+ // SharedPDFService.GetUnderLine(),
30
+ // SharedPDFService.GetTemsAndConditions(MOutPrintData.Entity.Terms),
31
+ shared_pdf_service_1.SharedPDFService.GetUnderLine(),
32
+ this.GetSignatures(MOutPrintData.Entity.CName),
33
+ ],
34
+ styles: this.GetStyles()
35
+ };
36
+ return dd;
37
+ }
38
+ static GetFileName(MOutPrintData) {
39
+ let fileName = MOutPrintData.HeaderName;
40
+ return fileName;
41
+ }
42
+ static GetDisplayTable() {
43
+ return { text: '', fontSize: 10, bold: true, margin: [0, 0, 0, 5] };
44
+ }
45
+ static GetStyles() {
46
+ return {
47
+ temp2header: {
48
+ fontSize: 23,
49
+ bold: true,
50
+ alignment: 'left',
51
+ // margin: [0, 10, 0, 0],
52
+ },
53
+ header: {
54
+ fontSize: 26,
55
+ bold: true,
56
+ alignment: 'center',
57
+ // margin: [0, 10, 0, 0],
58
+ },
59
+ Cust_Adrs: {
60
+ fontSize: this.MediumFont,
61
+ lineHeight: 1.2,
62
+ },
63
+ WSHeader_Left: {
64
+ fontSize: 23,
65
+ bold: true,
66
+ alignment: 'left',
67
+ // margin: [0, 10, 0, 0],
68
+ },
69
+ WSHeader_Center: {
70
+ fontSize: 26,
71
+ bold: true,
72
+ alignment: 'center',
73
+ // margin: [0, 10, 0, 0],
74
+ },
75
+ ws_adrs_center: {
76
+ fontSize: this.MediumFont,
77
+ alignment: 'center',
78
+ },
79
+ ws_adrs_left: {
80
+ fontSize: this.MediumFont,
81
+ alignment: 'left',
82
+ },
83
+ table_data: {
84
+ margin: [0, 0.5, 0, 5],
85
+ fontSize: this.MediumFont
86
+ },
87
+ table_header: {
88
+ bold: true,
89
+ fontSize: this.LargeFont,
90
+ margin: [0, 1, 0, 5],
91
+ alignment: 'center'
92
+ },
93
+ vendor_font: {
94
+ fontSize: this.MediumFont,
95
+ margin: [0, 5, 0, 5],
96
+ },
97
+ PO_Status: {
98
+ fontSize: this.MediumFont,
99
+ lineHeight: 1.4,
100
+ margin: [10, 0, 0, 0],
101
+ },
102
+ po_status_font: {
103
+ fontSize: this.LargeFont,
104
+ // bold: true
105
+ },
106
+ totals_Styles: {
107
+ marginTop: 15,
108
+ lineHeight: 1.4,
109
+ fontSize: this.MediumFont,
110
+ margin: [15, 0, 0, 0],
111
+ },
112
+ total_margin: {
113
+ margin: [0, 5, 0, 0],
114
+ },
115
+ hed: {
116
+ fontSize: this.LargeFont,
117
+ bold: true
118
+ },
119
+ Receiptheader1: {
120
+ fontSize: 12,
121
+ bold: true,
122
+ alignment: 'center',
123
+ margin: [0, 0, 0, 3]
124
+ },
125
+ };
126
+ }
127
+ static MainHeading(CName, Header, Image, HColor, AColor) {
128
+ let headerstyle;
129
+ let MainHeaderStyle = this.GetMainHeaderStyleForLeftAlignHeader(CName);
130
+ if (Header === 1) {
131
+ headerstyle = 'WSHeader_Center';
132
+ }
133
+ else {
134
+ headerstyle = 'WSHeader_Left';
135
+ }
136
+ return [{ text: '' + CName + '', style: [headerstyle, MainHeaderStyle] }];
137
+ }
138
+ static GetMainHeaderStyleForLeftAlignHeader(WorkShopName) {
139
+ var wsname_fontSize;
140
+ if (tr_utils_1.TrUtils.IsNull(WorkShopName)) {
141
+ WorkShopName = '';
142
+ }
143
+ switch (true) {
144
+ case (WorkShopName.length < 30):
145
+ wsname_fontSize = 23;
146
+ break;
147
+ case (WorkShopName.length < 35):
148
+ wsname_fontSize = 20;
149
+ break;
150
+ case (WorkShopName.length < 50):
151
+ wsname_fontSize = 17;
152
+ break;
153
+ default:
154
+ wsname_fontSize = 14;
155
+ }
156
+ var WSHeaderFontSize = {
157
+ fontSize: wsname_fontSize,
158
+ bold: true,
159
+ };
160
+ return WSHeaderFontSize;
161
+ }
162
+ static GetHeader(Entity) {
163
+ let headerstyle;
164
+ if (Entity.Header === 1) {
165
+ headerstyle = 'ws_adrs_center';
166
+ }
167
+ else {
168
+ headerstyle = 'ws_adrs_left';
169
+ }
170
+ let SubHeader = [
171
+ { text: '' + Entity.Adrs1 + '', style: [headerstyle] },
172
+ { text: '' + Entity.City + this.GetPinCode(Entity.PIN) + ', ' + 'Ph: ' + Entity.Phone, style: headerstyle },
173
+ { text: '' + this.GetEmailName(Entity.Email) + '', style: headerstyle }
174
+ ];
175
+ if (!tr_utils_1.TrUtils.IsEmpty(Entity.Adrs2)) {
176
+ SubHeader.splice(1, 0, { text: '' + Entity.Adrs2 + '', style: [headerstyle] });
177
+ }
178
+ if (!tr_utils_1.TrUtils.IsEmpty(Entity.TLine)) {
179
+ SubHeader.unshift({ text: this.GetTagLine(Entity.TLine), fontSize: 10, bold: true, margin: [0, 0, 0, 2] });
180
+ }
181
+ return SubHeader;
182
+ }
183
+ static GetEntityDetails(Entity) {
184
+ return {
185
+ lineHeight: 0.7,
186
+ columns: [this.GetEntityTaxDetails(Entity)
187
+ ]
188
+ };
189
+ }
190
+ static GetTagLine(TLine) {
191
+ if (tr_utils_1.TrUtils.IsEmpty(TLine)) {
192
+ TLine = '';
193
+ }
194
+ return TLine;
195
+ }
196
+ static GetEmailName(email) {
197
+ let Email = '';
198
+ if (!tr_utils_1.TrUtils.IsNull(email)) {
199
+ Email = 'Email: ' + email;
200
+ }
201
+ return Email;
202
+ }
203
+ static GetPinCode(pin) {
204
+ let code = '';
205
+ if (!tr_utils_1.TrUtils.IsNull(pin)) {
206
+ code = ' - ' + pin;
207
+ }
208
+ return code;
209
+ }
210
+ static GetEntityTaxDetails(Entity) {
211
+ let EntityData = [];
212
+ if (!tr_utils_1.TrUtils.IsEmpty(Entity.GSTIN)) {
213
+ EntityData.push({ name: 'GSTIN', value: Entity.GSTIN });
214
+ }
215
+ if (!tr_utils_1.TrUtils.IsEmpty(Entity.PAN)) {
216
+ EntityData.push({ name: 'PAN No', value: Entity.PAN });
217
+ }
218
+ if (EntityData.length !== 0) {
219
+ return this.GetEntityeDataTable(EntityData);
220
+ }
221
+ else {
222
+ return shared_pdf_service_1.SharedPDFService.emptyObject();
223
+ }
224
+ }
225
+ static GetEntityeDataTable(EntityFields) {
226
+ return {
227
+ lineHeight: 0.7,
228
+ marginLeft: 25,
229
+ fontSize: this.SmallFont,
230
+ table: {
231
+ body: [
232
+ [{
233
+ table: {
234
+ fontSize: this.SmallFont,
235
+ widths: [37, 'auto', '*'],
236
+ body: this.DataCreateForTable(EntityFields)
237
+ },
238
+ layout: 'noBorders',
239
+ }]
240
+ ]
241
+ },
242
+ layout: 'noBorders',
243
+ };
244
+ }
245
+ static DataCreateForTable(EntityFields) {
246
+ var body = [];
247
+ EntityFields.forEach((row) => {
248
+ if (!tr_utils_1.TrUtils.IsFixedZero(row.value) && !tr_utils_1.TrUtils.IsEmpty(row.value)) {
249
+ var dataRow = [];
250
+ dataRow.push({ text: (row.name).toString(), noWrap: true });
251
+ dataRow.push(':');
252
+ dataRow.push({ text: (row.value).toString(), noWrap: true });
253
+ body.push(dataRow);
254
+ }
255
+ });
256
+ return body;
257
+ }
258
+ static GetVendorDetails(PurchaseOrder) {
259
+ return {
260
+ style: 'vendor_font',
261
+ columns: [
262
+ { stack: [this.GetVendorData(PurchaseOrder.ShipTo, PurchaseOrder.Type)], width: 120 }, { text: '', width: 250 },
263
+ this.GetVehicle(PurchaseOrder)
264
+ ],
265
+ // columnGap: 150
266
+ };
267
+ }
268
+ static GetVehicle(PurchaseOrder) {
269
+ var _a;
270
+ if (tr_utils_1.TrUtils.IsNull(PurchaseOrder.BL.VNo)) {
271
+ PurchaseOrder.BL.VNo = '';
272
+ }
273
+ return {
274
+ style: 'PO_Status',
275
+ lineHeight: 0.7,
276
+ columns: [
277
+ {
278
+ table: {
279
+ fontSize: 6,
280
+ widths: [37, 'auto', '*'],
281
+ body: [[{ text: 'ID', alignment: 'right', style: 'po_status_font' }, { text: ':', style: 'po_status_font' }, PurchaseOrder._id],
282
+ [{ text: 'Date', alignment: 'right', style: 'po_status_font' }, { text: ':', style: 'po_status_font' }, PurchaseOrder.CrDate],
283
+ [{ text: 'Reason', alignment: 'right', style: 'po_status_font' }, { text: ':', style: 'po_status_font' }, PurchaseOrder.ResName],
284
+ [{ text: 'Vehicle', alignment: 'right', style: 'po_status_font' }, { text: ':', style: 'po_status_font' }, (_a = PurchaseOrder === null || PurchaseOrder === void 0 ? void 0 : PurchaseOrder.BL) === null || _a === void 0 ? void 0 : _a.VNo],
285
+ // [{ text: 'Status', alignment: 'right', style: 'po_status_font' }, { text: ':', style: 'po_status_font' }, PurchaseOrder.Status]
286
+ ]
287
+ },
288
+ layout: 'noBorders',
289
+ },
290
+ ]
291
+ };
292
+ }
293
+ static GetVendorData(Vendor, Type) {
294
+ if (tr_utils_1.TrUtils.IsNull(Vendor)) {
295
+ return shared_pdf_service_1.SharedPDFService.emptyObject();
296
+ }
297
+ return {
298
+ style: 'Cust_Adrs',
299
+ stack: [{ text: 'User Name :', style: 'hed' },
300
+ { text: Vendor.Name, marginTop: 2 },
301
+ // { text: this.GetAddress(Vendor), marginTop: 3 },
302
+ this.GetVendorPhoneNumber(Vendor.Ph, Type)
303
+ ]
304
+ };
305
+ }
306
+ static GetAddress(Vendor) {
307
+ var Address = this.GetFormatAddress(Vendor);
308
+ if (Address.length !== 5) {
309
+ return Address;
310
+ }
311
+ else {
312
+ let a = '';
313
+ return a;
314
+ }
315
+ }
316
+ static GetFormatContact(CustomerObj) {
317
+ var contactnew = '';
318
+ CustomerObj.Contact.forEach((Contact) => {
319
+ contactnew = contactnew + '(' + Contact.Type + '):' + Contact.No + '\n';
320
+ });
321
+ return contactnew;
322
+ }
323
+ static GetFormatAddress(CustomerObj) {
324
+ var Addressnew = '';
325
+ if (!tr_utils_1.TrUtils.IsNull(CustomerObj) && !tr_utils_1.TrUtils.IsNull(CustomerObj.Adrs)) {
326
+ CustomerObj.Adrs.forEach((Adrs) => {
327
+ Addressnew = Addressnew + Adrs + '\n';
328
+ });
329
+ }
330
+ return Addressnew;
331
+ }
332
+ static GetVendorGSTIN(Vendor) {
333
+ let GSTIN = {};
334
+ if (!tr_utils_1.TrUtils.IsEmpty(Vendor.GSTIN)) {
335
+ let columns = [];
336
+ columns.push({ text: 'GSTIN :', width: 33, style: 'hed' });
337
+ columns.push({ text: Vendor.GSTIN, marginTop: 1.5 });
338
+ GSTIN.columns = columns;
339
+ return GSTIN;
340
+ }
341
+ else {
342
+ return GSTIN;
343
+ }
344
+ }
345
+ static GetVendorPhoneNumber(Phone, Type) {
346
+ let PhoneNumber = {};
347
+ if (Type !== 'Technician Copy') {
348
+ // var contact = this.GetFormatContact(Vendor);
349
+ // if (contact.length !== 0) {
350
+ let columns = [];
351
+ columns.push({ text: 'Phone', width: 27, style: 'hed' });
352
+ columns.push({ text: Phone + '\n' });
353
+ PhoneNumber.columns = columns;
354
+ return PhoneNumber;
355
+ // } else {
356
+ // return PhoneNumber;
357
+ // }
358
+ }
359
+ else {
360
+ return PhoneNumber;
361
+ }
362
+ }
363
+ static VendorDetailsAfterLine() {
364
+ return {
365
+ canvas: [
366
+ {
367
+ type: 'line',
368
+ lineColor: 'black',
369
+ x1: 0,
370
+ y1: 0,
371
+ x2: 575,
372
+ y2: 0,
373
+ lineWidth: 1
374
+ }
375
+ ]
376
+ };
377
+ }
378
+ static getPartsData(MOutPrintData) {
379
+ return this.GetWithOutDiscAndTaxFieldHeader(tr_utils_1.TrUtils.Stringify(MOutPrintData.Items), MOutPrintData.Entity.MPN, MOutPrintData.ShowTaxColumn, MOutPrintData.Entity.Body, MOutPrintData.ShowIGST, MOutPrintData.ShowDiscountColumn);
380
+ }
381
+ static GetWithOutDiscAndTaxFieldHeader(Items, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ShowDiscountColumn) {
382
+ if (Items.length !== 0) {
383
+ return this.WithOutTaxDataTable(PrintPartNo, ShowIGST, Items, Body, ShowTaxColumn, ShowDiscountColumn);
384
+ }
385
+ else {
386
+ let a = '';
387
+ return a;
388
+ }
389
+ }
390
+ static WithOutTaxDataTable(PrintPartNo, ShowIGST, Items, Body, ShowTaxColumn, ShowDiscountColumn) {
391
+ return this.WithOutTaxDataTableWithPartNumber(Items, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ShowDiscountColumn);
392
+ }
393
+ static WithOutTaxDataTableWithPartNumber(Items, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ShowDiscountColumn) {
394
+ return {
395
+ style: 'table_data',
396
+ table: {
397
+ widths: [25, '*', 150, 60],
398
+ body: this.BuildTableBodyForLaborAndParts(Items, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ShowDiscountColumn)
399
+ },
400
+ layout: shared_print_service_1.PrintSharedService.LayOutStyle()
401
+ };
402
+ }
403
+ static GetHeaderNames() {
404
+ let headersNames = [{ text: 'S.No.', style: 'tableheader', Field: 'SNo' },
405
+ { text: 'Description', style: 'tableheader', Field: 'Desc' },
406
+ { text: 'MPN', style: 'tableheader', Field: 'MPN' },
407
+ { text: 'Qty', style: 'tableheader', Field: 'QtyAndUoM' }];
408
+ return headersNames;
409
+ }
410
+ static BuildTableBodyForLaborAndParts(Items, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ShowDiscountColumn) {
411
+ var body = [];
412
+ let columns = this.GetHeaderNames();
413
+ // if (ShowTaxColumn) {
414
+ // for (let i = 0; i < columns.length; i++) {
415
+ body.push(columns);
416
+ // }
417
+ // columns = columns[0];
418
+ // } else {
419
+ // body.push(columns);
420
+ // }
421
+ let PartsTable = this.GetPartsDataTable(Items, columns, body);
422
+ return PartsTable;
423
+ }
424
+ static GetPartsDataTable(Items, columns, body) {
425
+ let SNo = 1;
426
+ // console.log('Items', Items);
427
+ // console.log('columns', columns);
428
+ Items.forEach((part) => {
429
+ var dataRow = [];
430
+ columns.forEach((column) => {
431
+ var _a, _b;
432
+ if (!tr_utils_1.TrUtils.IsFixedZero(part[column.Field]) && !tr_utils_1.TrUtils.IsNull(part[column.Field])) {
433
+ if (column.Field === 'QtyAndUoM') {
434
+ dataRow.push({ text: (_a = part[column.Field]) === null || _a === void 0 ? void 0 : _a.toString(), alignment: 'right', nowrap: true });
435
+ }
436
+ else {
437
+ // dataRow.push(part[column.Field].toString());
438
+ if (column.Field === 'Desc') {
439
+ let DescData = [];
440
+ DescData.push((_b = part[column.Field]) === null || _b === void 0 ? void 0 : _b.toString());
441
+ if (!tr_utils_1.TrUtils.IsEmpty(part['EDesc'])) {
442
+ DescData.push({ text: part['EDesc'].toString(), color: 'grey' });
443
+ }
444
+ dataRow.push({ stack: DescData });
445
+ }
446
+ else {
447
+ dataRow.push({ text: part[column.Field].toString() });
448
+ }
449
+ }
450
+ }
451
+ else {
452
+ if (column.Field === 'SNo') {
453
+ part[column.Field] = SNo;
454
+ SNo = SNo + 1;
455
+ }
456
+ else {
457
+ part[column.Field] = '';
458
+ }
459
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
460
+ }
461
+ });
462
+ body.push(dataRow);
463
+ });
464
+ return body;
465
+ }
466
+ static GetSignatures(CName) {
467
+ return {
468
+ fontSize: this.MediumFont,
469
+ columns: [{
470
+ stack: [
471
+ this.CompanyName(CName),
472
+ { columns: [this.Authorizedsignature()] }
473
+ ]
474
+ }],
475
+ };
476
+ }
477
+ static CompanyName(CName) {
478
+ return {
479
+ style: 'forCompany',
480
+ text: ['For ', { text: CName, bold: 'true' }],
481
+ };
482
+ }
483
+ static Authorizedsignature() {
484
+ return {
485
+ style: 'Sign',
486
+ text: ['Authorized Signatory'],
487
+ };
488
+ }
489
+ static HeaderLineStyle() {
490
+ return {
491
+ hLineWidth: function (i, node) {
492
+ return (i === 1) ? 0.5 : 0;
493
+ },
494
+ vLineWidth: function (i, node) {
495
+ return (i === 0 || i === node.table.widths.length) ? 0 : 0;
496
+ },
497
+ };
498
+ }
499
+ }
500
+ exports.MaterialOutprintService = MaterialOutprintService;
501
+ MaterialOutprintService.SmallFont = 6;
502
+ MaterialOutprintService.MediumFont = 8;
503
+ MaterialOutprintService.LargeFont = 9;
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OperatorWiseSalesDetailsPDF = void 0;
4
+ const my_date_1 = require("../utils/my-date");
5
+ const tr_utils_1 = require("../utils/tr-utils");
6
+ const shared_pdf_service_1 = require("./shared-pdf.service");
7
+ class OperatorWiseSalesDetailsPDF {
8
+ static GetOperatorWiseSalesDetailsPrint(InvoicesData, CName, isPhar, isHC, isSale, searchValue) {
9
+ // console.log('isSale', isSale);
10
+ var dd = {
11
+ info: {
12
+ title: 'OperatorWiseDetails',
13
+ },
14
+ header: function (currentPage, pageCount) {
15
+ return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', marginRight: 7, fontSize: 8, marginTop: 2 };
16
+ },
17
+ pageMargins: [10, 15, 10, 15],
18
+ content: [
19
+ { text: '' + CName + '', style: ['header'] },
20
+ { text: isSale ? 'Operator Wise Sales Details' : 'Doctor Wise Sales Details', alignment: 'center', fontSize: 15, bold: true },
21
+ // { text: 'As of ' + MyDate.ConvertUTCDateToReadable(MyDate.GetDateTimeNowInUTC()), alignment: 'center', fontSize: 10 },
22
+ // SharedPDFService.HeaderAfterLine(),
23
+ shared_pdf_service_1.SharedPDFService.GetSearchValueDetails(searchValue),
24
+ this.GetInvoiceDataTable(InvoicesData, isPhar, isHC),
25
+ ],
26
+ styles: shared_pdf_service_1.SharedPDFService.GetStyles()
27
+ };
28
+ return dd;
29
+ }
30
+ static GetInvoiceDataTable(InvoicesData, isPhar, isHC) {
31
+ let Data = [];
32
+ // InvoicesData.forEach((invoice: any) => {
33
+ Data.push(this.GetItemsTable(InvoicesData, isPhar, isHC));
34
+ // });
35
+ return Data;
36
+ }
37
+ static getTableWidths(isHC) {
38
+ // if (isHC) {
39
+ // return [25, '*', '*', '*', '*'];
40
+ // } else {
41
+ return [25, 40, 70, '*', 40, 40, 50, 50, 50, 60];
42
+ // }
43
+ }
44
+ static GetItemsTable(InvoiceData, isPhar, isHC) {
45
+ return {
46
+ style: 'tableExample',
47
+ marginTop: 3,
48
+ marginBottom: 5,
49
+ table: {
50
+ widths: this.getTableWidths(isHC),
51
+ headerRows: 1,
52
+ body: this.BuildTableBodyForLaborAndParts(InvoiceData, isPhar, isHC)
53
+ },
54
+ layout: {
55
+ hLineWidth: function (i, node) {
56
+ return (i === 0 || i === 1 || i === node.table.body.length) ? 1 : 0.5;
57
+ },
58
+ vLineWidth: function (i, node) {
59
+ return (i === 0 || i === node.table.widths.length) ? 1 : 0.5;
60
+ },
61
+ hLineColor: function (i, node) {
62
+ return (i === 0 || i === 1 || i === node.table.body.length) ? 'gray' : 'lightgrey';
63
+ },
64
+ vLineColor: function (i, node) {
65
+ return 'gray';
66
+ },
67
+ }
68
+ };
69
+ }
70
+ static BuildTableBodyForLaborAndParts(InvoiceData, isPhar, isHC) {
71
+ let body = this.GetHeaderNames(isPhar, isHC);
72
+ InvoiceData.forEach((invoice, index) => {
73
+ let dataRow = [];
74
+ dataRow.push({ text: index + 1 });
75
+ dataRow.push({ text: invoice.Code, style: ['headerstyle'], });
76
+ dataRow.push({ text: my_date_1.MyDate.ConvertUTCDateToReadable(invoice.CrDate) });
77
+ dataRow.push({ text: invoice.Name });
78
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.SubTotal), alignment: 'right' });
79
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.Disc), alignment: 'right' });
80
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.Tax), alignment: 'right' });
81
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.Adjust), alignment: 'right' });
82
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.Round), alignment: 'right' });
83
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(invoice.Total), alignment: 'right', style: ['headerstyle'], });
84
+ body.push(dataRow);
85
+ });
86
+ return body;
87
+ }
88
+ static GetHeaderNames(isPhar, isHC) {
89
+ let HeadingNames;
90
+ HeadingNames = [[{ text: 'S.No', style: 'tableheader1', Field: 'SNo', alignment: 'left', line: true },
91
+ { text: 'Receipt No', style: 'tableheader1', Field: 'Code' },
92
+ { text: 'Date', style: 'tableheader1', Field: 'CrDate' },
93
+ { text: 'Created By', style: 'tableheader1', Field: 'Name' },
94
+ { text: 'SubTotal', style: 'tableheader1', Field: 'SubTotal', alignment: 'right' },
95
+ { text: 'Disc', style: 'tableheader1', Field: 'Disc', alignment: 'right' },
96
+ { text: 'Tax', style: 'tableheader1', Field: 'Tax', alignment: 'right' },
97
+ { text: 'Adjustment', style: 'tableheader1', Field: 'Adjust', alignment: 'right' },
98
+ { text: 'Round Off', style: 'tableheader1', Field: 'Round', alignment: 'right' },
99
+ { text: 'Total', style: 'tableheader1', Field: 'Total', alignment: 'right' }]];
100
+ return HeadingNames;
101
+ }
102
+ }
103
+ exports.OperatorWiseSalesDetailsPDF = OperatorWiseSalesDetailsPDF;