shareneus 1.4.1 → 1.4.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.
@@ -618,52 +618,54 @@ class PurchaseOrderPDFService {
618
618
  });
619
619
  body.push(dataRow);
620
620
  });
621
- Ops.forEach((part) => {
622
- var dataRow = [];
623
- columns.forEach((column) => {
624
- var _a, _b, _c, _d;
625
- if (!tr_utils_1.TrUtils.IsFixedZero(part[column.Field]) && !tr_utils_1.TrUtils.IsNull(part[column.Field])
626
- || column.text === 'Line Total' || column.text === 'Unit Price') {
627
- if (part[column.Field] === 'Spare Items') {
628
- dataRow.push({ text: (_a = part[column.Field]) === null || _a === void 0 ? void 0 : _a.toString(), marginLeft: 50, style: 'InlineHeader' });
629
- }
630
- else {
631
- if (column.text === 'Line Total' || column.Field === 'QtyAndUoM'
632
- || column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt') {
633
- dataRow.push({ text: (_b = part[column.Field]) === null || _b === void 0 ? void 0 : _b.toString(), alignment: 'right', nowrap: true });
634
- }
635
- else if (column.Field1 === 'UnCo') {
636
- dataRow.push({ text: (_c = part[column.Field1]) === null || _c === void 0 ? void 0 : _c.toString(), alignment: 'right', nowrap: true });
621
+ if (!tr_utils_1.TrUtils.IsNull(Ops)) {
622
+ Ops === null || Ops === void 0 ? void 0 : Ops.forEach((part) => {
623
+ var dataRow = [];
624
+ columns.forEach((column) => {
625
+ var _a, _b, _c, _d;
626
+ if (!tr_utils_1.TrUtils.IsFixedZero(part[column.Field]) && !tr_utils_1.TrUtils.IsNull(part[column.Field])
627
+ || column.text === 'Line Total' || column.text === 'Unit Price') {
628
+ if (part[column.Field] === 'Spare Items') {
629
+ dataRow.push({ text: (_a = part[column.Field]) === null || _a === void 0 ? void 0 : _a.toString(), marginLeft: 50, style: 'InlineHeader' });
637
630
  }
638
631
  else {
639
- // dataRow.push(part[column.Field].toString());
640
- if (column.Field === 'Desc') {
641
- let DescData = [];
642
- DescData.push((_d = part[column.Field]) === null || _d === void 0 ? void 0 : _d.toString());
643
- if (!tr_utils_1.TrUtils.IsEmpty(part['EDesc'])) {
644
- DescData.push({ text: part['EDesc'].toString(), color: 'grey' });
645
- }
646
- dataRow.push({ stack: DescData });
632
+ if (column.text === 'Line Total' || column.Field === 'QtyAndUoM'
633
+ || column.Field === 'CGSTAmt' || column.Field === 'SGSTAmt') {
634
+ dataRow.push({ text: (_b = part[column.Field]) === null || _b === void 0 ? void 0 : _b.toString(), alignment: 'right', nowrap: true });
635
+ }
636
+ else if (column.Field1 === 'UnCo') {
637
+ dataRow.push({ text: (_c = part[column.Field1]) === null || _c === void 0 ? void 0 : _c.toString(), alignment: 'right', nowrap: true });
647
638
  }
648
639
  else {
649
- dataRow.push({ text: part[column.Field].toString() });
640
+ // dataRow.push(part[column.Field].toString());
641
+ if (column.Field === 'Desc') {
642
+ let DescData = [];
643
+ DescData.push((_d = part[column.Field]) === null || _d === void 0 ? void 0 : _d.toString());
644
+ if (!tr_utils_1.TrUtils.IsEmpty(part['EDesc'])) {
645
+ DescData.push({ text: part['EDesc'].toString(), color: 'grey' });
646
+ }
647
+ dataRow.push({ stack: DescData });
648
+ }
649
+ else {
650
+ dataRow.push({ text: part[column.Field].toString() });
651
+ }
650
652
  }
651
653
  }
652
654
  }
653
- }
654
- else {
655
- if (column.Field === 'SNo') {
656
- part[column.Field] = SNo;
657
- SNo = SNo + 1;
658
- }
659
655
  else {
660
- part[column.Field] = '';
656
+ if (column.Field === 'SNo') {
657
+ part[column.Field] = SNo;
658
+ SNo = SNo + 1;
659
+ }
660
+ else {
661
+ part[column.Field] = '';
662
+ }
663
+ dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
661
664
  }
662
- dataRow.push({ text: part[column.Field].toString(), alignment: 'center' });
663
- }
665
+ });
666
+ body.push(dataRow);
664
667
  });
665
- body.push(dataRow);
666
- });
668
+ }
667
669
  return body;
668
670
  }
669
671
  static PartsTableBody(Items, Ops, PrintPartNo) {
@@ -41,7 +41,9 @@ class PurchaseOrderPrintService {
41
41
  }
42
42
  PurchaseOrderPDFData.Items = tr_utils_1.TrUtils.Stringify(PurchaseOrderData.Items);
43
43
  PurchaseOrderPDFData.Ops = tr_utils_1.TrUtils.Stringify(PurchaseOrderData.Ops);
44
- PurchaseOrderPDFData.Ops = this.GetLaborPrintInfo(PurchaseOrderPDFData.Ops, TaxCodes, 'AT');
44
+ if (!tr_utils_1.TrUtils.IsNull(PurchaseOrderPDFData.Ops)) {
45
+ PurchaseOrderPDFData.Ops = this.GetLaborPrintInfo(PurchaseOrderPDFData.Ops, TaxCodes, 'AT');
46
+ }
45
47
  // PurchaseOrderPDFData.Items = this.GetPartsDescription(PurchaseOrderPDFData.Items);
46
48
  PurchaseOrderPDFData.Items = this.GetQtyWithUoM(PurchaseOrderPDFData.Items);
47
49
  let DetailedTotalsInfo;
@@ -75,7 +77,7 @@ class PurchaseOrderPrintService {
75
77
  if (tr_utils_1.TrUtils.IsNull(Labor.Qty)) {
76
78
  Labor.Qty = 1;
77
79
  }
78
- Labor.UnCo = tr_utils_1.TrUtils.FixPriceValue(Labor.Pr);
80
+ Labor.UnCo = tr_utils_1.TrUtils.FixPriceValue(Labor.UnCo);
79
81
  // Labor.TaxName = this.getTaxName(Labor.TCode, TaxCodes);
80
82
  if (!tr_utils_1.TrUtils.IsEmpty(Labor.Perc)) {
81
83
  Labor.DiscPerc = Labor.Perc;
@@ -38,7 +38,7 @@ class PurchaseOrderTotalsService {
38
38
  Operation = this.ResetLaborValueIfInvalid(Operation);
39
39
  Operation.DiscountedPrice = (0, aggregation_1.addition)(Operation.Disc, Operation.RecDisc);
40
40
  if (tr_utils_1.TrUtils.IsNull(Operation.Amt)) {
41
- Operation.Amt = Operation.Pr;
41
+ Operation.Amt = Operation.UnCo;
42
42
  }
43
43
  Operation.GSTAmt = (0, aggregation_1.addition)(Operation.SGST, Operation.CGST, Operation.IGST);
44
44
  if (IsIndependentTax) {
@@ -51,7 +51,7 @@ class PurchaseOrderTotalsService {
51
51
  Operation.AfterLaborTax = Operation.AfterLaborDisc;
52
52
  }
53
53
  let Price = 0;
54
- Price = (0, aggregation_1.multiply)(Operation.Pr, Operation.Qty);
54
+ Price = (0, aggregation_1.multiply)(Operation.UnCo, Operation.Qty);
55
55
  if (IsIndependentTax) {
56
56
  Operation.LineTotal = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)((0, aggregation_1.subtraction)(Price, Operation.Disc), Operation.GSTAmt));
57
57
  }
@@ -62,7 +62,7 @@ class PurchaseOrderTotalsService {
62
62
  return opCodesList;
63
63
  }
64
64
  static ResetLaborValueIfInvalid(Operation) {
65
- Operation.Pr = tr_utils_1.TrUtils.SetValueToZeroIfNull(Operation.Pr);
65
+ Operation.UnCo = tr_utils_1.TrUtils.SetValueToZeroIfNull(Operation.UnCo);
66
66
  Operation.RecDisc = tr_utils_1.TrUtils.SetValueToZeroIfNull(Operation.RecDisc);
67
67
  Operation.Disc = tr_utils_1.TrUtils.SetValueToZeroIfNull(Operation.Disc);
68
68
  Operation.CGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(Operation.CGST);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",