shareneus 1.4.47 → 1.4.49

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 (96) hide show
  1. package/dist/accounting/counter-sales/auto-sales-receipt-pdf.service.js +1 -1
  2. package/dist/accounting/counter-sales/sales-receipt-print.service.d.ts +3 -3
  3. package/dist/accounting/counter-sales/sales-receipt-print.service.js +31 -30
  4. package/dist/accounting/credit-note/cn-print.service.d.ts +1 -2
  5. package/dist/accounting/credit-note/cn-print.service.js +10 -32
  6. package/dist/accounting/credit-note/credit-note-totals.service.d.ts +6 -6
  7. package/dist/accounting/credit-note/credit-note-totals.service.js +19 -19
  8. package/dist/accounting/debit-note/debit-note-print.service.d.ts +2 -2
  9. package/dist/accounting/debit-note/debit-note-print.service.js +15 -15
  10. package/dist/accounting/debit-note/debit-note-totals.service.d.ts +6 -6
  11. package/dist/accounting/debit-note/debit-note-totals.service.js +18 -18
  12. package/dist/accounting/invoice/hc-inv-pdf.service.d.ts +7 -7
  13. package/dist/accounting/invoice/hc-inv-pdf.service.js +36 -36
  14. package/dist/accounting/invoice/inv-pdf.service.d.ts +6 -6
  15. package/dist/accounting/invoice/inv-pdf.service.js +44 -44
  16. package/dist/accounting/invoice/inv-print.service.d.ts +3 -3
  17. package/dist/accounting/invoice/inv-print.service.js +24 -24
  18. package/dist/accounting/invoice/invoice-letterhead-pdf.service.d.ts +6 -6
  19. package/dist/accounting/invoice/invoice-letterhead-pdf.service.js +44 -44
  20. package/dist/accounting/invoice/invoice-total.service.d.ts +11 -11
  21. package/dist/accounting/invoice/invoice-total.service.js +54 -54
  22. package/dist/accounting/invoice/reports/excel/analysis-excel.service.d.ts +3 -3
  23. package/dist/accounting/invoice/reports/excel/analysis-excel.service.js +6 -6
  24. package/dist/accounting/invoice/reports/pdf/analysis-pdf.service.d.ts +4 -4
  25. package/dist/accounting/invoice/reports/pdf/analysis-pdf.service.js +10 -9
  26. package/dist/accounting/invoice/reports/pdf/category-wise-item-pdf.service.js +0 -2
  27. package/dist/accounting/invoice/reports/pdf/cust-wise-sales-details-pdf.service.js +0 -2
  28. package/dist/accounting/invoice/reports/pdf/cust-wise-sales-summary-pdf.service.js +0 -2
  29. package/dist/accounting/invoice/reports/pdf/item-wise-doctor-sale-pdf.service.js +0 -2
  30. package/dist/accounting/invoice/reports/pdf/item-wise-sales-pdf.service.js +0 -2
  31. package/dist/accounting/invoice/reports/pdf/manf-wise-sales-pdf.service.js +0 -2
  32. package/dist/accounting/invoice/reports/pdf/operator-wise-details-pdf.service.js +0 -2
  33. package/dist/accounting/invoice/reports/pdf/operator-wise-summary-pdf.js +0 -2
  34. package/dist/accounting/invoice/reports/pdf/sales-by-service-pdf.service.js +0 -2
  35. package/dist/accounting/invoice/reports/pdf/scheduled-drug-pdf.service.js +0 -2
  36. package/dist/accounting/invoice/reports/pdf/scheduled-drug-summary-pdf.service.js +0 -2
  37. package/dist/accounting/invoice/shared-inv-pdf.service.d.ts +6 -6
  38. package/dist/accounting/invoice/shared-inv-pdf.service.js +30 -30
  39. package/dist/accounting/payment-receive/reports/pdf/customer-balances-pdf.service.d.ts +1 -1
  40. package/dist/accounting/payment-receive/reports/pdf/customer-balances-pdf.service.js +3 -3
  41. package/dist/accounting/payment-receive/reports/pdf/payment-report-pdf.service.d.ts +4 -4
  42. package/dist/accounting/payment-receive/reports/pdf/payment-report-pdf.service.js +9 -11
  43. package/dist/appointments/appointments/appointment-total.service.d.ts +6 -6
  44. package/dist/appointments/appointments/appointment-total.service.js +28 -29
  45. package/dist/appointments/consultations/consultation-fee-receipt.service.d.ts +1 -1
  46. package/dist/appointments/consultations/consultation-fee-receipt.service.js +3 -3
  47. package/dist/appointments/consultations/consultation-full-pdf.service.d.ts +2 -2
  48. package/dist/appointments/consultations/consultation-full-pdf.service.js +7 -7
  49. package/dist/appointments/consultations/consultation-letterhead-pdf.service.d.ts +2 -3
  50. package/dist/appointments/consultations/consultation-letterhead-pdf.service.js +7 -15
  51. package/dist/appointments/consultations/consultation-pdf.service.d.ts +2 -3
  52. package/dist/appointments/consultations/consultation-pdf.service.js +14 -15
  53. package/dist/inventory/items/issue-parts-pdf.service.js +1 -1
  54. package/dist/inventory/items/reports/pdf/expiring-drugs-pdf.service.d.ts +1 -1
  55. package/dist/inventory/items/reports/pdf/expiring-drugs-pdf.service.js +4 -4
  56. package/dist/inventory/items/reports/pdf/item-wise-mout-details-pdf.js +0 -2
  57. package/dist/inventory/items/reports/pdf/item-wise-mout-summary-pdf.js +0 -2
  58. package/dist/inventory/items/reports/pdf/reorder-point-pdf.service.js +1 -1
  59. package/dist/inventory/transfer-order/transfer-order-pdf.service.js +1 -2
  60. package/dist/purchases/payment-made/reports/pdf/vendor-balances-pdf.service.d.ts +1 -1
  61. package/dist/purchases/payment-made/reports/pdf/vendor-balances-pdf.service.js +3 -3
  62. package/dist/purchases/purchase-order/po-totals.service.d.ts +7 -7
  63. package/dist/purchases/purchase-order/po-totals.service.js +24 -25
  64. package/dist/purchases/purchase-order/purchase-order-print.service.js +3 -3
  65. package/dist/purchases/purchase-order/purchase-order-totals.service.d.ts +10 -10
  66. package/dist/purchases/purchase-order/purchase-order-totals.service.js +27 -27
  67. package/dist/purchases/vendor-debit-note/vendor-debit-note-print.service.d.ts +1 -2
  68. package/dist/purchases/vendor-debit-note/vendor-debit-note-print.service.js +10 -32
  69. package/dist/sales/delivery-challan/delivery-challan-print.service.d.ts +1 -2
  70. package/dist/sales/delivery-challan/delivery-challan-print.service.js +9 -32
  71. package/dist/sales/sales/sales-print.service.d.ts +2 -2
  72. package/dist/sales/sales/sales-print.service.js +17 -17
  73. package/dist/services/est.print-service.d.ts +18 -18
  74. package/dist/services/est.print-service.js +132 -132
  75. package/dist/services/reports/pdf/next-service-date-pdf.service.js +0 -2
  76. package/dist/services/reports/pdf/repair-orders-pdf.service.js +0 -1
  77. package/dist/services/ro-print-service.d.ts +6 -6
  78. package/dist/services/ro-print-service.js +39 -39
  79. package/dist/services/separate-wo-print.service.d.ts +1 -1
  80. package/dist/services/separate-wo-print.service.js +4 -4
  81. package/dist/shared/shared-pdf.service.d.ts +0 -16
  82. package/dist/shared/shared-pdf.service.js +36 -34
  83. package/dist/shared/shared-print.service.js +3 -1
  84. package/dist/tasks/meetings/meeting-pdf.d.ts +4 -4
  85. package/dist/tasks/meetings/meeting-pdf.js +9 -9
  86. package/dist/tasks/tasks/task-pdf.service.d.ts +4 -4
  87. package/dist/tasks/tasks/task-pdf.service.js +8 -8
  88. package/dist/tasks/tasks/task-reports-pdf.service.d.ts +6 -6
  89. package/dist/tasks/tasks/task-reports-pdf.service.js +14 -14
  90. package/dist/utils/my-date.d.ts +6 -7
  91. package/dist/utils/my-date.js +16 -16
  92. package/dist/utils/tr-utils.d.ts +2 -3
  93. package/dist/utils/tr-utils.js +5 -5
  94. package/package.json +1 -1
  95. package/dist/shared/shared-pdfs/shared-pdf.service.d.ts +0 -926
  96. package/dist/shared/shared-pdfs/shared-pdf.service.js +0 -2608
@@ -4,11 +4,11 @@ exports.POTotalsService = void 0;
4
4
  const aggregation_1 = require("../../aggregation/aggregation");
5
5
  const tr_utils_1 = require("../../utils/tr-utils");
6
6
  class POTotalsService {
7
- static GetTotalsValue(ItemsList, IsIndependentTax, DetailedInfo, Disc, Perc, TaxCodes, WithItems) {
7
+ static GetTotalsValue(ItemsList, IsIndependentTax, DetailedInfo, Disc, Perc, TaxCodes, WithItems, EntitySettings) {
8
8
  ItemsList = this.CalculateItemValues(ItemsList);
9
- let finalTotalsData = this.GetFinalPODataForSave(ItemsList, IsIndependentTax, Disc, Perc, DetailedInfo);
9
+ let finalTotalsData = this.GetFinalPODataForSave(ItemsList, IsIndependentTax, Disc, Perc, DetailedInfo, EntitySettings.DecimalsNumber);
10
10
  if (DetailedInfo) {
11
- finalTotalsData = this.GetDetailedTotalsData(finalTotalsData, IsIndependentTax, ItemsList, TaxCodes);
11
+ finalTotalsData = this.GetDetailedTotalsData(finalTotalsData, IsIndependentTax, ItemsList, TaxCodes, EntitySettings.DecimalsNumber);
12
12
  }
13
13
  if (WithItems) {
14
14
  finalTotalsData.Items = ItemsList;
@@ -48,10 +48,10 @@ class POTotalsService {
48
48
  static GetItemTotalAfterDiscount(Price, Qty, Disc, DiscInPerc) {
49
49
  return ((Price * Qty) - this.GetItemDiscountedPrice(Price, Qty, Disc, DiscInPerc));
50
50
  }
51
- static GetFinalPODataForSave(ItemsList, IsIndependentTax, Disc, Perc, DetailedInfo) {
51
+ static GetFinalPODataForSave(ItemsList, IsIndependentTax, Disc, Perc, DetailedInfo, DecimalsNumber) {
52
52
  let finalTotalsData = {};
53
53
  finalTotalsData = this.ResetRecordDiscountsIfInvalid(Disc, Perc, finalTotalsData, DetailedInfo);
54
- finalTotalsData = this.GetFinalTotalsData(finalTotalsData, ItemsList, IsIndependentTax, Disc, Perc, DetailedInfo);
54
+ finalTotalsData = this.GetFinalTotalsData(finalTotalsData, ItemsList, IsIndependentTax, Disc, Perc, DetailedInfo, DecimalsNumber);
55
55
  return finalTotalsData;
56
56
  }
57
57
  static ResetRecordDiscountsIfInvalid(Disc, Perc, finalTotalsData, DetailedInfo) {
@@ -64,16 +64,16 @@ class POTotalsService {
64
64
  }
65
65
  return finalTotalsData;
66
66
  }
67
- static GetFinalTotalsData(finalTotalsData, ItemsList, IsIndependentTax, Disc, Perc, DetailedInfo) {
67
+ static GetFinalTotalsData(finalTotalsData, ItemsList, IsIndependentTax, Disc, Perc, DetailedInfo, DecimalsNumber) {
68
68
  let AfterDiscTotals = this.GetSubTotal(ItemsList);
69
69
  let ItemTaxTotal = this.GetItemsTaxTotal(ItemsList, IsIndependentTax);
70
- finalTotalsData.SubTotal = tr_utils_1.TrUtils.FixedTo(AfterDiscTotals);
70
+ finalTotalsData.SubTotal = tr_utils_1.TrUtils.FixedTo(AfterDiscTotals, DecimalsNumber);
71
71
  let Total = this.GetTotalBasedOnTaxType(ItemTaxTotal, ItemsList, IsIndependentTax, Disc, Perc);
72
- finalTotalsData.Total = tr_utils_1.TrUtils.FixedTo(Total);
72
+ finalTotalsData.Total = tr_utils_1.TrUtils.FixedTo(Total, DecimalsNumber);
73
73
  finalTotalsData.ITax = IsIndependentTax;
74
74
  if (DetailedInfo) {
75
- finalTotalsData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(AfterDiscTotals);
76
- finalTotalsData.FixedTotal = tr_utils_1.TrUtils.FixedTo(Total);
75
+ finalTotalsData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(AfterDiscTotals, DecimalsNumber);
76
+ finalTotalsData.FixedTotal = tr_utils_1.TrUtils.FixedTo(Total, DecimalsNumber);
77
77
  }
78
78
  return finalTotalsData;
79
79
  }
@@ -81,11 +81,10 @@ class POTotalsService {
81
81
  let ItemsTotalAfterDisc = this.GetItemsTotalAfterDiscount(ItemsList);
82
82
  return ItemsTotalAfterDisc;
83
83
  }
84
- static GetDetailedTotalsData(finalTotalsData, IsIndependentTax, ItemsList, TaxCodes) {
84
+ static GetDetailedTotalsData(finalTotalsData, IsIndependentTax, ItemsList, TaxCodes, DecimalsNumber) {
85
85
  finalTotalsData.ItemsDiscTotal = this.GetItemDiscountedTotal(ItemsList);
86
86
  finalTotalsData.ItemsTotalAfterDisc = this.GetItemsTotalAfterDiscount(ItemsList);
87
- finalTotalsData.ItemsTotalBeforeDisc = tr_utils_1.TrUtils.FixedTo(finalTotalsData.ItemsTotalAfterDisc
88
- + finalTotalsData.ItemsDiscTotal);
87
+ finalTotalsData.ItemsTotalBeforeDisc = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(finalTotalsData.ItemsTotalAfterDisc, finalTotalsData.ItemsDiscTotal), DecimalsNumber);
89
88
  finalTotalsData.ItemITax = this.GetItemsTaxTotal(ItemsList, IsIndependentTax);
90
89
  // finalTotalsData.ItemCGST = this.GetItemCGSTTaxTotal(ItemsList, IsIndependentTax);
91
90
  // finalTotalsData.ItemIGST = this.GetItemIGSTTaxTotal(ItemsList, IsIndependentTax);
@@ -94,16 +93,16 @@ class POTotalsService {
94
93
  finalTotalsData.ItemCGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxAmt[0]);
95
94
  finalTotalsData.ItemSGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxAmt[1]);
96
95
  finalTotalsData.ItemIGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(TaxAmt[2]);
97
- finalTotalsData.ItemAfterTax = tr_utils_1.TrUtils.FixedTo(finalTotalsData.ItemITax + finalTotalsData.ItemsTotalAfterDisc);
98
- finalTotalsData.OverAllRecordDiscount = (finalTotalsData.Perc) ? ((finalTotalsData.SubTotal * finalTotalsData.Disc) / 100) : finalTotalsData.Disc;
99
- finalTotalsData.TaxGroupData = this.GetItemsTaxGrouping(ItemsList, TaxCodes);
100
- finalTotalsData.TotalRoundedBy = tr_utils_1.TrUtils.FixedTo(Math.round(finalTotalsData.Total) - finalTotalsData.Total);
96
+ finalTotalsData.ItemAfterTax = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(finalTotalsData.ItemITax, finalTotalsData.ItemsTotalAfterDisc), DecimalsNumber);
97
+ finalTotalsData.OverAllRecordDiscount = (finalTotalsData.Perc) ? (0, aggregation_1.division)((0, aggregation_1.multiply)(finalTotalsData.SubTotal, finalTotalsData.Disc), 100) : finalTotalsData.Disc;
98
+ finalTotalsData.TaxGroupData = this.GetItemsTaxGrouping(ItemsList, TaxCodes, DecimalsNumber);
99
+ finalTotalsData.TotalRoundedBy = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.subtraction)(Math.round(finalTotalsData.Total), finalTotalsData.Total), DecimalsNumber);
101
100
  finalTotalsData.RoundedTotal = Math.round(finalTotalsData.Total);
102
101
  for (var key in finalTotalsData) {
103
102
  if (key !== 'Total' && key !== 'SubTotal' &&
104
103
  key !== 'Disc' && key !== 'Perc' && key !== 'ITax'
105
104
  && typeof finalTotalsData[key] === 'number') {
106
- finalTotalsData[key] = tr_utils_1.TrUtils.FixPriceValue(finalTotalsData[key]);
105
+ finalTotalsData[key] = tr_utils_1.TrUtils.FixPriceValue(finalTotalsData[key], DecimalsNumber);
107
106
  }
108
107
  }
109
108
  return finalTotalsData;
@@ -162,14 +161,14 @@ class POTotalsService {
162
161
  }
163
162
  return Total;
164
163
  }
165
- static GetItemsTaxGrouping(ItemsList, TaxCodes) {
166
- return this.GetTaxGroupingItemsByHSN(ItemsList, TaxCodes);
164
+ static GetItemsTaxGrouping(ItemsList, TaxCodes, DecimalsNumber) {
165
+ return this.GetTaxGroupingItemsByHSN(ItemsList, TaxCodes, DecimalsNumber);
167
166
  }
168
- static GetTaxGroupingItemsByHSN(Items, TaxCodes) {
167
+ static GetTaxGroupingItemsByHSN(Items, TaxCodes, DecimalsNumber) {
169
168
  Items = this.GetCombinedTaxPercentage(Items, TaxCodes);
170
169
  // Items = this.ResetItemsHSNIfInvalid(Items);
171
170
  let FinalMatchedItems = this.CompareItemsByHSN(Items, TaxCodes);
172
- return this.GetTaxGroupingInfoByHSN(FinalMatchedItems, TaxCodes);
171
+ return this.GetTaxGroupingInfoByHSN(FinalMatchedItems, TaxCodes, DecimalsNumber);
173
172
  }
174
173
  static GetCombinedTaxPercentage(Items, TaxCodes) {
175
174
  Items.forEach((Item) => {
@@ -213,7 +212,7 @@ class POTotalsService {
213
212
  });
214
213
  return FinalMatchedItems;
215
214
  }
216
- static GetTaxGroupingInfoByHSN(FinalMatchedItems, TaxCodes) {
215
+ static GetTaxGroupingInfoByHSN(FinalMatchedItems, TaxCodes, DecimalsNumber) {
217
216
  let HSNTaxInfo = [];
218
217
  FinalMatchedItems.forEach((MatchedItem) => {
219
218
  let TaxInfo = {};
@@ -232,8 +231,8 @@ class POTotalsService {
232
231
  TaxAmount = (0, aggregation_1.addition)(TaxAmount, argMatchedGSTItem.SGST);
233
232
  });
234
233
  TaxInfo.HSN = HSN;
235
- TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount);
236
- TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount);
234
+ TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount, DecimalsNumber);
235
+ TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount, DecimalsNumber);
237
236
  TaxInfo.ItemsCount = MatchedItem.length;
238
237
  // let CGST = this.GetCGSTValueBasedOnTaxCode(MatchedItem[0].TCode, TaxCodes);
239
238
  // let SGST = this.GetSGSTValueBasedOnTaxCode(MatchedItem[0].TCode, TaxCodes);
@@ -46,16 +46,16 @@ class PurchaseOrderPrintService {
46
46
  PurchaseOrderPDFData.Ops = this.GetLaborPrintInfo(PurchaseOrderPDFData.Ops, TaxCodes, 'AT');
47
47
  }
48
48
  // PurchaseOrderPDFData.Items = this.GetPartsDescription(PurchaseOrderPDFData.Items);
49
+ PurchaseOrderPDFData.Entity = shared_print_service_1.PrintSharedService.GetFormattedEntityDataForPrint(EntityData, code_enums_1.PrintTypesEnum.PurOrder, PurchaseOrderData);
49
50
  PurchaseOrderPDFData.Items = this.GetQtyWithUoM(PurchaseOrderPDFData.Items);
50
51
  let DetailedTotalsInfo;
51
52
  if (IsFormPO) {
52
- DetailedTotalsInfo = purchase_order_totals_service_1.PurchaseOrderTotalsService.GetTotalsValue(PurchaseOrderPDFData.Ops, PurchaseOrderPDFData.Items, IsTaxable, true, TaxCodes, PurchaseOrderPDFData.Tax, true, PurchaseOrderPDFData.HasNoTax, false, 0, false, PurchaseOrderPDFData.Adjust);
53
+ DetailedTotalsInfo = purchase_order_totals_service_1.PurchaseOrderTotalsService.GetTotalsValue(PurchaseOrderPDFData.Ops, PurchaseOrderPDFData.Items, IsTaxable, true, TaxCodes, PurchaseOrderPDFData.Tax, true, PurchaseOrderPDFData.HasNoTax, false, 0, false, PurchaseOrderPDFData.Adjust, PurchaseOrderPDFData.Entity);
53
54
  }
54
55
  else {
55
- DetailedTotalsInfo = purchase_order_totals_service_1.PurchaseOrderTotalsService.GetTotalsValue(PurchaseOrderPDFData.Ops, PurchaseOrderPDFData.Items, IsTaxable, true, TaxCodes, PurchaseOrderPDFData.Tax, true, PurchaseOrderPDFData.HasNoTax, true, PurchaseOrderData.Disc, PurchaseOrderData.Perc, PurchaseOrderPDFData.Adjust);
56
+ DetailedTotalsInfo = purchase_order_totals_service_1.PurchaseOrderTotalsService.GetTotalsValue(PurchaseOrderPDFData.Ops, PurchaseOrderPDFData.Items, IsTaxable, true, TaxCodes, PurchaseOrderPDFData.Tax, true, PurchaseOrderPDFData.HasNoTax, true, PurchaseOrderData.Disc, PurchaseOrderData.Perc, PurchaseOrderPDFData.Adjust, PurchaseOrderPDFData.Entity);
56
57
  }
57
58
  PurchaseOrderPDFData = this.ConcatTotalsInfo(PurchaseOrderPDFData, DetailedTotalsInfo);
58
- PurchaseOrderPDFData.Entity = shared_print_service_1.PrintSharedService.GetFormattedEntityDataForPrint(EntityData, code_enums_1.PrintTypesEnum.PurOrder, PurchaseOrderData);
59
59
  PurchaseOrderPDFData = shared_print_service_1.PrintSharedService.GetEntityHeaderStyles(PurchaseOrderPDFData, EntityData, image);
60
60
  if (IsFormPO) {
61
61
  PurchaseOrderPDFData.HeaderName = 'Purchase Order';
@@ -1,23 +1,23 @@
1
1
  export declare class PurchaseOrderTotalsService {
2
- static GetTotalsValue(opCodesList: any, argPartsList: any, IsTaxable: boolean, DetailedTotalsInfo: boolean, TaxCodes: any, Tax: any, ReturnPartsAlso: boolean, HasNoTax: boolean, GetSubTotal: boolean, Discount: number, DiscInPerc: boolean, Adjust: number): any;
3
- static CalculateLaborValues(opCodesList: any, IsIndependentTax: boolean): any;
4
- static ResetLaborValues(opCodesList: any, IsIndependentTax: boolean): any;
2
+ static GetTotalsValue(opCodesList: any, argPartsList: any, IsTaxable: boolean, DetailedTotalsInfo: boolean, TaxCodes: any, Tax: any, ReturnPartsAlso: boolean, HasNoTax: boolean, GetSubTotal: boolean, Discount: number, DiscInPerc: boolean, Adjust: number, EntitySettings: any): any;
3
+ static CalculateLaborValues(opCodesList: any, IsIndependentTax: boolean, DecimalsNumber: number): any;
4
+ static ResetLaborValues(opCodesList: any, IsIndependentTax: boolean, DecimalsNumber: number): any;
5
5
  static ResetLaborValueIfInvalid(Operation: any): any;
6
6
  static CheckPartStatusAndReturn(PartsList: any): any;
7
7
  static ResetPartValueIfInvalid(Part: any): any;
8
8
  static GetPartDiscountedPrice(Disc: any, RecDisc: any): any;
9
- static GetPartsTaxAmount(Items: any, IsTaxable: boolean, TaxCodes: any): any;
9
+ static GetPartsTaxAmount(Items: any, IsTaxable: boolean, TaxCodes: any, DecimalsNumber: number): any;
10
10
  static GetGSTValueBasedOnTaxCode(TCode: any, argTaxCodes: any): any[];
11
- static GetTotalsInfo(PartsList: any, LaborList: any, IsTaxable: boolean, TaxCodes: any, HasNoTax: boolean, GetSubTotal: boolean, Discount: number, DiscInPerc: boolean, Adjust: number): any;
11
+ static GetTotalsInfo(PartsList: any, LaborList: any, IsTaxable: boolean, TaxCodes: any, HasNoTax: boolean, GetSubTotal: boolean, Discount: number, DiscInPerc: boolean, Adjust: number, DecimalsNumber: number): any;
12
12
  static GetServiceTotalTaxAndAfterDiscount(LaborList: any): any[];
13
13
  static GetPartsTotalTaxAndAfterDiscount(PartsList: any): any[];
14
- static GetTotalBasedOnTaxType(PartsTotalAfterDisc: number, PartsTaxAmount: number, ServicesTotalAfterDisc: number, ServicesTaxTotal: number, IsTaxable: boolean, Adjust: number): number;
15
- static GetDetailedTotalsData(finalTotalsData: any, IsTaxable: boolean, PartsList: any, LaborList: any, TaxCodes: any, Tax: any, HasNoTax: boolean): any;
14
+ static GetTotalBasedOnTaxType(PartsTotalAfterDisc: number, PartsTaxAmount: number, ServicesTotalAfterDisc: number, ServicesTaxTotal: number, IsTaxable: boolean, Adjust: number, DecimalsNumber: number): number;
15
+ static GetDetailedTotalsData(finalTotalsData: any, IsTaxable: boolean, PartsList: any, LaborList: any, TaxCodes: any, Tax: any, HasNoTax: boolean, DecimalsNumber: number): any;
16
16
  static GetPartGSTTaxTotal(PartsList: Array<any>): number[];
17
17
  static GetServicesGSTTaxTotal(ServicesList: Array<any>): number[];
18
- static GetPartsTaxGroupingFor(PartsList: any, TaxCodes: any): any[];
19
- static GetTaxGroupingForPartsByHSN(Items: any, TaxCodes: any): any[];
18
+ static GetPartsTaxGroupingFor(PartsList: any, TaxCodes: any, DecimalsNumber: number): any[];
19
+ static GetTaxGroupingForPartsByHSN(Items: any, TaxCodes: any, DecimalsNumber: number): any[];
20
20
  static GetCombinedTaxPercentage(Items: any, TaxCodes: any): any;
21
21
  static ComparePartsByHSN(Items: any, TaxCodes: any): any[];
22
- static GetTaxGroupingInfoByHSN(FinalMatchedParts: any, TaxCodes: any): any[];
22
+ static GetTaxGroupingInfoByHSN(FinalMatchedParts: any, TaxCodes: any, DecimalsNumber: number): any[];
23
23
  }
@@ -5,7 +5,7 @@ const aggregation_1 = require("../../aggregation/aggregation");
5
5
  const code_enums_1 = require("../../enums/code-enums");
6
6
  const tr_utils_1 = require("../../utils/tr-utils");
7
7
  class PurchaseOrderTotalsService {
8
- static GetTotalsValue(opCodesList, argPartsList, IsTaxable, DetailedTotalsInfo, TaxCodes, Tax, ReturnPartsAlso, HasNoTax, GetSubTotal, Discount, DiscInPerc, Adjust) {
8
+ static GetTotalsValue(opCodesList, argPartsList, IsTaxable, DetailedTotalsInfo, TaxCodes, Tax, ReturnPartsAlso, HasNoTax, GetSubTotal, Discount, DiscInPerc, Adjust, EntitySettings) {
9
9
  let PartsList = tr_utils_1.TrUtils.IsNull(argPartsList) ? [] : tr_utils_1.TrUtils.Stringify(argPartsList);
10
10
  // PartsList = this.ResetPartValuesIfInvalid(PartsList);
11
11
  // PartsList = this.GetPartsDiscountPrice(PartsList);
@@ -13,27 +13,27 @@ class PurchaseOrderTotalsService {
13
13
  if (tr_utils_1.TrUtils.IsNull(opCodesList)) {
14
14
  opCodesList = [];
15
15
  }
16
- opCodesList = this.CalculateLaborValues(opCodesList, IsTaxable);
17
- PartsList = this.GetPartsTaxAmount(PartsList, IsTaxable, TaxCodes);
16
+ opCodesList = this.CalculateLaborValues(opCodesList, IsTaxable, EntitySettings.DecimalsNumber);
17
+ PartsList = this.GetPartsTaxAmount(PartsList, IsTaxable, TaxCodes, EntitySettings.DecimalsNumber);
18
18
  // PartsList = this.GetPartsAfterTax(PartsList);
19
- let finalTotalsData = this.GetTotalsInfo(PartsList, opCodesList, IsTaxable, TaxCodes, HasNoTax, GetSubTotal, Discount, DiscInPerc, Adjust);
19
+ let finalTotalsData = this.GetTotalsInfo(PartsList, opCodesList, IsTaxable, TaxCodes, HasNoTax, GetSubTotal, Discount, DiscInPerc, Adjust, EntitySettings.DecimalsNumber);
20
20
  if (ReturnPartsAlso) {
21
21
  finalTotalsData.Ops = opCodesList;
22
22
  finalTotalsData.Items = PartsList;
23
23
  }
24
24
  if (DetailedTotalsInfo === true) {
25
- finalTotalsData = this.GetDetailedTotalsData(finalTotalsData, IsTaxable, PartsList, opCodesList, TaxCodes, Tax, HasNoTax);
25
+ finalTotalsData = this.GetDetailedTotalsData(finalTotalsData, IsTaxable, PartsList, opCodesList, TaxCodes, Tax, HasNoTax, EntitySettings.DecimalsNumber);
26
26
  }
27
27
  return finalTotalsData;
28
28
  }
29
- static CalculateLaborValues(opCodesList, IsIndependentTax) {
30
- opCodesList = this.ResetLaborValues(opCodesList, IsIndependentTax);
29
+ static CalculateLaborValues(opCodesList, IsIndependentTax, DecimalsNumber) {
30
+ opCodesList = this.ResetLaborValues(opCodesList, IsIndependentTax, DecimalsNumber);
31
31
  // opCodesList = this.GetOperationsDiscountPrice(opCodesList);
32
32
  // opCodesList = this.GetOperationsAfterDiscount(opCodesList,IsIndependentTax);
33
33
  // opCodesList = this.GetOperationsAfterTax(opCodesList, IsIndependentTax);
34
34
  return opCodesList;
35
35
  }
36
- static ResetLaborValues(opCodesList, IsIndependentTax) {
36
+ static ResetLaborValues(opCodesList, IsIndependentTax, DecimalsNumber) {
37
37
  opCodesList.forEach((Operation) => {
38
38
  Operation = this.ResetLaborValueIfInvalid(Operation);
39
39
  Operation.DiscountedPrice = (0, aggregation_1.addition)(Operation.Disc, Operation.RecDisc);
@@ -53,10 +53,10 @@ class PurchaseOrderTotalsService {
53
53
  let Price = 0;
54
54
  Price = (0, aggregation_1.multiply)(Operation.UnCo, Operation.Qty);
55
55
  if (IsIndependentTax) {
56
- Operation.LineTotal = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)((0, aggregation_1.subtraction)(Price, Operation.Disc), Operation.GSTAmt));
56
+ Operation.LineTotal = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)((0, aggregation_1.subtraction)(Price, Operation.Disc), Operation.GSTAmt), DecimalsNumber);
57
57
  }
58
58
  else {
59
- Operation.LineTotal = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.subtraction)(Price, Operation.Disc));
59
+ Operation.LineTotal = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.subtraction)(Price, Operation.Disc), DecimalsNumber);
60
60
  }
61
61
  });
62
62
  return opCodesList;
@@ -96,7 +96,7 @@ class PurchaseOrderTotalsService {
96
96
  return (0, aggregation_1.addition)(Disc, tr_utils_1.TrUtils.SetValueToZeroIfNull(RecDisc));
97
97
  // }
98
98
  }
99
- static GetPartsTaxAmount(Items, IsTaxable, TaxCodes) {
99
+ static GetPartsTaxAmount(Items, IsTaxable, TaxCodes, DecimalsNumber) {
100
100
  Items.forEach((Part) => {
101
101
  Part = this.ResetPartValueIfInvalid(Part);
102
102
  // Part.CGSTAmt = this.GetCGSTTaxAmount(Part.AfterDiscountPrice, IsTaxable, Part.TCode, TaxCodes);
@@ -113,7 +113,7 @@ class PurchaseOrderTotalsService {
113
113
  if (IsTaxable) {
114
114
  // if (!TrUtils(Part.Perc)) {
115
115
  Price = (0, aggregation_1.multiply)(Part.UnCo, Part.Qty);
116
- Part.LineTotal = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)((0, aggregation_1.subtraction)(Price, Part.Disc), Part.GSTAmt));
116
+ Part.LineTotal = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)((0, aggregation_1.subtraction)(Price, Part.Disc), Part.GSTAmt), DecimalsNumber);
117
117
  // } else {
118
118
  // Part.LineTotal = TrUtils.FixedTo((Part.UnPr - Part.Disc) + Part.GSTAmt);
119
119
  // }
@@ -122,7 +122,7 @@ class PurchaseOrderTotalsService {
122
122
  // let DiscPrice: any = 0;
123
123
  // if (Part.Perc) {
124
124
  Price = (0, aggregation_1.multiply)(Part.UnCo, Part.Qty);
125
- Part.LineTotal = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.subtraction)(Price, Part.Disc));
125
+ Part.LineTotal = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.subtraction)(Price, Part.Disc), DecimalsNumber);
126
126
  // } else {
127
127
  // Part.LineTotal = TrUtils.FixedTo((Part.UnPr - Part.Disc));
128
128
  // }
@@ -156,7 +156,7 @@ class PurchaseOrderTotalsService {
156
156
  return [0, 0, 0];
157
157
  }
158
158
  }
159
- static GetTotalsInfo(PartsList, LaborList, IsTaxable, TaxCodes, HasNoTax, GetSubTotal, Discount, DiscInPerc, Adjust) {
159
+ static GetTotalsInfo(PartsList, LaborList, IsTaxable, TaxCodes, HasNoTax, GetSubTotal, Discount, DiscInPerc, Adjust, DecimalsNumber) {
160
160
  let finalTotalsData = {};
161
161
  let PartsInfo = this.GetPartsTotalTaxAndAfterDiscount(PartsList);
162
162
  let PartsTotalAfterDisc = tr_utils_1.TrUtils.SetValueToZeroIfNull(PartsInfo[0]);
@@ -167,7 +167,7 @@ class PurchaseOrderTotalsService {
167
167
  let ServicesDiscTotal = tr_utils_1.TrUtils.SetValueToZeroIfNull(ServicesInfo[1]);
168
168
  let ServicesTaxTotal = tr_utils_1.TrUtils.SetValueToZeroIfNull(ServicesInfo[2]);
169
169
  finalTotalsData.SubTotal = (0, aggregation_1.addition)(PartsTotalAfterDisc, PartsDiscTotal, ServicesTotalAfterDisc, ServicesDiscTotal);
170
- finalTotalsData.Adj = tr_utils_1.TrUtils.FixPriceValue(Adjust);
170
+ finalTotalsData.Adj = tr_utils_1.TrUtils.FixPriceValue(Adjust, DecimalsNumber);
171
171
  // if (GetSubTotal) {
172
172
  // finalTotalsData.SubTotal = this.GetTotalBasedOnTaxType(PartsTotalAfterDisc, PartsTaxTotal,
173
173
  // IsTaxable);
@@ -182,7 +182,7 @@ class PurchaseOrderTotalsService {
182
182
  // }
183
183
  // finalTotalsData.Total = Total;
184
184
  // } else {
185
- finalTotalsData.Total = this.GetTotalBasedOnTaxType(PartsTotalAfterDisc, PartsTaxTotal, ServicesTotalAfterDisc, ServicesTaxTotal, IsTaxable, Adjust);
185
+ finalTotalsData.Total = this.GetTotalBasedOnTaxType(PartsTotalAfterDisc, PartsTaxTotal, ServicesTotalAfterDisc, ServicesTaxTotal, IsTaxable, Adjust, DecimalsNumber);
186
186
  // }
187
187
  // finalTotalsData.Round = TrUtils.FixedTo(Math.round(finalTotalsData.Total) - finalTotalsData.Total);
188
188
  // finalTotalsData.Total = Math.round(finalTotalsData.Total);
@@ -210,7 +210,7 @@ class PurchaseOrderTotalsService {
210
210
  });
211
211
  return [PartsTotalAfterDisc, PartsDiscountedTotal, TotalTaxAmt];
212
212
  }
213
- static GetTotalBasedOnTaxType(PartsTotalAfterDisc, PartsTaxAmount, ServicesTotalAfterDisc, ServicesTaxTotal, IsTaxable, Adjust) {
213
+ static GetTotalBasedOnTaxType(PartsTotalAfterDisc, PartsTaxAmount, ServicesTotalAfterDisc, ServicesTaxTotal, IsTaxable, Adjust, DecimalsNumber) {
214
214
  let Total = 0;
215
215
  if (IsTaxable) {
216
216
  Total = (0, aggregation_1.addition)(PartsTotalAfterDisc, PartsTaxAmount, ServicesTotalAfterDisc, ServicesTaxTotal);
@@ -219,9 +219,9 @@ class PurchaseOrderTotalsService {
219
219
  Total = (0, aggregation_1.addition)(PartsTotalAfterDisc, ServicesTotalAfterDisc);
220
220
  }
221
221
  let finalTotal = (0, aggregation_1.addition)(Total, tr_utils_1.TrUtils.SetValueToZeroIfNull(Adjust));
222
- return tr_utils_1.TrUtils.FixedTo(finalTotal);
222
+ return tr_utils_1.TrUtils.FixedTo(finalTotal, DecimalsNumber);
223
223
  }
224
- static GetDetailedTotalsData(finalTotalsData, IsTaxable, PartsList, LaborList, TaxCodes, Tax, HasNoTax) {
224
+ static GetDetailedTotalsData(finalTotalsData, IsTaxable, PartsList, LaborList, TaxCodes, Tax, HasNoTax, DecimalsNumber) {
225
225
  let PartsInfo = this.GetPartsTotalTaxAndAfterDiscount(PartsList);
226
226
  let ServicesInfo = this.GetServiceTotalTaxAndAfterDiscount(LaborList);
227
227
  finalTotalsData.PartsDiscTotal = tr_utils_1.TrUtils.SetValueToZeroIfNull(PartsInfo[1]);
@@ -249,7 +249,7 @@ class PurchaseOrderTotalsService {
249
249
  finalTotalsData.IsTaxable = IsTaxable;
250
250
  finalTotalsData.Tax = Tax;
251
251
  finalTotalsData.HasNoTax = HasNoTax;
252
- finalTotalsData.TaxGroupData = this.GetPartsTaxGroupingFor(PartsList, TaxCodes);
252
+ finalTotalsData.TaxGroupData = this.GetPartsTaxGroupingFor(PartsList, TaxCodes, DecimalsNumber);
253
253
  // finalTotalsData.TotalRoundedBy = TrUtils.FixedTo(Math.round(finalTotalsData.Total) - finalTotalsData.Total);
254
254
  finalTotalsData.RoundedTotal = Math.round(finalTotalsData.Total);
255
255
  // finalTotalsData.Round = TrUtils.FixedTo(Math.round(finalTotalsData.Total) - finalTotalsData.Total);
@@ -278,14 +278,14 @@ class PurchaseOrderTotalsService {
278
278
  });
279
279
  return [CGSTAmt, SGSTAmt, IGSTAmt];
280
280
  }
281
- static GetPartsTaxGroupingFor(PartsList, TaxCodes) {
282
- return this.GetTaxGroupingForPartsByHSN(tr_utils_1.TrUtils.Stringify(PartsList), TaxCodes);
281
+ static GetPartsTaxGroupingFor(PartsList, TaxCodes, DecimalsNumber) {
282
+ return this.GetTaxGroupingForPartsByHSN(tr_utils_1.TrUtils.Stringify(PartsList), TaxCodes, DecimalsNumber);
283
283
  }
284
- static GetTaxGroupingForPartsByHSN(Items, TaxCodes) {
284
+ static GetTaxGroupingForPartsByHSN(Items, TaxCodes, DecimalsNumber) {
285
285
  Items = this.GetCombinedTaxPercentage(Items, TaxCodes);
286
286
  // Items = this.ResetPartsHSNIfInvalid(Items);
287
287
  let FinalMatchedParts = this.ComparePartsByHSN(Items, TaxCodes);
288
- return this.GetTaxGroupingInfoByHSN(FinalMatchedParts, TaxCodes);
288
+ return this.GetTaxGroupingInfoByHSN(FinalMatchedParts, TaxCodes, DecimalsNumber);
289
289
  }
290
290
  static GetCombinedTaxPercentage(Items, TaxCodes) {
291
291
  Items.forEach((Part) => {
@@ -332,7 +332,7 @@ class PurchaseOrderTotalsService {
332
332
  });
333
333
  return FinalMatchedParts;
334
334
  }
335
- static GetTaxGroupingInfoByHSN(FinalMatchedParts, TaxCodes) {
335
+ static GetTaxGroupingInfoByHSN(FinalMatchedParts, TaxCodes, DecimalsNumber) {
336
336
  let HSNTaxInfo = [];
337
337
  FinalMatchedParts.forEach((MatchedPart) => {
338
338
  let TaxInfo = {};
@@ -347,8 +347,8 @@ class PurchaseOrderTotalsService {
347
347
  TaxAmount = (0, aggregation_1.addition)(TaxAmount, argMatchedGSTPart.SGST);
348
348
  });
349
349
  TaxInfo.HSN = HSN;
350
- TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount);
351
- TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount);
350
+ TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount, DecimalsNumber);
351
+ TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount, DecimalsNumber);
352
352
  TaxInfo.PartsCount = MatchedPart.length;
353
353
  // let CGST = this.GetCGSTValueBasedOnTaxCode(MatchedPart[0].TCode, TaxCodes);
354
354
  // let SGST = this.GetSGSTValueBasedOnTaxCode(MatchedPart[0].TCode, TaxCodes);
@@ -3,12 +3,11 @@ export declare class VendorDebitNotePrintService {
3
3
  static GetPrintConditionsBasedOnInput(InvoicePrintData: any, IncludeGST: boolean, ConsolidateGST: boolean, ForInsurance: boolean, SType: any, OriginalInvoiceData: any, IsProforma: boolean): any;
4
4
  static GetInvoiceTypeHeading(InvoicePrintData: any, OriginalInvoiceData: any, IncludeGST: boolean, ConsolidateGST: boolean, IsProforma: boolean): any;
5
5
  static GetInvoiceOtherDetailsForPrint(InvoicePrintData: any, OriginalInvoiceData: any): any;
6
- static GetItemsPrintInfo(Items: any, Consolidate: boolean, TaxCodes: any, LineTotal: string): any;
6
+ static GetItemsPrintInfo(Items: any, Consolidate: boolean, TaxCodes: any, LineTotal: string, DecimalsNumber: number): any;
7
7
  static ReverseItemsForInvoicePrint(argInvoiceData: any): any;
8
8
  static PrepareFormatForInvoicePrint(InvoicePrintData: any, ROType: any, InvoiceStatus: any): any[];
9
9
  static GetFormattedProductDataForPrint(OriginalInvoiceData: any, InvoicePrintData: any): any;
10
10
  static GetBillNameForInvoicePrint(OriginalInvoiceData: any, InvoicePrintData: any): any;
11
11
  static GetCustomerDetails(OriginalInvoiceData: any): any;
12
12
  static GetBillToName(Title: any, Name: string): string;
13
- static GetPaymentsTotal(InvoicePayments: any, Total: number, InvoiceStatus: string): any;
14
13
  }
@@ -29,13 +29,13 @@ class VendorDebitNotePrintService {
29
29
  InvoicePrintData = shared_print_service_1.PrintSharedService.GetEntityHeaderStyles(InvoicePrintData, OriginalEntityData, image);
30
30
  InvoicePrintData = this.GetInvoiceOtherDetailsForPrint(InvoicePrintData, argInvoiceData);
31
31
  let IsTaxable = (IncludeGST && tr_utils_1.TrUtils.isTaxable(argInvoiceData.Settings.Tax)) ? true : false;
32
- let finalTotalsData = debit_note_totals_service_1.DebitNoteTotalsService.GetTotalsValue(argInvoiceData.Items, IsTaxable, true, argInvoiceData.Disc, argInvoiceData.Perc, TaxCodes, true, argInvoiceData.Settings);
32
+ let finalTotalsData = debit_note_totals_service_1.DebitNoteTotalsService.GetTotalsValue(argInvoiceData.Items, IsTaxable, true, argInvoiceData.Disc, argInvoiceData.Perc, TaxCodes, true, argInvoiceData.Settings, InvoicePrintData.Entity);
33
33
  if (ConsolidateGST) {
34
34
  finalTotalsData.CustLaborTotalBeforeDisc = finalTotalsData.CustLaborAfterTax;
35
35
  finalTotalsData.CustPartsTotalBeforeDisc = finalTotalsData.CustPartAfterTax;
36
36
  }
37
37
  InvoicePrintData = tr_utils_1.TrUtils.ConcatObjects(InvoicePrintData, finalTotalsData);
38
- InvoicePrintData.Items = this.GetItemsPrintInfo(InvoicePrintData.Items, ConsolidateGST, TaxCodes, (_b = (_a = OriginalEntityData.Entity.Settings) === null || _a === void 0 ? void 0 : _a.Acc) === null || _b === void 0 ? void 0 : _b.LTot);
38
+ InvoicePrintData.Items = this.GetItemsPrintInfo(InvoicePrintData.Items, ConsolidateGST, TaxCodes, (_b = (_a = OriginalEntityData.Entity.Settings) === null || _a === void 0 ? void 0 : _a.Acc) === null || _b === void 0 ? void 0 : _b.LTot, OriginalEntityData.Entity.DecimalsNumber);
39
39
  argInvoiceData = this.ReverseItemsForInvoicePrint(argInvoiceData);
40
40
  InvoicePrintData.PrintInfo = this.PrepareFormatForInvoicePrint(InvoicePrintData, code_enums_1.ROTypeEnum.Invoice, argInvoiceData.Sts);
41
41
  InvoicePrintData = this.GetFormattedProductDataForPrint(argInvoiceData, InvoicePrintData);
@@ -103,29 +103,29 @@ class VendorDebitNotePrintService {
103
103
  InvoicePrintData.CrDate = my_date_1.MyDate.ConvertUTCDateToReadable(OriginalInvoiceData.CrDate);
104
104
  return InvoicePrintData;
105
105
  }
106
- static GetItemsPrintInfo(Items, Consolidate, TaxCodes, LineTotal) {
106
+ static GetItemsPrintInfo(Items, Consolidate, TaxCodes, LineTotal, DecimalsNumber) {
107
107
  Items.forEach((Item) => {
108
108
  if (Consolidate) {
109
109
  let AfterDiscForEach = (0, aggregation_1.division)(Item.AfterPartDisc, Item.Qty);
110
110
  let CTaxAmtPerItem = (0, aggregation_1.division)(Item.CGST, Item.Qty);
111
111
  let STaxAmtPerItem = (0, aggregation_1.division)(Item.SGST, Item.Qty);
112
112
  let ITaxAmtPerItem = (0, aggregation_1.division)(Item.IGST, Item.Qty);
113
- Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem));
113
+ Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
114
114
  }
115
115
  else {
116
- Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr);
116
+ Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
117
117
  }
118
- Item.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.CGST);
119
- Item.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.SGST);
120
- Item.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.IGST);
118
+ Item.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.CGST, DecimalsNumber);
119
+ Item.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.SGST, DecimalsNumber);
120
+ Item.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.IGST, DecimalsNumber);
121
121
  Item.CGSTPerc = shared_print_service_1.PrintSharedService.GetCGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
122
122
  Item.SGSTPerc = shared_print_service_1.PrintSharedService.GetSGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
123
123
  Item.IGSTPerc = shared_print_service_1.PrintSharedService.GetIGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
124
124
  if (LineTotal === 'AT') {
125
- Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax);
125
+ Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax, DecimalsNumber);
126
126
  }
127
127
  else {
128
- Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc));
128
+ Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc), DecimalsNumber);
129
129
  }
130
130
  if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
131
131
  Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
@@ -220,27 +220,5 @@ class VendorDebitNotePrintService {
220
220
  static GetBillToName(Title, Name) {
221
221
  return tr_utils_1.TrUtils.IsEmpty(Title) ? Name : Title + ' ' + Name;
222
222
  }
223
- static GetPaymentsTotal(InvoicePayments, Total, InvoiceStatus) {
224
- var i = 0;
225
- let Data = {};
226
- let PaidTotal = 0;
227
- for (i = 0; i < InvoicePayments.length; i++) {
228
- PaidTotal += InvoicePayments[i].Paid;
229
- }
230
- if (InvoiceStatus === enums_1.InvoiceStatusEnum.Closed) {
231
- Data.Due = 0;
232
- }
233
- else {
234
- Data.Due = tr_utils_1.TrUtils.FixedTo(Total - PaidTotal);
235
- }
236
- if (Data.Due < 0) {
237
- Data.Due = 0;
238
- }
239
- if (Data.Due === 0) {
240
- Data.Sts = enums_1.InvoiceStatusEnum.Closed;
241
- }
242
- Data.Paid = tr_utils_1.TrUtils.FixedTo(PaidTotal);
243
- return Data;
244
- }
245
223
  }
246
224
  exports.VendorDebitNotePrintService = VendorDebitNotePrintService;
@@ -3,10 +3,9 @@ export declare class DeliveryChallanPrintService {
3
3
  static GetPrintConditionsBasedOnInput(InvoicePrintData: any, IncludeGST: boolean, ConsolidateGST: boolean, SType: any, OriginalInvoiceData: any, IsProforma: boolean): any;
4
4
  static GetInvoiceTypeHeading(InvoicePrintData: any, OriginalInvoiceData: any, IncludeGST: boolean, ConsolidateGST: boolean, IsProforma: boolean): any;
5
5
  static GetInvoiceOtherDetailsForPrint(InvoicePrintData: any, OriginalInvoiceData: any): any;
6
- static GetItemsPrintInfo(Items: any, Consolidate: boolean, TaxCodes: any, LineTotal: string): any;
6
+ static GetItemsPrintInfo(Items: any, Consolidate: boolean, TaxCodes: any, LineTotal: string, DecimalsNumber: number): any;
7
7
  static ReverseItemsForInvoicePrint(argInvoiceData: any): any;
8
8
  static PrepareFormatForInvoicePrint(InvoicePrintData: any, ROType: any, InvoiceStatus: any): any[];
9
9
  static GetBillNameForInvoicePrint(OriginalInvoiceData: any, InvoicePrintData: any): any;
10
10
  static GetBillToName(Title: any, Name: string): string;
11
- static GetPaymentsTotal(InvoicePayments: any, Total: number, InvoiceStatus: string): any;
12
11
  }
@@ -4,7 +4,6 @@ exports.DeliveryChallanPrintService = void 0;
4
4
  const delivery_challan_totals_1 = require("./delivery-challan-totals");
5
5
  const tr_utils_1 = require("../../utils/tr-utils");
6
6
  const code_enums_1 = require("../../enums/code-enums");
7
- const enums_1 = require("../../enums/enums");
8
7
  const my_date_1 = require("../../utils/my-date");
9
8
  const aggregation_1 = require("../../aggregation/aggregation");
10
9
  const shared_print_service_1 = require("../../shared/shared-print.service");
@@ -34,7 +33,7 @@ class DeliveryChallanPrintService {
34
33
  finalTotalsData.CustPartsTotalBeforeDisc = finalTotalsData.CustPartAfterTax;
35
34
  }
36
35
  InvoicePrintData = tr_utils_1.TrUtils.ConcatObjects(InvoicePrintData, finalTotalsData);
37
- InvoicePrintData.Items = this.GetItemsPrintInfo(InvoicePrintData.Items, ConsolidateGST, TaxCodes, (_b = (_a = OriginalEntityData.Entity.Settings) === null || _a === void 0 ? void 0 : _a.Acc) === null || _b === void 0 ? void 0 : _b.LTot);
36
+ InvoicePrintData.Items = this.GetItemsPrintInfo(InvoicePrintData.Items, ConsolidateGST, TaxCodes, (_b = (_a = OriginalEntityData.Entity.Settings) === null || _a === void 0 ? void 0 : _a.Acc) === null || _b === void 0 ? void 0 : _b.LTot, OriginalEntityData.Entity.DecimalsNumber);
38
37
  argInvoiceData = this.ReverseItemsForInvoicePrint(argInvoiceData);
39
38
  InvoicePrintData.PrintInfo = this.PrepareFormatForInvoicePrint(InvoicePrintData, code_enums_1.ROTypeEnum.Invoice, argInvoiceData.Sts);
40
39
  InvoicePrintData = this.GetBillNameForInvoicePrint(argInvoiceData, InvoicePrintData);
@@ -77,29 +76,29 @@ class DeliveryChallanPrintService {
77
76
  InvoicePrintData.CrDate = my_date_1.MyDate.ConvertUTCDateToReadable(OriginalInvoiceData.CrDate);
78
77
  return InvoicePrintData;
79
78
  }
80
- static GetItemsPrintInfo(Items, Consolidate, TaxCodes, LineTotal) {
79
+ static GetItemsPrintInfo(Items, Consolidate, TaxCodes, LineTotal, DecimalsNumber) {
81
80
  Items.forEach((Item) => {
82
81
  if (Consolidate) {
83
82
  let AfterDiscForEach = Item.AfterPartDisc / Item.Qty;
84
83
  let CTaxAmtPerItem = Item.CGST / Item.Qty;
85
84
  let STaxAmtPerItem = Item.SGST / Item.Qty;
86
85
  let ITaxAmtPerItem = Item.IGST / Item.Qty;
87
- Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(AfterDiscForEach + CTaxAmtPerItem + STaxAmtPerItem + ITaxAmtPerItem);
86
+ Item.UnPr = tr_utils_1.TrUtils.FixPriceValue((AfterDiscForEach + CTaxAmtPerItem + STaxAmtPerItem + ITaxAmtPerItem), DecimalsNumber);
88
87
  }
89
88
  else {
90
- Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr);
89
+ Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
91
90
  }
92
- Item.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.CGST);
93
- Item.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.SGST);
94
- Item.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.IGST);
91
+ Item.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.CGST, DecimalsNumber);
92
+ Item.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.SGST, DecimalsNumber);
93
+ Item.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Item.IGST, DecimalsNumber);
95
94
  Item.CGSTPerc = shared_print_service_1.PrintSharedService.GetCGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
96
95
  Item.SGSTPerc = shared_print_service_1.PrintSharedService.GetSGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
97
96
  Item.IGSTPerc = shared_print_service_1.PrintSharedService.GetIGSTValueBasedOnTaxCode(Item.TCode, TaxCodes);
98
97
  if (LineTotal === 'AT') {
99
- Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax);
98
+ Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue(Item.AfterPartTax, DecimalsNumber);
100
99
  }
101
100
  else {
102
- Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc));
101
+ Item.LineTotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.subtraction)(Item.UnAmt, Item.Disc), DecimalsNumber);
103
102
  }
104
103
  if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
105
104
  Item.QtyAndUoM = Item.Qty + ' ' + Item.UoM;
@@ -152,27 +151,5 @@ class DeliveryChallanPrintService {
152
151
  static GetBillToName(Title, Name) {
153
152
  return tr_utils_1.TrUtils.IsEmpty(Title) ? Name : Title + ' ' + Name;
154
153
  }
155
- static GetPaymentsTotal(InvoicePayments, Total, InvoiceStatus) {
156
- var i = 0;
157
- let Data = {};
158
- let PaidTotal = 0;
159
- for (i = 0; i < InvoicePayments.length; i++) {
160
- PaidTotal += InvoicePayments[i].Paid;
161
- }
162
- if (InvoiceStatus === enums_1.InvoiceStatusEnum.Closed) {
163
- Data.Due = 0;
164
- }
165
- else {
166
- Data.Due = tr_utils_1.TrUtils.FixedTo(Total - PaidTotal);
167
- }
168
- if (Data.Due < 0) {
169
- Data.Due = 0;
170
- }
171
- if (Data.Due === 0) {
172
- Data.Sts = enums_1.InvoiceStatusEnum.Closed;
173
- }
174
- Data.Paid = tr_utils_1.TrUtils.FixedTo(PaidTotal);
175
- return Data;
176
- }
177
154
  }
178
155
  exports.DeliveryChallanPrintService = DeliveryChallanPrintService;
@@ -3,7 +3,7 @@ export declare class SalesPrintService {
3
3
  static GetPrintConditionsBasedOnInput(InvoicePrintData: any, IncludeGST: boolean, ConsolidateGST: boolean, ForInsurance: boolean, SType: any, OriginalInvoiceData: any, IsProforma: boolean): any;
4
4
  static GetInvoiceTypeHeading(InvoicePrintData: any, OriginalInvoiceData: any, IncludeGST: boolean, ConsolidateGST: boolean, IsProforma: boolean): any;
5
5
  static GetInvoiceOtherDetailsForPrint(InvoicePrintData: any, OriginalInvoiceData: any): any;
6
- static GetItemsPrintInfo(Items: any, Consolidate: boolean, TaxCodes: any, isOtherIndustry: boolean, LineTotal: string): any;
6
+ static GetItemsPrintInfo(Items: any, Consolidate: boolean, TaxCodes: any, isOtherIndustry: boolean, LineTotal: string, DecimalsNumber: number): any;
7
7
  static ReverseItemsForInvoicePrint(argInvoiceData: any): any;
8
8
  static PrepareFormatForInvoicePrint(InvoicePrintData: any, ROType: any, InvoiceStatus: any): any[];
9
9
  static GetFormattedProductDataForPrint(OriginalInvoiceData: any, InvoicePrintData: any): any;
@@ -11,5 +11,5 @@ export declare class SalesPrintService {
11
11
  static GetBillNameForInvoicePrint(OriginalInvoiceData: any, InvoicePrintData: any): any;
12
12
  static GetCustomerDetails(OriginalInvoiceData: any): any;
13
13
  static GetBillToName(Title: any, Name: string): string;
14
- static GetPaymentsTotal(InvoicePayments: any, Total: number, InvoiceStatus: string): any;
14
+ static GetPaymentsTotal(InvoicePayments: any, Total: number, InvoiceStatus: string, DecimalsNumber: number): any;
15
15
  }