shareneus 1.2.1 → 1.2.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.
@@ -103,54 +103,54 @@ class ConsultationPDFService {
103
103
  return Sec;
104
104
  }
105
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 };
106
+ var _a, _b, _c, _d, _e;
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) && !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)) {
108
+ 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 };
109
109
  }
110
110
  else {
111
111
  return { text: 'Weight :', Width: 80 };
112
112
  }
113
113
  }
114
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 };
115
+ var _a, _b, _c, _d, _e;
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) && !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)) {
117
+ 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 };
118
118
  }
119
119
  else {
120
120
  return { text: 'Temperature :', Width: 80 };
121
121
  }
122
122
  }
123
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 };
124
+ var _a, _b, _c, _d, _e;
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) && !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)) {
126
+ 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 };
127
127
  }
128
128
  else {
129
129
  return { text: 'SPO2 :', Width: 80 };
130
130
  }
131
131
  }
132
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 };
133
+ var _a, _b, _c, _d, _e;
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) && !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)) {
135
+ 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 };
136
136
  }
137
137
  else {
138
138
  return { text: 'Pulse :', Width: 80 };
139
139
  }
140
140
  }
141
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 };
142
+ var _a, _b, _c, _d, _e, _f, _g;
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) && !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)) {
144
+ 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 };
145
145
  }
146
146
  else {
147
147
  return { text: 'Height :', Width: 80 };
148
148
  }
149
149
  }
150
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 };
151
+ var _a, _b, _c, _d, _e;
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) && !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)) {
153
+ 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 };
154
154
  }
155
155
  else {
156
156
  return { text: 'BP :', Width: 80 };
@@ -34,7 +34,7 @@ class InvoicePortraitPrintService {
34
34
  },
35
35
  layout: this.HeaderLayOut()
36
36
  },
37
- this.GetItemsTable(InvoicePDFData.Items, InvoicePDFData.ShowTaxColumn, InvoicePDFData.Settings.PoS.SType, printOptions, size),
37
+ this.GetItemsTable(InvoicePDFData.Ops, InvoicePDFData.Items, InvoicePDFData.ShowTaxColumn, InvoicePDFData.Settings.PoS.SType, printOptions, size),
38
38
  [this.TotalDetails(InvoicePDFData)],
39
39
  {
40
40
  style: 'tableExample',
@@ -315,7 +315,7 @@ class InvoicePortraitPrintService {
315
315
  text: ['Customer Signature'], marginLeft: 90
316
316
  };
317
317
  }
318
- static GetItemsTable(Items, ShowTaxColumn, SType, printOptions, size) {
318
+ static GetItemsTable(Services, Items, ShowTaxColumn, SType, printOptions, size) {
319
319
  return {
320
320
  style: 'tableExample',
321
321
  marginTop: 3,
@@ -323,7 +323,7 @@ class InvoicePortraitPrintService {
323
323
  table: {
324
324
  widths: this.GetWidths(ShowTaxColumn, printOptions),
325
325
  headerRows: 1,
326
- body: this.BuildTableBodyForLaborAndParts(Items, ShowTaxColumn, SType, printOptions, size)
326
+ body: this.BuildTableBodyForLaborAndParts(Services, Items, ShowTaxColumn, SType, printOptions, size)
327
327
  },
328
328
  layout: {
329
329
  hLineWidth: function (i, node) {
@@ -362,49 +362,93 @@ class InvoicePortraitPrintService {
362
362
  static GetAddress(Entity) {
363
363
  return Entity.Adrs1 + ', ' + Entity.Adrs2 + ', ' + Entity.City + '-' + Entity.PIN + ', Cell : ' + Entity.Phone;
364
364
  }
365
- static BuildTableBodyForLaborAndParts(Items, ShowTaxColumn, SType, printOptions, size) {
365
+ static BuildTableBodyForLaborAndParts(Services, Items, ShowTaxColumn, SType, printOptions, size) {
366
366
  let body = this.GetHeaderNames(ShowTaxColumn, SType, printOptions);
367
367
  let j = 1;
368
- Items.forEach((item, index) => {
369
- var _a, _b;
370
- let dataRow = [];
371
- dataRow.push({ text: index + 1, });
372
- dataRow.push({ text: item.Desc, });
373
- if (ShowTaxColumn) {
374
- dataRow.push({ text: item.HSN, alignment: 'center', style: ['headerstyle'], });
375
- }
376
- dataRow.push({ text: (_a = item.Batch) === null || _a === void 0 ? void 0 : _a.BN, alignment: 'center', style: ['headerstyle'], });
377
- dataRow.push({ text: my_date_1.MyDate.ConvertUTCDateToReadableExDate(item['Batch'].ExDt), alignment: 'center', style: ['headerstyle'], });
378
- dataRow.push({ text: item.QtyAndUoM, alignment: 'right', style: ['headerstyle'], });
379
- dataRow.push({ text: item.OfQty, alignment: 'right', style: ['headerstyle'], });
380
- dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.MRP), alignment: 'right', style: ['headerstyle'], });
381
- dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.UnPr), alignment: 'right', style: ['headerstyle'], });
382
- if (printOptions.Disc !== 'NO') {
383
- if (printOptions.Disc === 'PERC') {
384
- dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.DiscPerc), alignment: 'right', style: ['headerstyle'], });
368
+ if (!tr_utils_1.TrUtils.IsNull(Services) && Services.length !== 0) {
369
+ Services.forEach((item, index) => {
370
+ var _a;
371
+ let dataRow = [];
372
+ dataRow.push({ text: index + 1, });
373
+ dataRow.push({ text: item.Desc, });
374
+ if (ShowTaxColumn) {
375
+ dataRow.push({ text: item.SAC, alignment: 'center', style: ['headerstyle'], });
385
376
  }
386
- else {
387
- dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.Disc), alignment: 'right', style: ['headerstyle'], });
377
+ dataRow.push({ text: '', alignment: 'center', style: ['headerstyle'], });
378
+ dataRow.push({ text: '', alignment: 'center', style: ['headerstyle'], });
379
+ dataRow.push({ text: item.Qty, alignment: 'right', style: ['headerstyle'], });
380
+ dataRow.push({ text: '', alignment: 'right', style: ['headerstyle'], });
381
+ dataRow.push({ text: '', alignment: 'right', style: ['headerstyle'], });
382
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.Pr), alignment: 'right', style: ['headerstyle'], });
383
+ if (printOptions.Disc !== 'NO') {
384
+ if (printOptions.Disc === 'PERC') {
385
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.DiscPerc), alignment: 'right', style: ['headerstyle'], });
386
+ }
387
+ else {
388
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.Disc), alignment: 'right', style: ['headerstyle'], });
389
+ }
388
390
  }
389
- }
390
- if (ShowTaxColumn && printOptions.ShowTax !== 'NO') {
391
- let Tax = (_b = item.TaxName) === null || _b === void 0 ? void 0 : _b.split('%');
392
- dataRow.push({ text: tr_utils_1.TrUtils.IsNull(Tax) ? '' : Tax[0], alignment: 'right', style: ['headerstyle'], });
393
- }
394
- dataRow.push({ text: item.Ret ? '-' + tr_utils_1.TrUtils.FixPriceValue(item.LineTotal) : tr_utils_1.TrUtils.FixPriceValue(item.LineTotal), alignment: 'right', style: ['headerstyle'], });
395
- body.push(dataRow);
396
- if (index + 1 === j * 9) {
397
- j++;
398
- if (size === 'diff') {
399
- let dataRow1 = [{ text: '', pageBreak: 'after' }, '', '', '', '', ''];
400
- if (ShowTaxColumn) {
401
- dataRow1.push('');
402
- dataRow1.push('');
391
+ if (ShowTaxColumn && printOptions.ShowTax !== 'NO') {
392
+ let Tax = (_a = item.TaxName) === null || _a === void 0 ? void 0 : _a.split('%');
393
+ dataRow.push({ text: tr_utils_1.TrUtils.IsNull(Tax) ? '' : Tax[0], alignment: 'right', style: ['headerstyle'], });
394
+ }
395
+ dataRow.push({ text: item.Ret ? '-' + tr_utils_1.TrUtils.FixPriceValue(item.LineTotal) : tr_utils_1.TrUtils.FixPriceValue(item.LineTotal), alignment: 'right', style: ['headerstyle'], });
396
+ body.push(dataRow);
397
+ if (index + 1 === j * 9) {
398
+ j++;
399
+ if (size === 'diff') {
400
+ let dataRow1 = [{ text: '', pageBreak: 'after' }, '', '', '', '', ''];
401
+ if (ShowTaxColumn) {
402
+ dataRow1.push('');
403
+ dataRow1.push('');
404
+ }
405
+ body.push(dataRow1);
403
406
  }
404
- body.push(dataRow1);
405
407
  }
406
- }
407
- });
408
+ });
409
+ }
410
+ if (!tr_utils_1.TrUtils.IsNull(Items) && Items.length !== 0) {
411
+ Items.forEach((item, index) => {
412
+ var _a, _b;
413
+ let dataRow = [];
414
+ dataRow.push({ text: index + 1, });
415
+ dataRow.push({ text: item.Desc, });
416
+ if (ShowTaxColumn) {
417
+ dataRow.push({ text: item.HSN, alignment: 'center', style: ['headerstyle'], });
418
+ }
419
+ dataRow.push({ text: (_a = item.Batch) === null || _a === void 0 ? void 0 : _a.BN, alignment: 'center', style: ['headerstyle'], });
420
+ dataRow.push({ text: my_date_1.MyDate.ConvertUTCDateToReadableExDate(item['Batch'].ExDt), alignment: 'center', style: ['headerstyle'], });
421
+ dataRow.push({ text: item.QtyAndUoM, alignment: 'right', style: ['headerstyle'], });
422
+ dataRow.push({ text: item.OfQty, alignment: 'right', style: ['headerstyle'], });
423
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.MRP), alignment: 'right', style: ['headerstyle'], });
424
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.UnPr), alignment: 'right', style: ['headerstyle'], });
425
+ if (printOptions.Disc !== 'NO') {
426
+ if (printOptions.Disc === 'PERC') {
427
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.DiscPerc), alignment: 'right', style: ['headerstyle'], });
428
+ }
429
+ else {
430
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.Disc), alignment: 'right', style: ['headerstyle'], });
431
+ }
432
+ }
433
+ if (ShowTaxColumn && printOptions.ShowTax !== 'NO') {
434
+ let Tax = (_b = item.TaxName) === null || _b === void 0 ? void 0 : _b.split('%');
435
+ dataRow.push({ text: tr_utils_1.TrUtils.IsNull(Tax) ? '' : Tax[0], alignment: 'right', style: ['headerstyle'], });
436
+ }
437
+ dataRow.push({ text: item.Ret ? '-' + tr_utils_1.TrUtils.FixPriceValue(item.LineTotal) : tr_utils_1.TrUtils.FixPriceValue(item.LineTotal), alignment: 'right', style: ['headerstyle'], });
438
+ body.push(dataRow);
439
+ if (index + 1 === j * 9) {
440
+ j++;
441
+ if (size === 'diff') {
442
+ let dataRow1 = [{ text: '', pageBreak: 'after' }, '', '', '', '', ''];
443
+ if (ShowTaxColumn) {
444
+ dataRow1.push('');
445
+ dataRow1.push('');
446
+ }
447
+ body.push(dataRow1);
448
+ }
449
+ }
450
+ });
451
+ }
408
452
  return body;
409
453
  }
410
454
  static GetHeaderNames(ShowTaxColumn, SType, printOptions) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",