shareneus 1.4.49 → 1.4.51

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 (151) hide show
  1. package/dist/accounting/counter-sales/auto-sales-receipt-pdf.service.js +1 -1
  2. package/dist/accounting/counter-sales/sales-receipt-pdf.service.js +1 -1
  3. package/dist/accounting/counter-sales/sales-receipt-print.service.js +1 -1
  4. package/dist/accounting/credit-note/credit-note-pdf.service.js +1 -1
  5. package/dist/accounting/debit-note/debit-note-print.service.js +1 -1
  6. package/dist/accounting/invoice/inv-pdf.service.js +13 -12
  7. package/dist/accounting/invoice/inv-print.service.js +6 -6
  8. package/dist/accounting/invoice/invoice-landscape-pdf.service.d.ts +1 -1
  9. package/dist/accounting/invoice/invoice-landscape-pdf.service.js +7 -6
  10. package/dist/accounting/invoice/invoice-letterhead-pdf.service.js +13 -12
  11. package/dist/accounting/invoice/invoice-portrait-pdf.d.ts +5 -5
  12. package/dist/accounting/invoice/invoice-portrait-pdf.js +31 -30
  13. package/dist/accounting/invoice/invoice-total.service.js +1 -1
  14. package/dist/accounting/invoice/reports/excel/analysis-excel.service.d.ts +3 -3
  15. package/dist/accounting/invoice/reports/excel/analysis-excel.service.js +8 -7
  16. package/dist/accounting/invoice/reports/excel/category-wise-item-excel.service.d.ts +4 -4
  17. package/dist/accounting/invoice/reports/excel/category-wise-item-excel.service.js +14 -14
  18. package/dist/accounting/invoice/reports/excel/cust-wise-sales-details.d.ts +4 -4
  19. package/dist/accounting/invoice/reports/excel/cust-wise-sales-details.js +8 -8
  20. package/dist/accounting/invoice/reports/excel/cust-wise-sales-summary-excel.service.d.ts +4 -4
  21. package/dist/accounting/invoice/reports/excel/cust-wise-sales-summary-excel.service.js +8 -8
  22. package/dist/accounting/invoice/reports/excel/invoice-wise-excel.service.d.ts +4 -4
  23. package/dist/accounting/invoice/reports/excel/invoice-wise-excel.service.js +8 -8
  24. package/dist/accounting/invoice/reports/excel/item-wise-doctor-sale-excel.service.d.ts +4 -4
  25. package/dist/accounting/invoice/reports/excel/item-wise-doctor-sale-excel.service.js +10 -10
  26. package/dist/accounting/invoice/reports/excel/items-wise-sales-excel.service.d.ts +4 -4
  27. package/dist/accounting/invoice/reports/excel/items-wise-sales-excel.service.js +14 -13
  28. package/dist/accounting/invoice/reports/excel/manf-wise-sales-excel.service.d.ts +4 -4
  29. package/dist/accounting/invoice/reports/excel/manf-wise-sales-excel.service.js +8 -8
  30. package/dist/accounting/invoice/reports/excel/operator-wise-details.d.ts +4 -4
  31. package/dist/accounting/invoice/reports/excel/operator-wise-details.js +8 -8
  32. package/dist/accounting/invoice/reports/excel/operator-wise-summary.d.ts +4 -4
  33. package/dist/accounting/invoice/reports/excel/operator-wise-summary.js +8 -8
  34. package/dist/accounting/invoice/reports/excel/sa-wise-labor-sales-excel.service.d.ts +4 -4
  35. package/dist/accounting/invoice/reports/excel/sa-wise-labor-sales-excel.service.js +12 -11
  36. package/dist/accounting/invoice/reports/excel/sa-wise-part-sales-excel.service.d.ts +4 -4
  37. package/dist/accounting/invoice/reports/excel/sa-wise-part-sales-excel.service.js +12 -11
  38. package/dist/accounting/invoice/reports/excel/sale-summary-excel.service.d.ts +4 -4
  39. package/dist/accounting/invoice/reports/excel/sale-summary-excel.service.js +11 -10
  40. package/dist/accounting/invoice/reports/excel/sales-by-service-summary-excel.service.d.ts +4 -4
  41. package/dist/accounting/invoice/reports/excel/sales-by-service-summary-excel.service.js +19 -18
  42. package/dist/accounting/invoice/reports/excel/scheduled-drug-summary-excel.service.d.ts +4 -4
  43. package/dist/accounting/invoice/reports/excel/scheduled-drug-summary-excel.service.js +11 -11
  44. package/dist/accounting/invoice/reports/excel/scheduled-drugs-excel.service.d.ts +4 -4
  45. package/dist/accounting/invoice/reports/excel/scheduled-drugs-excel.service.js +11 -11
  46. package/dist/accounting/invoice/reports/pdf/analysis-pdf.service.d.ts +3 -3
  47. package/dist/accounting/invoice/reports/pdf/analysis-pdf.service.js +13 -12
  48. package/dist/accounting/invoice/reports/pdf/category-wise-item-pdf.service.d.ts +4 -4
  49. package/dist/accounting/invoice/reports/pdf/category-wise-item-pdf.service.js +14 -13
  50. package/dist/accounting/invoice/reports/pdf/cust-wise-sales-details-pdf.service.d.ts +4 -4
  51. package/dist/accounting/invoice/reports/pdf/cust-wise-sales-details-pdf.service.js +15 -14
  52. package/dist/accounting/invoice/reports/pdf/cust-wise-sales-summary-pdf.service.d.ts +4 -4
  53. package/dist/accounting/invoice/reports/pdf/cust-wise-sales-summary-pdf.service.js +15 -14
  54. package/dist/accounting/invoice/reports/pdf/item-wise-doctor-sale-pdf.service.d.ts +4 -4
  55. package/dist/accounting/invoice/reports/pdf/item-wise-doctor-sale-pdf.service.js +10 -10
  56. package/dist/accounting/invoice/reports/pdf/item-wise-sales-pdf.service.d.ts +4 -4
  57. package/dist/accounting/invoice/reports/pdf/item-wise-sales-pdf.service.js +15 -14
  58. package/dist/accounting/invoice/reports/pdf/manf-wise-sales-pdf.service.d.ts +4 -4
  59. package/dist/accounting/invoice/reports/pdf/manf-wise-sales-pdf.service.js +13 -12
  60. package/dist/accounting/invoice/reports/pdf/operator-wise-details-pdf.service.d.ts +4 -4
  61. package/dist/accounting/invoice/reports/pdf/operator-wise-details-pdf.service.js +14 -14
  62. package/dist/accounting/invoice/reports/pdf/operator-wise-summary-pdf.d.ts +4 -4
  63. package/dist/accounting/invoice/reports/pdf/operator-wise-summary-pdf.js +14 -14
  64. package/dist/accounting/invoice/reports/pdf/sales-by-service-pdf.service.d.ts +4 -4
  65. package/dist/accounting/invoice/reports/pdf/sales-by-service-pdf.service.js +14 -13
  66. package/dist/accounting/invoice/reports/pdf/scheduled-drug-pdf.service.d.ts +4 -4
  67. package/dist/accounting/invoice/reports/pdf/scheduled-drug-pdf.service.js +8 -8
  68. package/dist/accounting/invoice/reports/pdf/scheduled-drug-summary-pdf.service.d.ts +4 -4
  69. package/dist/accounting/invoice/reports/pdf/scheduled-drug-summary-pdf.service.js +12 -11
  70. package/dist/accounting/invoice/shared-inv-pdf.service.js +1 -1
  71. package/dist/accounting/payment-receive/reports/excel/cust-balance-excel.service.d.ts +4 -4
  72. package/dist/accounting/payment-receive/reports/excel/cust-balance-excel.service.js +9 -9
  73. package/dist/accounting/payment-receive/reports/excel/payment-receive-excel.service.d.ts +5 -5
  74. package/dist/accounting/payment-receive/reports/excel/payment-receive-excel.service.js +11 -11
  75. package/dist/accounting/payment-receive/reports/pdf/customer-balances-pdf.service.d.ts +3 -3
  76. package/dist/accounting/payment-receive/reports/pdf/customer-balances-pdf.service.js +10 -10
  77. package/dist/accounting/payment-receive/reports/pdf/payment-report-pdf.service.d.ts +3 -3
  78. package/dist/accounting/payment-receive/reports/pdf/payment-report-pdf.service.js +7 -7
  79. package/dist/appointments/consultations/consultation-fee-receipt.service.d.ts +1 -1
  80. package/dist/appointments/consultations/consultation-fee-receipt.service.js +4 -4
  81. package/dist/gst/excel/GSTR-RO-excel.service.d.ts +4 -4
  82. package/dist/gst/excel/GSTR-RO-excel.service.js +8 -8
  83. package/dist/gst/excel/GSTR1-excel.service.d.ts +4 -4
  84. package/dist/gst/excel/GSTR1-excel.service.js +10 -10
  85. package/dist/gst/excel/GSTR2-excel.service.d.ts +4 -4
  86. package/dist/gst/excel/GSTR2-excel.service.js +9 -9
  87. package/dist/gst/excel/tally-sales-import.service.d.ts +4 -4
  88. package/dist/gst/excel/tally-sales-import.service.js +8 -8
  89. package/dist/inventory/items/issue-parts-pdf.service.d.ts +6 -6
  90. package/dist/inventory/items/issue-parts-pdf.service.js +33 -33
  91. package/dist/inventory/items/reports/excel/expiring-drugs-excel.service.d.ts +4 -4
  92. package/dist/inventory/items/reports/excel/expiring-drugs-excel.service.js +11 -10
  93. package/dist/inventory/items/reports/excel/item-wise-mout-details.d.ts +4 -4
  94. package/dist/inventory/items/reports/excel/item-wise-mout-details.js +8 -8
  95. package/dist/inventory/items/reports/excel/item-wise-mout-summary.d.ts +4 -4
  96. package/dist/inventory/items/reports/excel/item-wise-mout-summary.js +8 -8
  97. package/dist/inventory/items/reports/excel/spares-issue-excel.service.d.ts +4 -4
  98. package/dist/inventory/items/reports/excel/spares-issue-excel.service.js +12 -12
  99. package/dist/inventory/items/reports/excel/stock-excel.service.d.ts +4 -4
  100. package/dist/inventory/items/reports/excel/stock-excel.service.js +8 -8
  101. package/dist/inventory/items/reports/pdf/expiring-drugs-pdf.service.d.ts +2 -2
  102. package/dist/inventory/items/reports/pdf/expiring-drugs-pdf.service.js +8 -7
  103. package/dist/inventory/items/reports/pdf/item-wise-mout-details-pdf.d.ts +4 -4
  104. package/dist/inventory/items/reports/pdf/item-wise-mout-details-pdf.js +9 -9
  105. package/dist/inventory/items/reports/pdf/item-wise-mout-summary-pdf.d.ts +4 -4
  106. package/dist/inventory/items/reports/pdf/item-wise-mout-summary-pdf.js +9 -9
  107. package/dist/purchases/payment-made/reports/excel/payments-made-excel.service.d.ts +4 -4
  108. package/dist/purchases/payment-made/reports/excel/payments-made-excel.service.js +9 -9
  109. package/dist/purchases/payment-made/reports/excel/ven-balance-excel.service.d.ts +6 -6
  110. package/dist/purchases/payment-made/reports/excel/ven-balance-excel.service.js +14 -14
  111. package/dist/purchases/payment-made/reports/pdf/vendor-balances-pdf.service.d.ts +3 -3
  112. package/dist/purchases/payment-made/reports/pdf/vendor-balances-pdf.service.js +8 -8
  113. package/dist/purchases/purchase-order/purchase-order-pdf.service.js +5 -5
  114. package/dist/purchases/purchase-order/purchase-order-print.service.d.ts +2 -2
  115. package/dist/purchases/purchase-order/purchase-order-print.service.js +25 -25
  116. package/dist/purchases/vendor-credit-note/vendor-credit-note-pdf.service.js +1 -1
  117. package/dist/purchases/vendor-credit-note/vendor-credit-note-print.service.d.ts +1 -1
  118. package/dist/purchases/vendor-credit-note/vendor-credit-note-print.service.js +20 -20
  119. package/dist/purchases/vendor-credit-note/vendor-credit-note-totals.service.d.ts +8 -8
  120. package/dist/purchases/vendor-credit-note/vendor-credit-note-totals.service.js +31 -32
  121. package/dist/purchases/vendor-debit-note/vendor-debit-note-pdf.service.js +1 -1
  122. package/dist/purchases/vendor-debit-note/vendor-debit-note-totals.service.d.ts +6 -6
  123. package/dist/purchases/vendor-debit-note/vendor-debit-note-totals.service.js +19 -19
  124. package/dist/sales/delivery-challan/dc-landscape-pdf.service.d.ts +1 -1
  125. package/dist/sales/delivery-challan/dc-landscape-pdf.service.js +7 -6
  126. package/dist/sales/delivery-challan/delivery-challan-print.service.js +2 -2
  127. package/dist/sales/delivery-challan/delivery-challan-totals.d.ts +6 -6
  128. package/dist/sales/delivery-challan/delivery-challan-totals.js +20 -20
  129. package/dist/sales/sales/sales-pdf.service.js +1 -1
  130. package/dist/sales/sales/sales-print.service.js +7 -7
  131. package/dist/sales/sales/sales-totals.service.d.ts +6 -6
  132. package/dist/sales/sales/sales-totals.service.js +19 -19
  133. package/dist/services/est.print-service.js +1 -1
  134. package/dist/services/reports/excel/insurance-expire-excel.service.d.ts +4 -4
  135. package/dist/services/reports/excel/insurance-expire-excel.service.js +8 -8
  136. package/dist/services/reports/excel/next-service-date-excel.service.d.ts +4 -4
  137. package/dist/services/reports/excel/next-service-date-excel.service.js +8 -8
  138. package/dist/services/reports/excel/repair-orders-excel.service.d.ts +5 -5
  139. package/dist/services/reports/excel/repair-orders-excel.service.js +11 -11
  140. package/dist/services/reports/pdf/repair-orders-pdf.service.d.ts +4 -4
  141. package/dist/services/reports/pdf/repair-orders-pdf.service.js +9 -9
  142. package/dist/services/ro-pdf.service.js +2 -2
  143. package/dist/services/ro-print-service.js +1 -1
  144. package/dist/services/ro-totals.service.d.ts +11 -11
  145. package/dist/services/ro-totals.service.js +50 -50
  146. package/dist/services/separate-wo-print.service.js +1 -1
  147. package/dist/shared/shared-pdf.service.d.ts +3 -3
  148. package/dist/shared/shared-pdf.service.js +31 -30
  149. package/dist/utils/tr-utils.d.ts +1 -1
  150. package/dist/utils/tr-utils.js +3 -2
  151. package/package.json +1 -1
@@ -5,12 +5,12 @@ const aggregation_1 = require("../aggregation/aggregation");
5
5
  const enums_1 = require("../enums/enums");
6
6
  const tr_utils_1 = require("../utils/tr-utils");
7
7
  class ROTotalsService {
8
- static GetTotalsValue(OriRecordData, TaxCodes, isWorkOrder, detailedInfo, withItems, isRoundable) {
8
+ static GetTotalsValue(OriRecordData, TaxCodes, isWorkOrder, detailedInfo, withItems, isRoundable, EntitySettings) {
9
9
  let dupRecordData = tr_utils_1.TrUtils.Stringify(OriRecordData);
10
10
  let argRecordData = {};
11
11
  dupRecordData.Ops = this.CalculateLaborValues(dupRecordData.Ops, isWorkOrder, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax));
12
12
  dupRecordData.Parts = this.CalculatePartValues(dupRecordData.Parts, dupRecordData.Ops, isWorkOrder, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax));
13
- argRecordData = this.GetROTotalsData(argRecordData, dupRecordData, TaxCodes, withItems, detailedInfo, isWorkOrder, isRoundable);
13
+ argRecordData = this.GetROTotalsData(argRecordData, dupRecordData, TaxCodes, withItems, detailedInfo, isWorkOrder, isRoundable, EntitySettings.DecimalsNumber);
14
14
  return argRecordData;
15
15
  }
16
16
  static CalculateLaborValues(opCodesList, isWorkOrder, isTaxable) {
@@ -375,13 +375,13 @@ class ROTotalsService {
375
375
  });
376
376
  return PartsList;
377
377
  }
378
- static GetROTotalsData(argRecordData, dupRecordData, TaxCodes, withItems, detailedInfo, isWorkOrder, isRoundable) {
378
+ static GetROTotalsData(argRecordData, dupRecordData, TaxCodes, withItems, detailedInfo, isWorkOrder, isRoundable, DecimalsNumber) {
379
379
  dupRecordData = this.ResetDiscountValuesIfInvalid(dupRecordData);
380
380
  argRecordData = this.SetMainDiscountValues(argRecordData, dupRecordData, detailedInfo);
381
- argRecordData = this.GetFinalCustomerTotalsData(argRecordData, dupRecordData, isWorkOrder, detailedInfo, isRoundable);
382
- argRecordData = this.GetFinalInsuranceTotalsData(argRecordData, dupRecordData, detailedInfo, isWorkOrder);
381
+ argRecordData = this.GetFinalCustomerTotalsData(argRecordData, dupRecordData, isWorkOrder, detailedInfo, isRoundable, DecimalsNumber);
382
+ argRecordData = this.GetFinalInsuranceTotalsData(argRecordData, dupRecordData, detailedInfo, isWorkOrder, DecimalsNumber);
383
383
  if (detailedInfo) {
384
- argRecordData = this.GetDetailedTotalsData(argRecordData, dupRecordData, TaxCodes, isWorkOrder);
384
+ argRecordData = this.GetDetailedTotalsData(argRecordData, dupRecordData, TaxCodes, isWorkOrder, DecimalsNumber);
385
385
  }
386
386
  if (withItems) {
387
387
  argRecordData.Ops = dupRecordData.Ops;
@@ -413,7 +413,7 @@ class ROTotalsService {
413
413
  }
414
414
  return argRecordData;
415
415
  }
416
- static GetFinalCustomerTotalsData(argRecordData, dupRecordData, isWorkOrder, detailedInfo, isRoundable) {
416
+ static GetFinalCustomerTotalsData(argRecordData, dupRecordData, isWorkOrder, detailedInfo, isRoundable, DecimalsNumber) {
417
417
  let CustomerAfterDiscTotals = this.GetCustSubTotal(dupRecordData.Ops, dupRecordData.Parts);
418
418
  let CustLaborTaxTotal = this.GetCustLaborTaxTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
419
419
  let CustPartTaxTotal = this.GetCustPartsTaxTotal(dupRecordData.Ops, dupRecordData.Parts, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
@@ -424,18 +424,18 @@ class ROTotalsService {
424
424
  argRecordData.STotal = (0, aggregation_1.addition)(CustLaborDiscTotal, CustPartsDiscTotal, CustLaborTotalAfterDisc, CustPartsTotalAfterDisc);
425
425
  argRecordData.CustLaborTotalBeforeDisc = (0, aggregation_1.addition)(argRecordData.CustLaborTotalAfterDisc, argRecordData.CustLaborDiscTotal);
426
426
  argRecordData.CustPartsTotalBeforeDisc = (0, aggregation_1.addition)(argRecordData.CustPartsTotalAfterDisc, argRecordData.CustPartsDiscTotal);
427
- argRecordData.SubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals);
427
+ argRecordData.SubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals, DecimalsNumber);
428
428
  let CustTotal = this.GetCustomerTotalBasedOnTaxType(dupRecordData, CustLaborTaxTotal, CustPartTaxTotal, dupRecordData.Ops, dupRecordData.Parts, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax));
429
429
  if (detailedInfo) {
430
- argRecordData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals);
431
- argRecordData.FixedTotal = tr_utils_1.TrUtils.FixedTo(CustTotal);
430
+ argRecordData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals, DecimalsNumber);
431
+ argRecordData.FixedTotal = tr_utils_1.TrUtils.FixedTo(CustTotal, DecimalsNumber);
432
432
  }
433
433
  if (isRoundable) {
434
434
  argRecordData.Round = (0, aggregation_1.subtraction)(Math.round(CustTotal), CustTotal);
435
435
  argRecordData.Total = Math.round(CustTotal);
436
436
  }
437
437
  else {
438
- argRecordData.Total = tr_utils_1.TrUtils.FixedTo(CustTotal);
438
+ argRecordData.Total = tr_utils_1.TrUtils.FixedTo(CustTotal, DecimalsNumber);
439
439
  }
440
440
  return argRecordData;
441
441
  }
@@ -549,14 +549,14 @@ class ROTotalsService {
549
549
  }
550
550
  return SubTotalWithTax;
551
551
  }
552
- static GetFinalInsuranceTotalsData(argRecordData, dupRecordData, detailedInfo, isWorkOrder) {
552
+ static GetFinalInsuranceTotalsData(argRecordData, dupRecordData, detailedInfo, isWorkOrder, DecimalsNumber) {
553
553
  let InsuranceAfterDiscTotals = this.GetInsSubTotal(dupRecordData.Ops, dupRecordData.Parts);
554
554
  let InsLaborTaxTotal = this.GetInsLaborTaxTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
555
555
  let InsPartTaxTotal = this.GetInsPartsTaxTotal(dupRecordData.Parts, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
556
556
  let InsTotal = this.GetInsuranceTotalBasedOnTaxType(InsuranceAfterDiscTotals, InsLaborTaxTotal, InsPartTaxTotal, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax));
557
- argRecordData.InsTotal = tr_utils_1.TrUtils.FixedTo(InsTotal);
557
+ argRecordData.InsTotal = tr_utils_1.TrUtils.FixedTo(InsTotal, DecimalsNumber);
558
558
  if (detailedInfo) {
559
- argRecordData.FixedInsTotal = tr_utils_1.TrUtils.FixedTo(InsTotal);
559
+ argRecordData.FixedInsTotal = tr_utils_1.TrUtils.FixedTo(InsTotal, DecimalsNumber);
560
560
  }
561
561
  return argRecordData;
562
562
  }
@@ -637,7 +637,7 @@ class ROTotalsService {
637
637
  }
638
638
  return InsTotal;
639
639
  }
640
- static GetDetailedTotalsData(argRecordData, dupRecordData, TaxCodes, isWorkOrder) {
640
+ static GetDetailedTotalsData(argRecordData, dupRecordData, TaxCodes, isWorkOrder, DecimalsNumber) {
641
641
  argRecordData.InsLaborDiscTotal = 0;
642
642
  argRecordData.InsPartsDiscTotal = 0;
643
643
  argRecordData.InsLaborTotalAfterDisc = this.GetInsLaborTotalAfterDiscount(dupRecordData.Ops);
@@ -674,10 +674,10 @@ class ROTotalsService {
674
674
  argRecordData.CustPartsAfterPDisc = argRecordData.CustPartsTotalAfterDisc;
675
675
  argRecordData.CustLaborAfterTax = (0, aggregation_1.addition)(argRecordData.CustLaborITax, argRecordData.CustLaborAfterLDisc);
676
676
  argRecordData.CustPartAfterTax = (0, aggregation_1.addition)(argRecordData.CustPartITax, argRecordData.CustPartsAfterPDisc);
677
- argRecordData.CustTaxGroupData = this.GetCustPartsTaxGrouping(dupRecordData.Parts, TaxCodes, isWorkOrder);
678
- argRecordData.InsTaxGroupData = this.GetInsPartsTaxGrouping(dupRecordData.Parts, TaxCodes);
677
+ argRecordData.CustTaxGroupData = this.GetCustPartsTaxGrouping(dupRecordData.Parts, TaxCodes, isWorkOrder, DecimalsNumber);
678
+ argRecordData.InsTaxGroupData = this.GetInsPartsTaxGrouping(dupRecordData.Parts, TaxCodes, DecimalsNumber);
679
679
  argRecordData.CustTotalRoundedBy = argRecordData.Round;
680
- argRecordData.InsTotalRoundedBy = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.subtraction)(Math.round(argRecordData.InsTotal), argRecordData.InsTotal));
680
+ argRecordData.InsTotalRoundedBy = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.subtraction)(Math.round(argRecordData.InsTotal), argRecordData.InsTotal), DecimalsNumber);
681
681
  argRecordData.CustRoundedTotal = argRecordData.Total;
682
682
  argRecordData.InsRoundedTotal = Math.round(argRecordData.InsTotal);
683
683
  for (var key in argRecordData) {
@@ -685,7 +685,7 @@ class ROTotalsService {
685
685
  key !== 'LDisc' && key !== 'LPerc' && key !== 'PDisc' &&
686
686
  key !== 'PPerc' && key !== 'Disc' && key !== 'Perc' && key !== 'Tax'
687
687
  && typeof argRecordData[key] === 'number') {
688
- argRecordData[key] = tr_utils_1.TrUtils.FixPriceValue(argRecordData[key]);
688
+ argRecordData[key] = tr_utils_1.TrUtils.FixPriceValue(argRecordData[key], DecimalsNumber);
689
689
  }
690
690
  }
691
691
  return argRecordData;
@@ -1053,9 +1053,9 @@ class ROTotalsService {
1053
1053
  }
1054
1054
  return PartsPDiscAmt;
1055
1055
  }
1056
- static GetCustPartsTaxGrouping(PartsList, TaxCodes, isWorkOrder) {
1056
+ static GetCustPartsTaxGrouping(PartsList, TaxCodes, isWorkOrder, DecimalsNumber) {
1057
1057
  let FilteredPartsList = this.GetCustParts(PartsList);
1058
- return this.GetCustTaxGroupingForPartsByHSN(FilteredPartsList, TaxCodes, isWorkOrder);
1058
+ return this.GetCustTaxGroupingForPartsByHSN(FilteredPartsList, TaxCodes, isWorkOrder, DecimalsNumber);
1059
1059
  }
1060
1060
  static GetCustParts(PartsList) {
1061
1061
  let FilteredPartsList = PartsList.filter((Part) => {
@@ -1063,13 +1063,13 @@ class ROTotalsService {
1063
1063
  });
1064
1064
  return FilteredPartsList;
1065
1065
  }
1066
- static GetCustTaxGroupingForPartsByHSN(Parts, TaxCodes, isWorkOrder) {
1066
+ static GetCustTaxGroupingForPartsByHSN(Parts, TaxCodes, isWorkOrder, DecimalsNumber) {
1067
1067
  Parts = this.GetCombinedTaxPercentage(Parts, TaxCodes);
1068
1068
  Parts = this.ResetPartsHSNIfInvalid(Parts);
1069
1069
  let FinalMatchedParts = this.ComparePartsByHSN(Parts, TaxCodes);
1070
- return this.GetCustTaxGroupingInfoByHSN(FinalMatchedParts, TaxCodes, isWorkOrder);
1070
+ return this.GetCustTaxGroupingInfoByHSN(FinalMatchedParts, TaxCodes, isWorkOrder, DecimalsNumber);
1071
1071
  }
1072
- static GetCustTaxGroupingInfoByHSN(FinalMatchedParts, TaxCodes, isWorkOrder) {
1072
+ static GetCustTaxGroupingInfoByHSN(FinalMatchedParts, TaxCodes, isWorkOrder, DecimalsNumber) {
1073
1073
  let HSNTaxInfo = [];
1074
1074
  FinalMatchedParts.forEach((MatchedPart) => {
1075
1075
  let TaxInfo = {};
@@ -1078,30 +1078,30 @@ class ROTotalsService {
1078
1078
  let HSN = MatchedPart[0].HSN;
1079
1079
  TaxInfo.CombinedTaxPercentage = MatchedPart[0].CombinedTaxPercentage;
1080
1080
  MatchedPart.forEach((argMatchedGSTPart) => {
1081
- TaxOnAmount = (0, aggregation_1.addition)(TaxOnAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CustAfterPartDisc));
1081
+ TaxOnAmount = (0, aggregation_1.addition)(TaxOnAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CustAfterPartDisc, DecimalsNumber));
1082
1082
  if (isWorkOrder) {
1083
- TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CCGST));
1084
- TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CIGST));
1085
- TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CSGST));
1083
+ TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CCGST, DecimalsNumber));
1084
+ TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CIGST, DecimalsNumber));
1085
+ TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CSGST, DecimalsNumber));
1086
1086
  }
1087
1087
  else {
1088
1088
  if (argMatchedGSTPart.Sts !== enums_1.LaborStatusEnum.New && argMatchedGSTPart.Sts !== enums_1.LaborStatusEnum.WtngForAppr) {
1089
- TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CCGST));
1090
- TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CIGST));
1091
- TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CSGST));
1089
+ TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CCGST, DecimalsNumber));
1090
+ TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CIGST, DecimalsNumber));
1091
+ TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CSGST, DecimalsNumber));
1092
1092
  }
1093
1093
  else {
1094
1094
  if (argMatchedGSTPart.PBy === enums_1.PayTypeEnum.Customer) {
1095
- TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.ECGST));
1096
- TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.EIGST));
1097
- TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.ESGST));
1095
+ TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.ECGST, DecimalsNumber));
1096
+ TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.EIGST, DecimalsNumber));
1097
+ TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.ESGST, DecimalsNumber));
1098
1098
  }
1099
1099
  }
1100
1100
  }
1101
1101
  });
1102
1102
  TaxInfo.HSN = HSN;
1103
- TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount);
1104
- TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount);
1103
+ TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount, DecimalsNumber);
1104
+ TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount, DecimalsNumber);
1105
1105
  TaxInfo.PartsCount = MatchedPart.length;
1106
1106
  let GSTValues = this.GetGSTValueBasedOnTaxCode(MatchedPart[0].TCode, TaxCodes);
1107
1107
  TaxInfo.CGST = GSTValues[0];
@@ -1113,9 +1113,9 @@ class ROTotalsService {
1113
1113
  });
1114
1114
  return HSNTaxInfo;
1115
1115
  }
1116
- static GetInsPartsTaxGrouping(PartsList, TaxCodes) {
1116
+ static GetInsPartsTaxGrouping(PartsList, TaxCodes, DecimalsNumber) {
1117
1117
  let FilteredPartsList = this.GetInsParts(PartsList);
1118
- return this.GetInsTaxGroupingForPartsByHSN(FilteredPartsList, TaxCodes);
1118
+ return this.GetInsTaxGroupingForPartsByHSN(FilteredPartsList, TaxCodes, DecimalsNumber);
1119
1119
  }
1120
1120
  static GetInsParts(PartsList) {
1121
1121
  let FilteredPartsList = PartsList.filter((Part) => {
@@ -1123,13 +1123,13 @@ class ROTotalsService {
1123
1123
  });
1124
1124
  return FilteredPartsList;
1125
1125
  }
1126
- static GetInsTaxGroupingForPartsByHSN(Parts, TaxCodes) {
1126
+ static GetInsTaxGroupingForPartsByHSN(Parts, TaxCodes, DecimalsNumber) {
1127
1127
  Parts = this.GetCombinedTaxPercentage(Parts, TaxCodes);
1128
1128
  Parts = this.ResetPartsHSNIfInvalid(Parts);
1129
1129
  let FinalMatchedParts = this.ComparePartsByHSN(Parts, TaxCodes);
1130
- return this.GetInsTaxGroupingInfoByHSN(FinalMatchedParts, TaxCodes);
1130
+ return this.GetInsTaxGroupingInfoByHSN(FinalMatchedParts, TaxCodes, DecimalsNumber);
1131
1131
  }
1132
- static GetInsTaxGroupingInfoByHSN(FinalMatchedParts, TaxCodes) {
1132
+ static GetInsTaxGroupingInfoByHSN(FinalMatchedParts, TaxCodes, DecimalsNumber) {
1133
1133
  let HSNTaxInfo = [];
1134
1134
  FinalMatchedParts.forEach((MatchedPart) => {
1135
1135
  let TaxInfo = {};
@@ -1138,23 +1138,23 @@ class ROTotalsService {
1138
1138
  let HSN = MatchedPart[0].HSN;
1139
1139
  TaxInfo.CombinedTaxPercentage = MatchedPart[0].CombinedTaxPercentage;
1140
1140
  MatchedPart.forEach((argMatchedGSTPart) => {
1141
- TaxOnAmount = (0, aggregation_1.addition)(TaxOnAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.InsAfterPartDisc));
1141
+ TaxOnAmount = (0, aggregation_1.addition)(TaxOnAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.InsAfterPartDisc, DecimalsNumber));
1142
1142
  if (argMatchedGSTPart.PBy === enums_1.PayTypeEnum.Insurance || argMatchedGSTPart.PBy === enums_1.PayTypeEnum.Shared) {
1143
1143
  if (argMatchedGSTPart.Sts !== enums_1.LaborStatusEnum.New && argMatchedGSTPart.Sts !== enums_1.LaborStatusEnum.WtngForAppr) {
1144
- TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.ACGST));
1145
- TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.AIGST));
1146
- TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.ASGST));
1144
+ TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.ACGST, DecimalsNumber));
1145
+ TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.AIGST, DecimalsNumber));
1146
+ TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.ASGST, DecimalsNumber));
1147
1147
  }
1148
1148
  else {
1149
- TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.ECGST));
1150
- TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.EIGST));
1151
- TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.ESGST));
1149
+ TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.ECGST, DecimalsNumber));
1150
+ TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.EIGST, DecimalsNumber));
1151
+ TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.ESGST, DecimalsNumber));
1152
1152
  }
1153
1153
  }
1154
1154
  });
1155
1155
  TaxInfo.HSN = HSN;
1156
- TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount);
1157
- TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount);
1156
+ TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount, DecimalsNumber);
1157
+ TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount, DecimalsNumber);
1158
1158
  TaxInfo.PartsCount = MatchedPart.length;
1159
1159
  let GSTValues = this.GetGSTValueBasedOnTaxCode(MatchedPart[0].TCode, TaxCodes);
1160
1160
  TaxInfo.CGST = GSTValues[0];
@@ -333,7 +333,7 @@ class WOPrintService {
333
333
  static CommonTotalDetails(ROPrintData, index, numberofCopies) {
334
334
  let CommonDetails = [
335
335
  shared_pdf_service_1.SharedPDFService.GetFinalTotalDetails(ROPrintData, ROPrintData.CustLaborTotalBeforeDisc, ROPrintData.CustLaborDiscTotal, ROPrintData.CustLaborCGST, ROPrintData.CustLaborSGST, ROPrintData.CustLaborIGST, ROPrintData.CustPartIGST, ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn, ROPrintData.CustPartsTotalBeforeDisc, ROPrintData.CustPartsDiscTotal, ROPrintData.CustPartCGST, ROPrintData.CustPartSGST, ROPrintData.CustTaxGroupData, ROPrintData.ShowAccParts, ROPrintData.CustLaborAfterTax, ROPrintData.CustPartAfterTax, ROPrintData.FixedDisc, ROPrintData.Payee, ROPrintData.FixedTotal, ROPrintData.CustTotalRoundedBy, ROPrintData.CustRoundedTotal, ROPrintData.ShowDetailedLaborTaxInfo, ROPrintData.ShowDetailedPartTaxInfo, tr_utils_1.TrUtils.isTaxable(ROPrintData.Settings.Tax), ROPrintData.CustLaborITax, ROPrintData.CustPartITax, ROPrintData.Consolidate, ROPrintData.From, null, null, false),
336
- shared_pdf_service_1.SharedPDFService.InvoiceDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts, false),
336
+ shared_pdf_service_1.SharedPDFService.InvoiceDueStatus(ROPrintData.Type, ROPrintData.Paid, ROPrintData.Due, ROPrintData.Sts, false, ROPrintData.Entity.DecimalsNumber),
337
337
  shared_pdf_service_1.SharedPDFService.GetTemsAndConditions(ROPrintData.Entity.Terms),
338
338
  shared_pdf_service_1.SharedPDFService.GetUnderLine(),
339
339
  shared_pdf_service_1.SharedPDFService.GetSignatures(ROPrintData.Entity.CName, ROPrintData.Type, ROPrintData.Payee),
@@ -533,7 +533,7 @@ export declare class SharedPDFService {
533
533
  })[];
534
534
  marginLeft: number;
535
535
  };
536
- static DebitGrandTotal(RecordData: any, LaborAfterGST: any, PartsAfterGST: any, OverAllRecordDiscount: any, totalTax: any, For: any, OverAllRecordTotal: any, Rounded: any, GrandTotal: any, moreDiscDetails: boolean): {
536
+ static DebitGrandTotal(RecordData: any, LaborAfterGST: any, PartsAfterGST: any, OverAllRecordDiscount: any, totalTax: any, For: any, OverAllRecordTotal: any, Rounded: any, GrandTotal: any, moreDiscDetails: boolean, DecimalsNumber: number): {
537
537
  style: string[];
538
538
  lineHeight: number;
539
539
  marginBottom: number;
@@ -566,7 +566,7 @@ export declare class SharedPDFService {
566
566
  };
567
567
  static GetTaxOnParts(BasicPartsTotal: any, OverAllMainPartsDiscount: any, PCGST: any, PSGST: any, ShowAccParts: any, PIGST: any, ShowIGST: any, ShowTaxColumn: any, ShowDetailedPartTaxInfo: any, From: string, Consolidate: boolean): any;
568
568
  static GetTaxOnLabor(BasicLaborTotal: any, OverAllMainLaborDiscount: any, LCGST: any, LSGST: any, LIGST: any, ShowIGST: any, ShowTaxColumn: any, ShowDetailedLaborTaxInfo: any, Consolidate: boolean): any;
569
- static GrandTotal(RecordData: any, LaborAfterGST: any, PartsAfterGST: any, OverAllRecordDiscount: any, totalTax: any, For: any, OverAllRecordTotal: any, Rounded: any, GrandTotal: any, Adj: any, Consolidate: any, subTotal: any, moreDiscDetails: boolean): {
569
+ static GrandTotal(RecordData: any, LaborAfterGST: any, PartsAfterGST: any, OverAllRecordDiscount: any, totalTax: any, For: any, OverAllRecordTotal: any, Rounded: any, GrandTotal: any, Adj: any, Consolidate: any, subTotal: any, moreDiscDetails: boolean, DecimalsNumber: number): {
570
570
  style: string[];
571
571
  lineHeight: number;
572
572
  marginBottom: number;
@@ -586,7 +586,7 @@ export declare class SharedPDFService {
586
586
  layout: string;
587
587
  };
588
588
  static GrandTotalTable(data: any): any;
589
- static InvoiceDueStatus(Type: any, Paid: any, Due: any, Status: any, isCounter: boolean): any;
589
+ static InvoiceDueStatus(Type: any, Paid: any, Due: any, Status: any, isCounter: boolean, DecimalsNumber: number): any;
590
590
  static DebitDueStatus(Type: any, Paid: any, Due: any, Status: any): {
591
591
  fontSize: number;
592
592
  marginTop: number;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SharedPDFService = void 0;
4
+ const aggregation_1 = require("../aggregation/aggregation");
4
5
  const enums_1 = require("../enums/enums");
5
6
  const my_date_1 = require("../utils/my-date");
6
7
  const tr_utils_1 = require("../utils/tr-utils");
@@ -1576,12 +1577,12 @@ class SharedPDFService {
1576
1577
  let totalDisc;
1577
1578
  let totalTax;
1578
1579
  if (!Consolidate) {
1579
- totalTax = tr_utils_1.TrUtils.FixPriceValue(Number(LaborTotalTax) + Number(PartTotalTax));
1580
+ totalTax = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.addition)(Number(LaborTotalTax), Number(PartTotalTax)), RecordData.Entity.DecimalsNumber);
1580
1581
  if (istaxable) {
1581
- totalDisc = tr_utils_1.TrUtils.FixPriceValue(Number(OverAllMainLaborDiscount) + Number(OverAllMainPartsDiscount));
1582
+ totalDisc = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.addition)(Number(OverAllMainLaborDiscount), Number(OverAllMainPartsDiscount)), RecordData.Entity.DecimalsNumber);
1582
1583
  }
1583
1584
  else {
1584
- totalDisc = tr_utils_1.TrUtils.FixPriceValue(Number(OverAllMainLaborDiscount) + Number(OverAllMainPartsDiscount));
1585
+ totalDisc = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.addition)(Number(OverAllMainLaborDiscount), Number(OverAllMainPartsDiscount)), RecordData.Entity.DecimalsNumber);
1585
1586
  }
1586
1587
  }
1587
1588
  let serviceName;
@@ -1626,27 +1627,27 @@ class SharedPDFService {
1626
1627
  ];
1627
1628
  if (moreDiscDetails) {
1628
1629
  if (!tr_utils_1.TrUtils.IsZero(RecordData.PDisc)) {
1629
- AccountFields.push({ name: 'Items Discount', value: tr_utils_1.TrUtils.FixPriceValue(RecordData.PDisc) });
1630
+ AccountFields.push({ name: 'Items Discount', value: tr_utils_1.TrUtils.FixPriceValue(RecordData.PDisc, RecordData.Entity.DecimalsNumber) });
1630
1631
  }
1631
1632
  if (!tr_utils_1.TrUtils.IsZero(RecordData.LDisc)) {
1632
- AccountFields.push({ name: 'Services Discount', value: tr_utils_1.TrUtils.FixPriceValue(RecordData.LDisc) });
1633
+ AccountFields.push({ name: 'Services Discount', value: tr_utils_1.TrUtils.FixPriceValue(RecordData.LDisc, RecordData.Entity.DecimalsNumber) });
1633
1634
  }
1634
1635
  if (!tr_utils_1.TrUtils.IsZero(RecordData.Disc)) {
1635
- AccountFields.push({ name: 'Overall Discount', value: tr_utils_1.TrUtils.FixPriceValue(RecordData.Disc) });
1636
+ AccountFields.push({ name: 'Overall Discount', value: tr_utils_1.TrUtils.FixPriceValue(RecordData.Disc, RecordData.Entity.DecimalsNumber) });
1636
1637
  }
1637
1638
  }
1638
1639
  else {
1639
1640
  AccountFields.push({ name: 'Discount', value: OverAllRecordDiscount });
1640
1641
  }
1641
1642
  if (!Consolidate) {
1642
- AccountFields.unshift({ name: 'SubTotal', value: tr_utils_1.TrUtils.FixPriceValue(STotal) });
1643
+ AccountFields.unshift({ name: 'SubTotal', value: tr_utils_1.TrUtils.FixPriceValue(STotal, RecordData.Entity.DecimalsNumber) });
1643
1644
  }
1644
1645
  if (!tr_utils_1.TrUtils.IsEmpty(totalTax)) {
1645
1646
  AccountFields.push({ name: 'Total Tax', value: totalTax });
1646
1647
  }
1647
1648
  if (!tr_utils_1.TrUtils.IsEmpty(Adj)) {
1648
1649
  if (Adj > 0) {
1649
- Adj = '+' + tr_utils_1.TrUtils.FixPriceValue(Adj);
1650
+ Adj = '+' + tr_utils_1.TrUtils.FixPriceValue(Adj, RecordData.Entity.DecimalsNumber);
1650
1651
  }
1651
1652
  AccountFields.push({ name: 'Adjust', value: Adj });
1652
1653
  }
@@ -1705,12 +1706,12 @@ class SharedPDFService {
1705
1706
  let totalDisc;
1706
1707
  let totalTax;
1707
1708
  if (!Consolidate) {
1708
- totalTax = tr_utils_1.TrUtils.FixPriceValue(Number(LaborTotalTax) + Number(PartTotalTax));
1709
+ totalTax = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.addition)(Number(LaborTotalTax), Number(PartTotalTax)), RecordData.Entity.DecimalsNumber);
1709
1710
  if (istaxable) {
1710
- totalDisc = tr_utils_1.TrUtils.FixPriceValue(Number(OverAllMainLaborDiscount) + Number(OverAllMainPartsDiscount));
1711
+ totalDisc = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.addition)(Number(OverAllMainLaborDiscount), Number(OverAllMainPartsDiscount)), RecordData.Entity.DecimalsNumber);
1711
1712
  }
1712
1713
  else {
1713
- totalDisc = tr_utils_1.TrUtils.FixPriceValue(Number(OverAllMainLaborDiscount) + Number(OverAllMainPartsDiscount));
1714
+ totalDisc = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.addition)(Number(OverAllMainLaborDiscount), Number(OverAllMainPartsDiscount)), RecordData.Entity.DecimalsNumber);
1714
1715
  }
1715
1716
  }
1716
1717
  return {
@@ -1725,7 +1726,7 @@ class SharedPDFService {
1725
1726
  },
1726
1727
  { text: '', width: moreDiscDetails ? 40 : 60 },
1727
1728
  // this.GrandTotal(LaborAfterGST, PartsAfterGST, totalDisc, For, OverAllRecordTotal, Rounded, GrandTotal)
1728
- this.GrandTotal(RecordData, BasicLaborTotal, BasicPartsTotal, totalDisc, totalTax, For, OverAllRecordTotal, Rounded, GrandTotal, Adj, Consolidate, STotal, moreDiscDetails)
1729
+ this.GrandTotal(RecordData, BasicLaborTotal, BasicPartsTotal, totalDisc, totalTax, For, OverAllRecordTotal, Rounded, GrandTotal, Adj, Consolidate, STotal, moreDiscDetails, RecordData)
1729
1730
  ]
1730
1731
  // columnGap: 40
1731
1732
  ,
@@ -1736,12 +1737,12 @@ class SharedPDFService {
1736
1737
  let totalDisc;
1737
1738
  let totalTax;
1738
1739
  if (!Consolidate) {
1739
- totalTax = tr_utils_1.TrUtils.FixPriceValue(Number(PartTotalTax));
1740
+ totalTax = tr_utils_1.TrUtils.FixPriceValue(Number(PartTotalTax), RecordData.Entity.DecimalsNumber);
1740
1741
  if (istaxable) {
1741
- totalDisc = tr_utils_1.TrUtils.FixPriceValue(Number(OverAllMainPartsDiscount));
1742
+ totalDisc = tr_utils_1.TrUtils.FixPriceValue(Number(OverAllMainPartsDiscount), RecordData.Entity.DecimalsNumber);
1742
1743
  }
1743
1744
  else {
1744
- totalDisc = tr_utils_1.TrUtils.FixPriceValue(Number(OverAllMainPartsDiscount));
1745
+ totalDisc = tr_utils_1.TrUtils.FixPriceValue(Number(OverAllMainPartsDiscount), RecordData.Entity.DecimalsNumber);
1745
1746
  }
1746
1747
  }
1747
1748
  return {
@@ -1757,21 +1758,21 @@ class SharedPDFService {
1757
1758
  },
1758
1759
  { text: '', width: 100 },
1759
1760
  { text: '', width: 80 },
1760
- this.DebitGrandTotal(RecordData, BasicLaborTotal, BasicPartsTotal, totalDisc, totalTax, For, OverAllRecordTotal, Rounded, GrandTotal, moreDiscDetails)
1761
+ this.DebitGrandTotal(RecordData, BasicLaborTotal, BasicPartsTotal, totalDisc, totalTax, For, OverAllRecordTotal, Rounded, GrandTotal, moreDiscDetails, RecordData.Entity.DecimalsNumber)
1761
1762
  ]
1762
1763
  // columnGap: 40
1763
1764
  ,
1764
1765
  marginLeft: 10
1765
1766
  };
1766
1767
  }
1767
- static DebitGrandTotal(RecordData, LaborAfterGST, PartsAfterGST, OverAllRecordDiscount, totalTax, For, OverAllRecordTotal, Rounded, GrandTotal, moreDiscDetails) {
1768
+ static DebitGrandTotal(RecordData, LaborAfterGST, PartsAfterGST, OverAllRecordDiscount, totalTax, For, OverAllRecordTotal, Rounded, GrandTotal, moreDiscDetails, DecimalsNumber) {
1768
1769
  let AccountFields = [
1769
1770
  // { name: 'Labor Total', value: LaborAfterGST },
1770
1771
  // { name: 'Part Total', value: PartsAfterGST },
1771
- { name: 'SubTotal', value: tr_utils_1.TrUtils.FixPriceValue(tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(PartsAfterGST))) },
1772
+ { name: 'SubTotal', value: tr_utils_1.TrUtils.FixPriceValue(tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(PartsAfterGST)), DecimalsNumber) },
1772
1773
  ];
1773
1774
  if (moreDiscDetails) {
1774
- AccountFields.push({ name: 'Overall Discount', value: tr_utils_1.TrUtils.FixPriceValue(RecordData.Disc) });
1775
+ AccountFields.push({ name: 'Overall Discount', value: tr_utils_1.TrUtils.FixPriceValue(RecordData.Disc, DecimalsNumber) });
1775
1776
  }
1776
1777
  else {
1777
1778
  AccountFields.push({ name: 'Discount', value: OverAllRecordDiscount });
@@ -1838,7 +1839,7 @@ class SharedPDFService {
1838
1839
  this.GetTaxOnParts(ROPrintData.BasicPartsTotal, ROPrintData.OverAllMainPartsDiscount, ROPrintData.PCGST, ROPrintData.PSGST, ROPrintData.PIGST, ROPrintData.ShowIGST, ROPrintData.ShowAccParts, ROPrintData.ShowTaxColumn, ROPrintData.ShowDetailedPartTaxInfo, ROPrintData.Type, ROPrintData.Consolidate),
1839
1840
  this.PartsTaxAmounts(ROPrintData.PartsTaxInfo, ROPrintData.ShowAccParts, ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn)
1840
1841
  ]
1841
- }, { text: '', width: 200 }, this.GrandTotal(ROPrintData, ROPrintData.LaborAfterGST, ROPrintData.PartsAfterGST, ROPrintData.OverAllRecordDiscount, null, ROPrintData.For, ROPrintData.OverAllRecordTotal, ROPrintData.Rounded, ROPrintData.GrandTotal, ROPrintData.Adj, ROPrintData.Consolidate, null, moreDiscDetails)
1842
+ }, { text: '', width: 200 }, this.GrandTotal(ROPrintData, ROPrintData.LaborAfterGST, ROPrintData.PartsAfterGST, ROPrintData.OverAllRecordDiscount, null, ROPrintData.For, ROPrintData.OverAllRecordTotal, ROPrintData.Rounded, ROPrintData.GrandTotal, ROPrintData.Adj, ROPrintData.Consolidate, null, moreDiscDetails, ROPrintData.Entity.DecimalsNumber)
1842
1843
  ]
1843
1844
  // columnGap: 40
1844
1845
  ,
@@ -1930,31 +1931,31 @@ class SharedPDFService {
1930
1931
  return this.emptyObject();
1931
1932
  }
1932
1933
  }
1933
- static GrandTotal(RecordData, LaborAfterGST, PartsAfterGST, OverAllRecordDiscount, totalTax, For, OverAllRecordTotal, Rounded, GrandTotal, Adj, Consolidate, subTotal, moreDiscDetails) {
1934
+ static GrandTotal(RecordData, LaborAfterGST, PartsAfterGST, OverAllRecordDiscount, totalTax, For, OverAllRecordTotal, Rounded, GrandTotal, Adj, Consolidate, subTotal, moreDiscDetails, DecimalsNumber) {
1934
1935
  let AccountFields = [
1935
1936
  // { name: 'Labor Total', value: LaborAfterGST },
1936
1937
  // { name: 'Part Total', value: PartsAfterGST },
1937
1938
  ];
1938
1939
  if (moreDiscDetails) {
1939
1940
  if (!tr_utils_1.TrUtils.IsZero(RecordData.PDisc)) {
1940
- AccountFields.push({ name: 'Items Discount', value: tr_utils_1.TrUtils.FixPriceValue(RecordData.PDisc) });
1941
+ AccountFields.push({ name: 'Items Discount', value: tr_utils_1.TrUtils.FixPriceValue(RecordData.PDisc, DecimalsNumber) });
1941
1942
  }
1942
1943
  if (!tr_utils_1.TrUtils.IsZero(RecordData.LDisc)) {
1943
- AccountFields.push({ name: 'Services Discount', value: tr_utils_1.TrUtils.FixPriceValue(RecordData.LDisc) });
1944
+ AccountFields.push({ name: 'Services Discount', value: tr_utils_1.TrUtils.FixPriceValue(RecordData.LDisc, DecimalsNumber) });
1944
1945
  }
1945
1946
  if (!tr_utils_1.TrUtils.IsZero(RecordData.Disc)) {
1946
- AccountFields.push({ name: 'Overall Discount', value: tr_utils_1.TrUtils.FixPriceValue(RecordData.Disc) });
1947
+ AccountFields.push({ name: 'Overall Discount', value: tr_utils_1.TrUtils.FixPriceValue(RecordData.Disc, DecimalsNumber) });
1947
1948
  }
1948
1949
  }
1949
1950
  else {
1950
1951
  AccountFields.push({ name: 'Discount', value: OverAllRecordDiscount });
1951
1952
  }
1952
1953
  if (!Consolidate && !tr_utils_1.TrUtils.IsNull(subTotal)) {
1953
- AccountFields.unshift({ name: 'SubTotal', value: tr_utils_1.TrUtils.FixPriceValue(tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(subTotal))) });
1954
+ AccountFields.unshift({ name: 'SubTotal', value: tr_utils_1.TrUtils.FixPriceValue(tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(subTotal)), DecimalsNumber) });
1954
1955
  }
1955
1956
  else {
1956
1957
  if (!Consolidate) {
1957
- AccountFields.unshift({ name: 'SubTotal', value: tr_utils_1.TrUtils.FixPriceValue(tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(LaborAfterGST)) + tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(PartsAfterGST))) });
1958
+ AccountFields.unshift({ name: 'SubTotal', value: tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.addition)(tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(LaborAfterGST)), tr_utils_1.TrUtils.SetValueToZeroIfNull(Number(PartsAfterGST))), DecimalsNumber) });
1958
1959
  }
1959
1960
  }
1960
1961
  if (!tr_utils_1.TrUtils.IsEmpty(totalTax)) {
@@ -1962,7 +1963,7 @@ class SharedPDFService {
1962
1963
  }
1963
1964
  if (!tr_utils_1.TrUtils.IsEmpty(Adj)) {
1964
1965
  if (Adj > 0) {
1965
- Adj = '+' + tr_utils_1.TrUtils.FixPriceValue(Adj);
1966
+ Adj = '+' + tr_utils_1.TrUtils.FixPriceValue(Adj, DecimalsNumber);
1966
1967
  }
1967
1968
  AccountFields.push({ name: 'Adjust', value: Adj });
1968
1969
  }
@@ -2083,7 +2084,7 @@ class SharedPDFService {
2083
2084
  });
2084
2085
  return body;
2085
2086
  }
2086
- static InvoiceDueStatus(Type, Paid, Due, Status, isCounter) {
2087
+ static InvoiceDueStatus(Type, Paid, Due, Status, isCounter, DecimalsNumber) {
2087
2088
  if (Type === 'Invoice' && !isCounter) {
2088
2089
  return {
2089
2090
  // lineHeight: 0.7,
@@ -2092,8 +2093,8 @@ class SharedPDFService {
2092
2093
  marginBottom: 5,
2093
2094
  table: {
2094
2095
  widths: [200, 174, 174],
2095
- body: [[{ text: 'Paid : ' + tr_utils_1.TrUtils.FixPriceValue(Paid) },
2096
- { text: 'Due : ' + tr_utils_1.TrUtils.FixPriceValue(Due) },
2096
+ body: [[{ text: 'Paid : ' + tr_utils_1.TrUtils.FixPriceValue(Paid, DecimalsNumber) },
2097
+ { text: 'Due : ' + tr_utils_1.TrUtils.FixPriceValue(Due, DecimalsNumber) },
2097
2098
  { text: 'Status : ' + Status }]]
2098
2099
  },
2099
2100
  layout: this.LayOutStyle(),
@@ -5,7 +5,7 @@ export declare class TrUtils {
5
5
  static IsFixedZero(Value: any): boolean;
6
6
  static Stringify(RecordData: any): any;
7
7
  static ConcatObjects(obj1: any, obj2: any): any;
8
- static ConvertPercToVal(Discount: any, Total: any): number | null;
8
+ static ConvertPercToVal(Discount: any, Total: any, DecimalsNumber?: number): number | null;
9
9
  static FixedTo(value: any, DecimalsNumber?: number): number;
10
10
  static FixPriceValue(Value: any, DecimalsNumber?: number): string;
11
11
  static SetValueToZeroIfNull(Value: any): any;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.TrUtils = void 0;
4
+ const aggregation_1 = require("../aggregation/aggregation");
4
5
  class TrUtils {
5
6
  // static DecimalsNumber:number=2;
6
7
  static IsNull(Value) {
@@ -29,7 +30,7 @@ class TrUtils {
29
30
  }
30
31
  return obj1;
31
32
  }
32
- static ConvertPercToVal(Discount, Total) {
33
+ static ConvertPercToVal(Discount, Total, DecimalsNumber = 2) {
33
34
  if (this.IsNull(Total)) {
34
35
  return null;
35
36
  }
@@ -40,7 +41,7 @@ class TrUtils {
40
41
  if (this.IsNull(Total)) {
41
42
  Total = 0;
42
43
  }
43
- let value = this.FixedTo(((Total * Discount) / 100));
44
+ let value = this.FixedTo((0, aggregation_1.division)((0, aggregation_1.multiply)(Total, Discount), 100), DecimalsNumber);
44
45
  if (isNaN(value)) {
45
46
  value = 0;
46
47
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.4.49",
3
+ "version": "1.4.51",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",