shareneus 1.4.48 → 1.4.50

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 (109) hide show
  1. package/dist/accounting/counter-sales/sales-receipt-print.service.d.ts +3 -3
  2. package/dist/accounting/counter-sales/sales-receipt-print.service.js +30 -29
  3. package/dist/accounting/credit-note/cn-print.service.d.ts +1 -2
  4. package/dist/accounting/credit-note/cn-print.service.js +10 -32
  5. package/dist/accounting/credit-note/credit-note-totals.service.d.ts +6 -6
  6. package/dist/accounting/credit-note/credit-note-totals.service.js +19 -19
  7. package/dist/accounting/debit-note/debit-note-print.service.d.ts +2 -2
  8. package/dist/accounting/debit-note/debit-note-print.service.js +15 -15
  9. package/dist/accounting/debit-note/debit-note-totals.service.d.ts +6 -6
  10. package/dist/accounting/debit-note/debit-note-totals.service.js +18 -18
  11. package/dist/accounting/invoice/hc-inv-pdf.service.d.ts +7 -7
  12. package/dist/accounting/invoice/hc-inv-pdf.service.js +36 -36
  13. package/dist/accounting/invoice/inv-pdf.service.d.ts +6 -6
  14. package/dist/accounting/invoice/inv-pdf.service.js +43 -43
  15. package/dist/accounting/invoice/inv-print.service.d.ts +3 -3
  16. package/dist/accounting/invoice/inv-print.service.js +24 -24
  17. package/dist/accounting/invoice/invoice-letterhead-pdf.service.d.ts +6 -6
  18. package/dist/accounting/invoice/invoice-letterhead-pdf.service.js +43 -43
  19. package/dist/accounting/invoice/invoice-total.service.d.ts +11 -11
  20. package/dist/accounting/invoice/invoice-total.service.js +54 -54
  21. package/dist/accounting/invoice/reports/excel/analysis-excel.service.d.ts +3 -3
  22. package/dist/accounting/invoice/reports/excel/analysis-excel.service.js +8 -7
  23. package/dist/accounting/invoice/reports/excel/category-wise-item-excel.service.d.ts +4 -4
  24. package/dist/accounting/invoice/reports/excel/category-wise-item-excel.service.js +14 -14
  25. package/dist/accounting/invoice/reports/excel/cust-wise-sales-details.d.ts +4 -4
  26. package/dist/accounting/invoice/reports/excel/cust-wise-sales-details.js +8 -8
  27. package/dist/accounting/invoice/reports/excel/cust-wise-sales-summary-excel.service.d.ts +4 -4
  28. package/dist/accounting/invoice/reports/excel/cust-wise-sales-summary-excel.service.js +8 -8
  29. package/dist/accounting/invoice/reports/excel/invoice-wise-excel.service.d.ts +4 -4
  30. package/dist/accounting/invoice/reports/excel/invoice-wise-excel.service.js +8 -8
  31. package/dist/accounting/invoice/reports/excel/item-wise-doctor-sale-excel.service.d.ts +4 -4
  32. package/dist/accounting/invoice/reports/excel/item-wise-doctor-sale-excel.service.js +10 -10
  33. package/dist/accounting/invoice/reports/excel/items-wise-sales-excel.service.d.ts +4 -4
  34. package/dist/accounting/invoice/reports/excel/items-wise-sales-excel.service.js +14 -13
  35. package/dist/accounting/invoice/reports/excel/manf-wise-sales-excel.service.d.ts +4 -4
  36. package/dist/accounting/invoice/reports/excel/manf-wise-sales-excel.service.js +8 -8
  37. package/dist/accounting/invoice/reports/excel/operator-wise-details.d.ts +4 -4
  38. package/dist/accounting/invoice/reports/excel/operator-wise-details.js +8 -8
  39. package/dist/accounting/invoice/reports/excel/operator-wise-summary.d.ts +4 -4
  40. package/dist/accounting/invoice/reports/excel/operator-wise-summary.js +8 -8
  41. package/dist/accounting/invoice/shared-inv-pdf.service.d.ts +6 -6
  42. package/dist/accounting/invoice/shared-inv-pdf.service.js +29 -29
  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/gst/excel/GSTR-RO-excel.service.d.ts +4 -4
  46. package/dist/gst/excel/GSTR-RO-excel.service.js +8 -8
  47. package/dist/gst/excel/GSTR1-excel.service.d.ts +4 -4
  48. package/dist/gst/excel/GSTR1-excel.service.js +10 -10
  49. package/dist/gst/excel/GSTR2-excel.service.d.ts +4 -4
  50. package/dist/gst/excel/GSTR2-excel.service.js +9 -9
  51. package/dist/gst/excel/tally-sales-import.service.d.ts +4 -4
  52. package/dist/gst/excel/tally-sales-import.service.js +8 -8
  53. package/dist/inventory/items/issue-parts-pdf.service.d.ts +6 -6
  54. package/dist/inventory/items/issue-parts-pdf.service.js +32 -32
  55. package/dist/inventory/items/reports/excel/expiring-drugs-excel.service.d.ts +4 -4
  56. package/dist/inventory/items/reports/excel/expiring-drugs-excel.service.js +11 -10
  57. package/dist/inventory/items/reports/excel/item-wise-mout-details.d.ts +4 -4
  58. package/dist/inventory/items/reports/excel/item-wise-mout-details.js +8 -8
  59. package/dist/inventory/items/reports/excel/item-wise-mout-summary.d.ts +4 -4
  60. package/dist/inventory/items/reports/excel/item-wise-mout-summary.js +8 -8
  61. package/dist/inventory/items/reports/excel/spares-issue-excel.service.d.ts +4 -4
  62. package/dist/inventory/items/reports/excel/spares-issue-excel.service.js +12 -12
  63. package/dist/inventory/items/reports/excel/stock-excel.service.d.ts +4 -4
  64. package/dist/inventory/items/reports/excel/stock-excel.service.js +8 -8
  65. package/dist/purchases/payment-made/reports/excel/payments-made-excel.service.d.ts +4 -4
  66. package/dist/purchases/payment-made/reports/excel/payments-made-excel.service.js +9 -9
  67. package/dist/purchases/payment-made/reports/excel/ven-balance-excel.service.d.ts +6 -6
  68. package/dist/purchases/payment-made/reports/excel/ven-balance-excel.service.js +14 -14
  69. package/dist/purchases/purchase-order/po-totals.service.d.ts +7 -7
  70. package/dist/purchases/purchase-order/po-totals.service.js +24 -25
  71. package/dist/purchases/purchase-order/purchase-order-print.service.js +3 -3
  72. package/dist/purchases/purchase-order/purchase-order-totals.service.d.ts +10 -10
  73. package/dist/purchases/purchase-order/purchase-order-totals.service.js +27 -27
  74. package/dist/purchases/vendor-credit-note/vendor-credit-note-print.service.d.ts +1 -1
  75. package/dist/purchases/vendor-credit-note/vendor-credit-note-print.service.js +20 -20
  76. package/dist/purchases/vendor-credit-note/vendor-credit-note-totals.service.d.ts +8 -8
  77. package/dist/purchases/vendor-credit-note/vendor-credit-note-totals.service.js +31 -32
  78. package/dist/purchases/vendor-debit-note/vendor-debit-note-print.service.d.ts +1 -2
  79. package/dist/purchases/vendor-debit-note/vendor-debit-note-print.service.js +10 -32
  80. package/dist/purchases/vendor-debit-note/vendor-debit-note-totals.service.d.ts +6 -6
  81. package/dist/purchases/vendor-debit-note/vendor-debit-note-totals.service.js +19 -19
  82. package/dist/sales/delivery-challan/delivery-challan-print.service.d.ts +1 -2
  83. package/dist/sales/delivery-challan/delivery-challan-print.service.js +10 -33
  84. package/dist/sales/delivery-challan/delivery-challan-totals.d.ts +6 -6
  85. package/dist/sales/delivery-challan/delivery-challan-totals.js +20 -20
  86. package/dist/sales/sales/sales-print.service.d.ts +2 -2
  87. package/dist/sales/sales/sales-print.service.js +18 -18
  88. package/dist/sales/sales/sales-totals.service.d.ts +6 -6
  89. package/dist/sales/sales/sales-totals.service.js +19 -19
  90. package/dist/services/est.print-service.d.ts +18 -18
  91. package/dist/services/est.print-service.js +133 -133
  92. package/dist/services/reports/excel/insurance-expire-excel.service.d.ts +4 -4
  93. package/dist/services/reports/excel/insurance-expire-excel.service.js +8 -8
  94. package/dist/services/reports/excel/next-service-date-excel.service.d.ts +4 -4
  95. package/dist/services/reports/excel/next-service-date-excel.service.js +8 -8
  96. package/dist/services/reports/excel/repair-orders-excel.service.d.ts +5 -5
  97. package/dist/services/reports/excel/repair-orders-excel.service.js +11 -11
  98. package/dist/services/ro-print-service.d.ts +6 -6
  99. package/dist/services/ro-print-service.js +40 -40
  100. package/dist/services/ro-totals.service.d.ts +11 -11
  101. package/dist/services/ro-totals.service.js +50 -50
  102. package/dist/shared/shared-pdf.service.d.ts +0 -16
  103. package/dist/shared/shared-pdf.service.js +36 -34
  104. package/dist/shared/shared-print.service.js +1 -0
  105. package/dist/utils/tr-utils.d.ts +2 -3
  106. package/dist/utils/tr-utils.js +7 -6
  107. package/package.json +1 -1
  108. package/dist/shared/shared-pdfs/shared-pdf.service.d.ts +0 -926
  109. package/dist/shared/shared-pdfs/shared-pdf.service.js +0 -2608
@@ -28,7 +28,7 @@ const XLSX = __importStar(require("xlsx"));
28
28
  const my_date_1 = require("../../../../utils/my-date");
29
29
  const tr_utils_1 = require("../../../../utils/tr-utils");
30
30
  class OperatorWiseDetailsXlsxFileService {
31
- static GetOperatorWiseDetailsExcelData(MainData, searchValue, isSale) {
31
+ static GetOperatorWiseDetailsExcelData(MainData, searchValue, isSale, EntitySettings) {
32
32
  this.wb = {};
33
33
  this.ws = {};
34
34
  this.Row = 0;
@@ -66,7 +66,7 @@ class OperatorWiseDetailsXlsxFileService {
66
66
  // console.log(`${key}: ${searchValue[key]}`);
67
67
  }
68
68
  this.setHeadingInCell(isSale, showSearch);
69
- this.setInvoiceDetailsInCell(MainData);
69
+ this.setInvoiceDetailsInCell(MainData, EntitySettings.DecimalsNumber);
70
70
  this.ws['!ref'] = XLSX.utils.encode_range(this.range);
71
71
  this.ws['!merges'] = this.MergeArray;
72
72
  this.ws["!cols"] = [{ wch: 15 }, { wch: 10 }, { wch: 50 }, { wch: 10 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 20 }];
@@ -187,12 +187,12 @@ class OperatorWiseDetailsXlsxFileService {
187
187
  });
188
188
  this.Row += 2;
189
189
  }
190
- static setInvoiceDetailsInCell(MainData) {
190
+ static setInvoiceDetailsInCell(MainData, DecimalsNumber) {
191
191
  MainData.forEach((InvoiceList) => {
192
- this.SetInvoiceDataInExcel(InvoiceList);
192
+ this.SetInvoiceDataInExcel(InvoiceList, DecimalsNumber);
193
193
  });
194
194
  }
195
- static SetInvoiceDataInExcel(InvoiceInfo) {
195
+ static SetInvoiceDataInExcel(InvoiceInfo, DecimalsNumber) {
196
196
  InvoiceInfo.Date = my_date_1.MyDate.ConvertUTCDateToReadable(InvoiceInfo.CrDate);
197
197
  let InvoiceData = [
198
198
  { text: InvoiceInfo.Code, ColRange: 1, IsString: true },
@@ -207,7 +207,7 @@ class OperatorWiseDetailsXlsxFileService {
207
207
  ];
208
208
  let ColStart = 0;
209
209
  InvoiceData.forEach((InvData) => {
210
- InvData.text = this.ConvertToString(InvData.text, InvData.IsString);
210
+ InvData.text = this.ConvertToString(InvData.text, InvData.IsString, DecimalsNumber);
211
211
  this.SetDataInCell(InvData.text, ColStart, this.Row);
212
212
  this.MergeArray.push({
213
213
  s: { r: this.Row, c: ColStart },
@@ -217,7 +217,7 @@ class OperatorWiseDetailsXlsxFileService {
217
217
  });
218
218
  this.Row += 1;
219
219
  }
220
- static ConvertToString(Text, IsString) {
220
+ static ConvertToString(Text, IsString, DecimalsNumber) {
221
221
  if (IsString) {
222
222
  if (Text == null) {
223
223
  Text = '';
@@ -229,7 +229,7 @@ class OperatorWiseDetailsXlsxFileService {
229
229
  }
230
230
  }
231
231
  if (typeof Text === 'number') {
232
- return Number(tr_utils_1.TrUtils.FixedTo(Text));
232
+ return Number(tr_utils_1.TrUtils.FixedTo(Text, DecimalsNumber));
233
233
  }
234
234
  else {
235
235
  return Text;
@@ -13,11 +13,11 @@ export declare class OperatorWiseSummaryXlsxFileService {
13
13
  };
14
14
  };
15
15
  static ws: any;
16
- static GetOperatorWiseSummaryExcelData(MainData: any, searchValue: any, HeaderName: any): any;
16
+ static GetOperatorWiseSummaryExcelData(MainData: any, searchValue: any, HeaderName: any, EntitySettings: any): any;
17
17
  static setHeadingInCell(HeaderName: any, searchValue: any): void;
18
- static setInvoiceDetailsInCell(MainData: any): void;
19
- static SetInvoiceDataInExcel(InvoiceInfo: any): void;
20
- static ConvertToString(Text: any, IsString: any): any;
18
+ static setInvoiceDetailsInCell(MainData: any, DecimalsNumber: number): void;
19
+ static SetInvoiceDataInExcel(InvoiceInfo: any, DecimalsNumber: number): void;
20
+ static ConvertToString(Text: any, IsString: any, DecimalsNumber: number): any;
21
21
  static SetDataInCell(Data: any, ColRange: number, RowNum: any): void;
22
22
  static getcelltype(cell: any): any;
23
23
  }
@@ -28,7 +28,7 @@ const XLSX = __importStar(require("xlsx"));
28
28
  const my_date_1 = require("../../../../utils/my-date");
29
29
  const tr_utils_1 = require("../../../../utils/tr-utils");
30
30
  class OperatorWiseSummaryXlsxFileService {
31
- static GetOperatorWiseSummaryExcelData(MainData, searchValue, HeaderName) {
31
+ static GetOperatorWiseSummaryExcelData(MainData, searchValue, HeaderName, EntitySettings) {
32
32
  this.wb = {};
33
33
  this.ws = {};
34
34
  this.Row = 0;
@@ -66,7 +66,7 @@ class OperatorWiseSummaryXlsxFileService {
66
66
  // console.log(`${key}: ${searchValue[key]}`);
67
67
  }
68
68
  this.setHeadingInCell(HeaderName, showSearch);
69
- this.setInvoiceDetailsInCell(MainData);
69
+ this.setInvoiceDetailsInCell(MainData, EntitySettings.DecimalsNumber);
70
70
  this.ws['!ref'] = XLSX.utils.encode_range(this.range);
71
71
  this.ws['!merges'] = this.MergeArray;
72
72
  this.ws["!cols"] = [{ wch: 50 }, { wch: 10 }, { wch: 10 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 20 }];
@@ -187,12 +187,12 @@ class OperatorWiseSummaryXlsxFileService {
187
187
  });
188
188
  this.Row += 2;
189
189
  }
190
- static setInvoiceDetailsInCell(MainData) {
190
+ static setInvoiceDetailsInCell(MainData, DecimalsNumber) {
191
191
  MainData.forEach((InvoiceList) => {
192
- this.SetInvoiceDataInExcel(InvoiceList);
192
+ this.SetInvoiceDataInExcel(InvoiceList, DecimalsNumber);
193
193
  });
194
194
  }
195
- static SetInvoiceDataInExcel(InvoiceInfo) {
195
+ static SetInvoiceDataInExcel(InvoiceInfo, DecimalsNumber) {
196
196
  // InvoiceInfo.Date = TrUtils.ConvertDateToReadableFormat(InvoiceInfo.CrDate);
197
197
  let InvoiceData = [
198
198
  // { text: InvoiceInfo.Code, ColRange: 1, IsString: true },
@@ -208,7 +208,7 @@ class OperatorWiseSummaryXlsxFileService {
208
208
  ];
209
209
  let ColStart = 0;
210
210
  InvoiceData.forEach((InvData) => {
211
- InvData.text = this.ConvertToString(InvData.text, InvData.IsString);
211
+ InvData.text = this.ConvertToString(InvData.text, InvData.IsString, DecimalsNumber);
212
212
  this.SetDataInCell(InvData.text, ColStart, this.Row);
213
213
  this.MergeArray.push({
214
214
  s: { r: this.Row, c: ColStart },
@@ -218,7 +218,7 @@ class OperatorWiseSummaryXlsxFileService {
218
218
  });
219
219
  this.Row += 1;
220
220
  }
221
- static ConvertToString(Text, IsString) {
221
+ static ConvertToString(Text, IsString, DecimalsNumber) {
222
222
  if (IsString) {
223
223
  if (Text == null) {
224
224
  Text = '';
@@ -230,7 +230,7 @@ class OperatorWiseSummaryXlsxFileService {
230
230
  }
231
231
  }
232
232
  if (typeof Text === 'number') {
233
- return Number(tr_utils_1.TrUtils.FixedTo(Text));
233
+ return Number(tr_utils_1.TrUtils.FixedTo(Text, DecimalsNumber));
234
234
  }
235
235
  else {
236
236
  return Text;
@@ -225,10 +225,10 @@ export declare class SharedInvoiceprintService {
225
225
  })[];
226
226
  static PreparesparePartsTable(ROPrintData: any, isAuto: boolean): any;
227
227
  static GetLaborPartsTableForView(Parts: any, Ops: any, PrintPartNo: any): any;
228
- static WithOutDiscountFieldTable(Parts: any, Ops: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, isAuto: boolean): any;
229
- static BuildTableBodyForLaborAndParts(Parts: any, Labor: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, isAuto: boolean): any;
230
- static GetWithOutDiscAndTaxFieldHeader(Parts: any, Ops: any, ShowTaxColumn: any, PrintPartNo: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, isAuto: boolean): any;
231
- static TaxDataTable(Parts: any, Ops: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, isAuto: boolean): {
228
+ static WithOutDiscountFieldTable(Parts: any, Ops: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, isAuto: boolean, DecimalsNumber: number): any;
229
+ static BuildTableBodyForLaborAndParts(Parts: any, Labor: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, isAuto: boolean, DecimalsNumber: number): any;
230
+ static GetWithOutDiscAndTaxFieldHeader(Parts: any, Ops: any, ShowTaxColumn: any, PrintPartNo: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, isAuto: boolean, DecimalsNumber: number): any;
231
+ static TaxDataTable(Parts: any, Ops: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, isAuto: boolean, DecimalsNumber: number): {
232
232
  style: string;
233
233
  table: {
234
234
  widths: number[];
@@ -241,7 +241,7 @@ export declare class SharedInvoiceprintService {
241
241
  vLineColor: (i: any, node: any) => string;
242
242
  };
243
243
  };
244
- static ConsolidateDataTable(Parts: any, Ops: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, isAuto: boolean): {
244
+ static ConsolidateDataTable(Parts: any, Ops: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, isAuto: boolean, DecimalsNumber: number): {
245
245
  style: string;
246
246
  table: {
247
247
  widths: number[];
@@ -254,7 +254,7 @@ export declare class SharedInvoiceprintService {
254
254
  vLineColor: (i: any, node: any) => string;
255
255
  };
256
256
  };
257
- static NoTaxDataTable(Parts: any, Ops: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, isAuto: boolean): {
257
+ static NoTaxDataTable(Parts: any, Ops: any, PrintPartNo: any, ShowTaxColumn: any, Body: any, ShowIGST: any, ConsolidateGST: any, ShowDiscountColumn: any, isAuto: boolean, DecimalsNumber: number): {
258
258
  style: string;
259
259
  table: {
260
260
  widths: number[];
@@ -78,7 +78,7 @@ class SharedInvoiceprintService {
78
78
  if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
79
79
  ROPrintData.PrintInfo[i].Text = '';
80
80
  }
81
- List.push(ROPrintData.PrintInfo[i].Text, this.WithOutDiscountFieldTable(tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Items), tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Ops), ROPrintData.ShowTaxColumn, ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn, isAuto));
81
+ List.push(ROPrintData.PrintInfo[i].Text, this.WithOutDiscountFieldTable(tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Items), tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Ops), ROPrintData.ShowTaxColumn, ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn, isAuto, ROPrintData.Entity.DecimalsNumber));
82
82
  }
83
83
  }
84
84
  else {
@@ -90,7 +90,7 @@ class SharedInvoiceprintService {
90
90
  if (tr_utils_1.TrUtils.IsNull(ROPrintData.PrintInfo[i].Text)) {
91
91
  ROPrintData.PrintInfo[i].Text = '';
92
92
  }
93
- List.push(ROPrintData.PrintInfo[i].Text, this.GetWithOutDiscAndTaxFieldHeader(tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Items), tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Ops), ROPrintData.ShowTaxColumn, ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn, isAuto));
93
+ List.push(ROPrintData.PrintInfo[i].Text, this.GetWithOutDiscAndTaxFieldHeader(tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Items), tr_utils_1.TrUtils.Stringify(ROPrintData.PrintInfo[i].Ops), ROPrintData.ShowTaxColumn, ROPrintData.Entity.MPN, ROPrintData.Entity.Body, ROPrintData.ShowIGST, ROPrintData.ConsolidateGST, ROPrintData.ShowDiscountColumn, isAuto, ROPrintData.Entity.DecimalsNumber));
94
94
  }
95
95
  }
96
96
  }
@@ -129,7 +129,7 @@ class SharedInvoiceprintService {
129
129
  return a;
130
130
  }
131
131
  }
132
- static WithOutDiscountFieldTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto) {
132
+ static WithOutDiscountFieldTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber) {
133
133
  if (Parts.length !== 0 || Ops.length !== 0) {
134
134
  if (PrintPartNo) {
135
135
  return {
@@ -138,7 +138,7 @@ class SharedInvoiceprintService {
138
138
  table: {
139
139
  widths: [25, 60, 155, 30, 50, 60, 30, 50],
140
140
  headerRows: 1,
141
- body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto)
141
+ body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber)
142
142
  },
143
143
  layout: shared_print_service_1.PrintSharedService.LayOutStyleanother()
144
144
  };
@@ -162,7 +162,7 @@ class SharedInvoiceprintService {
162
162
  return a;
163
163
  }
164
164
  }
165
- static BuildTableBodyForLaborAndParts(Parts, Labor, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto) {
165
+ static BuildTableBodyForLaborAndParts(Parts, Labor, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber) {
166
166
  var body = [];
167
167
  let columns = shared_print_service_1.PrintSharedService.GetWithOutDiscountFieldHeaderSharedInv(PrintPartNo, ShowTaxColumn, Body);
168
168
  body = columns;
@@ -186,14 +186,14 @@ class SharedInvoiceprintService {
186
186
  let dpartadding1 = {};
187
187
  dpartadding1.SNo = '';
188
188
  dpartadding1.Desc = 'Spare Total';
189
- dpartadding1.QtyAndUoM = tr_utils_1.TrUtils.FixedTo(Qty);
189
+ dpartadding1.QtyAndUoM = tr_utils_1.TrUtils.FixedTo(Qty, DecimalsNumber);
190
190
  dpartadding1.bold = true;
191
- dpartadding1.UnPr = tr_utils_1.TrUtils.FixedTo(Taxable);
192
- dpartadding1.SGSTAmt = tr_utils_1.TrUtils.FixedTo(SGSTAMT);
193
- dpartadding1.IGSTAmt = tr_utils_1.TrUtils.FixedTo(IGSTAMT);
194
- dpartadding1.CGSTAmt = tr_utils_1.TrUtils.FixedTo(CGSTAMT);
191
+ dpartadding1.UnPr = tr_utils_1.TrUtils.FixedTo(Taxable, DecimalsNumber);
192
+ dpartadding1.SGSTAmt = tr_utils_1.TrUtils.FixedTo(SGSTAMT, DecimalsNumber);
193
+ dpartadding1.IGSTAmt = tr_utils_1.TrUtils.FixedTo(IGSTAMT, DecimalsNumber);
194
+ dpartadding1.CGSTAmt = tr_utils_1.TrUtils.FixedTo(CGSTAMT, DecimalsNumber);
195
195
  dpartadding1.TCode = ShowTaxColumn ? 114 : undefined;
196
- dpartadding1.LineTotal = tr_utils_1.TrUtils.FixPriceValue(FinalTotal);
196
+ dpartadding1.LineTotal = tr_utils_1.TrUtils.FixPriceValue(FinalTotal, DecimalsNumber);
197
197
  Parts.push({ SNo: '' });
198
198
  Parts.push(dpartadding1);
199
199
  }
@@ -305,13 +305,13 @@ class SharedInvoiceprintService {
305
305
  dpartadding1.SNo = '';
306
306
  dpartadding1.Desc = 'Labor Total';
307
307
  // dpartadding1.QtyAndUoM = Qty;
308
- dpartadding1.UnPr = tr_utils_1.TrUtils.FixedTo(Taxable);
309
- dpartadding1.SGSTAmt = tr_utils_1.TrUtils.FixedTo(SGSTAMT);
310
- dpartadding1.IGSTAmt = tr_utils_1.TrUtils.FixedTo(IGSTAMT);
311
- dpartadding1.CGSTAmt = tr_utils_1.TrUtils.FixedTo(CGSTAMT);
308
+ dpartadding1.UnPr = tr_utils_1.TrUtils.FixedTo(Taxable, DecimalsNumber);
309
+ dpartadding1.SGSTAmt = tr_utils_1.TrUtils.FixedTo(SGSTAMT, DecimalsNumber);
310
+ dpartadding1.IGSTAmt = tr_utils_1.TrUtils.FixedTo(IGSTAMT, DecimalsNumber);
311
+ dpartadding1.CGSTAmt = tr_utils_1.TrUtils.FixedTo(CGSTAMT, DecimalsNumber);
312
312
  dpartadding1.TCode = ShowTaxColumn ? 114 : undefined;
313
313
  dpartadding1.bold = true;
314
- dpartadding1.LineTotal = tr_utils_1.TrUtils.FixPriceValue(FinalTotal);
314
+ dpartadding1.LineTotal = tr_utils_1.TrUtils.FixPriceValue(FinalTotal, DecimalsNumber);
315
315
  Labor.push({ SNo: '' });
316
316
  Labor.push(dpartadding1);
317
317
  }
@@ -407,17 +407,17 @@ class SharedInvoiceprintService {
407
407
  });
408
408
  return body;
409
409
  }
410
- static GetWithOutDiscAndTaxFieldHeader(Parts, Ops, ShowTaxColumn, PrintPartNo, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto) {
410
+ static GetWithOutDiscAndTaxFieldHeader(Parts, Ops, ShowTaxColumn, PrintPartNo, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber) {
411
411
  if (Parts.length !== 0 || Ops.length !== 0) {
412
412
  if (ShowTaxColumn) {
413
- return this.TaxDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto);
413
+ return this.TaxDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber);
414
414
  }
415
415
  else {
416
416
  if (ConsolidateGST) {
417
- return this.ConsolidateDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto);
417
+ return this.ConsolidateDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber);
418
418
  }
419
419
  else {
420
- return this.NoTaxDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto);
420
+ return this.NoTaxDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber);
421
421
  }
422
422
  }
423
423
  }
@@ -426,7 +426,7 @@ class SharedInvoiceprintService {
426
426
  return a;
427
427
  }
428
428
  }
429
- static TaxDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto) {
429
+ static TaxDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber) {
430
430
  if (PrintPartNo) {
431
431
  // if (ShowIGST) {
432
432
  // return {
@@ -444,7 +444,7 @@ class SharedInvoiceprintService {
444
444
  table: {
445
445
  widths: [25, 50, 150, 40, 25, 50, 70, 50, 40],
446
446
  // headerRows: 2,
447
- body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto)
447
+ body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber)
448
448
  },
449
449
  layout: shared_print_service_1.PrintSharedService.LayOutStyle()
450
450
  };
@@ -467,21 +467,21 @@ class SharedInvoiceprintService {
467
467
  table: {
468
468
  widths: [25, 170, 40, 40, 50, 70, 60, 50],
469
469
  // headerRows: 2,
470
- body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto)
470
+ body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber)
471
471
  },
472
472
  layout: shared_print_service_1.PrintSharedService.LayOutStyle()
473
473
  };
474
474
  // }
475
475
  }
476
476
  }
477
- static ConsolidateDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto) {
477
+ static ConsolidateDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber) {
478
478
  if (PrintPartNo) {
479
479
  return {
480
480
  style: 'tableExample',
481
481
  table: {
482
482
  widths: [25, 70, 263, 25, 60, 80, 10, 40],
483
483
  // headerRows: 1,
484
- body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto)
484
+ body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber)
485
485
  },
486
486
  layout: shared_print_service_1.PrintSharedService.LayOutStyle()
487
487
  };
@@ -492,20 +492,20 @@ class SharedInvoiceprintService {
492
492
  table: {
493
493
  widths: [25, 295, 50, 80, 80, 10, 40],
494
494
  // headerRows: 1,
495
- body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto)
495
+ body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber)
496
496
  },
497
497
  layout: shared_print_service_1.PrintSharedService.LayOutStyle()
498
498
  };
499
499
  }
500
500
  }
501
- static NoTaxDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto) {
501
+ static NoTaxDataTable(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber) {
502
502
  if (PrintPartNo) {
503
503
  return {
504
504
  style: 'tableExample',
505
505
  table: {
506
506
  widths: shared_print_service_1.PrintSharedService.WidthForInsuranceOrNot(ShowDiscountColumn, PrintPartNo),
507
507
  // headerRows: 1,
508
- body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto)
508
+ body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber)
509
509
  },
510
510
  layout: shared_print_service_1.PrintSharedService.LayOutStyle()
511
511
  };
@@ -516,7 +516,7 @@ class SharedInvoiceprintService {
516
516
  table: {
517
517
  widths: shared_print_service_1.PrintSharedService.WidthForInsuranceOrNot(ShowDiscountColumn, PrintPartNo),
518
518
  // headerRows: 1,
519
- body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto)
519
+ body: this.BuildTableBodyForLaborAndParts(Parts, Ops, PrintPartNo, ShowTaxColumn, Body, ShowIGST, ConsolidateGST, ShowDiscountColumn, isAuto, DecimalsNumber)
520
520
  },
521
521
  layout: shared_print_service_1.PrintSharedService.LayOutStyle()
522
522
  };
@@ -1,5 +1,5 @@
1
1
  export declare class AppointmentTotalsService {
2
- static GetTotalsValue(OriRecordData: any, TaxCodes: any[], detailedInfo: boolean, withItems: boolean): any;
2
+ static GetTotalsValue(OriRecordData: any, TaxCodes: any[], detailedInfo: boolean, withItems: boolean, EntitySettings: any): any;
3
3
  static CalculateLaborValues(opCodesList: any, isTaxable: boolean): any;
4
4
  static FilterValidLaborItems(opCodesList: any[]): any[];
5
5
  static ResetLaborValuesIfInvalid(opCodesList: any): any;
@@ -7,16 +7,16 @@ export declare class AppointmentTotalsService {
7
7
  static GetOperationsDiscountPrice(OperationsList: any): any;
8
8
  static GetOperationsAfterDiscount(OperationsList: any): any;
9
9
  static GetOperationsAfterTax(OperationsList: any, isTaxable: boolean): any;
10
- static GetROTotalsData(argRecordData: any, dupRecordData: any, TaxCodes: any, withItems: boolean, detailedInfo: any): any;
10
+ static GetROTotalsData(argRecordData: any, dupRecordData: any, TaxCodes: any, withItems: boolean, detailedInfo: any, DecimalsNumber: number): any;
11
11
  static ResetDiscountValuesIfInvalid(dupRecordData: any): any;
12
12
  static SetMainDiscountValues(argRecordData: any, dupRecordData: any, detailedInfo: boolean): any;
13
- static GetFinalCustomerTotalsData(argRecordData: any, dupRecordData: any, detailedInfo: boolean): any;
13
+ static GetFinalCustomerTotalsData(argRecordData: any, dupRecordData: any, detailedInfo: boolean, DecimalsNumber: number): any;
14
14
  static GetCustSubTotal(LaborList: any): any;
15
15
  static GetCustLaborTotalAfterDiscount(LaborList: any): any;
16
16
  static GetCustLaborTaxTotal(opCodesList: any, IsTaxable: boolean): any;
17
- static GetCustomerTotalBasedOnTaxType(dupRecordData: any, LaborTaxAmount: number, LaborList: any, IsTaxable: boolean): any;
18
- static GetDetailedTotalsData(argRecordData: any, dupRecordData: any, TaxCodes: any): any;
19
- static GetCustLaborDiscountedTotal(LaborList: any, isTaxable: boolean, finalTotalsData: any): number;
17
+ static GetCustomerTotalBasedOnTaxType(dupRecordData: any, LaborTaxAmount: number, LaborList: any, IsTaxable: boolean, DecimalsNumber: number): any;
18
+ static GetDetailedTotalsData(argRecordData: any, dupRecordData: any, TaxCodes: any, DecimalsNumber: number): any;
19
+ static GetCustLaborDiscountedTotal(LaborList: any, isTaxable: boolean, finalTotalsData: any, DecimalsNumber: number): number;
20
20
  static GetCustLaborCGSTTaxTotal(opCodesList: any, IsTaxable: boolean): any;
21
21
  static GetCustLaborIGSTTaxTotal(opCodesList: any, IsTaxable: boolean): any;
22
22
  static GetCustLaborSGSTTaxTotal(opCodesList: any, IsTaxable: boolean): any;
@@ -1,14 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AppointmentTotalsService = void 0;
4
+ const aggregation_1 = require("../../aggregation/aggregation");
4
5
  const enums_1 = require("../../enums/enums");
5
6
  const tr_utils_1 = require("../../utils/tr-utils");
6
7
  class AppointmentTotalsService {
7
- static GetTotalsValue(OriRecordData, TaxCodes, detailedInfo, withItems) {
8
+ static GetTotalsValue(OriRecordData, TaxCodes, detailedInfo, withItems, EntitySettings) {
8
9
  let dupRecordData = tr_utils_1.TrUtils.Stringify(OriRecordData);
9
10
  let argRecordData = {};
10
11
  dupRecordData.Ops = this.CalculateLaborValues(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax));
11
- argRecordData = this.GetROTotalsData(argRecordData, dupRecordData, TaxCodes, withItems, detailedInfo);
12
+ argRecordData = this.GetROTotalsData(argRecordData, dupRecordData, TaxCodes, withItems, detailedInfo, EntitySettings.DecimalsNumber);
12
13
  return argRecordData;
13
14
  }
14
15
  static CalculateLaborValues(opCodesList, isTaxable) {
@@ -77,12 +78,12 @@ class AppointmentTotalsService {
77
78
  });
78
79
  return OperationsList;
79
80
  }
80
- static GetROTotalsData(argRecordData, dupRecordData, TaxCodes, withItems, detailedInfo) {
81
+ static GetROTotalsData(argRecordData, dupRecordData, TaxCodes, withItems, detailedInfo, DecimalsNumber) {
81
82
  dupRecordData = this.ResetDiscountValuesIfInvalid(dupRecordData);
82
83
  argRecordData = this.SetMainDiscountValues(argRecordData, dupRecordData, detailedInfo);
83
- argRecordData = this.GetFinalCustomerTotalsData(argRecordData, dupRecordData, detailedInfo);
84
+ argRecordData = this.GetFinalCustomerTotalsData(argRecordData, dupRecordData, detailedInfo, DecimalsNumber);
84
85
  if (detailedInfo) {
85
- argRecordData = this.GetDetailedTotalsData(argRecordData, dupRecordData, TaxCodes);
86
+ argRecordData = this.GetDetailedTotalsData(argRecordData, dupRecordData, TaxCodes, DecimalsNumber);
86
87
  }
87
88
  if (withItems) {
88
89
  argRecordData.Ops = dupRecordData.Ops;
@@ -109,21 +110,20 @@ class AppointmentTotalsService {
109
110
  }
110
111
  return argRecordData;
111
112
  }
112
- static GetFinalCustomerTotalsData(argRecordData, dupRecordData, detailedInfo) {
113
+ static GetFinalCustomerTotalsData(argRecordData, dupRecordData, detailedInfo, DecimalsNumber) {
113
114
  let CustomerAfterDiscTotals = this.GetCustSubTotal(dupRecordData.Ops);
114
115
  let CustLaborTaxTotal = this.GetCustLaborTaxTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax));
115
- let CustLaborDiscTotal = this.GetCustLaborDiscountedTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), dupRecordData);
116
+ let CustLaborDiscTotal = this.GetCustLaborDiscountedTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), dupRecordData, DecimalsNumber);
116
117
  let CustLaborTotalAfterDisc = this.GetCustLaborTotalAfterDiscount(dupRecordData.Ops);
117
- argRecordData.STotal = tr_utils_1.TrUtils.FixPriceValue(CustLaborDiscTotal + CustLaborTotalAfterDisc);
118
- argRecordData.CustLaborTotalBeforeDisc = tr_utils_1.TrUtils.FixedTo(argRecordData.CustLaborTotalAfterDisc
119
- + argRecordData.CustLaborDiscTotal);
120
- argRecordData.SubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals);
121
- let CustTotal = this.GetCustomerTotalBasedOnTaxType(dupRecordData, CustLaborTaxTotal, dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax));
118
+ argRecordData.STotal = tr_utils_1.TrUtils.FixPriceValue((0, aggregation_1.addition)(CustLaborDiscTotal, CustLaborTotalAfterDisc), DecimalsNumber);
119
+ argRecordData.CustLaborTotalBeforeDisc = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(argRecordData.CustLaborTotalAfterDisc, argRecordData.CustLaborDiscTotal, DecimalsNumber));
120
+ argRecordData.SubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals, DecimalsNumber);
121
+ let CustTotal = this.GetCustomerTotalBasedOnTaxType(dupRecordData, CustLaborTaxTotal, dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), DecimalsNumber);
122
122
  if (detailedInfo) {
123
- argRecordData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals);
124
- argRecordData.FixedTotal = tr_utils_1.TrUtils.FixedTo(CustTotal);
123
+ argRecordData.FixedSubTotal = tr_utils_1.TrUtils.FixedTo(CustomerAfterDiscTotals, DecimalsNumber);
124
+ argRecordData.FixedTotal = tr_utils_1.TrUtils.FixedTo(CustTotal, DecimalsNumber);
125
125
  }
126
- argRecordData.Round = tr_utils_1.TrUtils.FixedTo(Math.round(CustTotal) - CustTotal);
126
+ argRecordData.Round = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.subtraction)(Math.round(CustTotal), CustTotal), DecimalsNumber);
127
127
  argRecordData.Total = Math.round(CustTotal);
128
128
  return argRecordData;
129
129
  }
@@ -147,29 +147,28 @@ class AppointmentTotalsService {
147
147
  }
148
148
  return TotalTaxAmt;
149
149
  }
150
- static GetCustomerTotalBasedOnTaxType(dupRecordData, LaborTaxAmount, LaborList, IsTaxable) {
150
+ static GetCustomerTotalBasedOnTaxType(dupRecordData, LaborTaxAmount, LaborList, IsTaxable, DecimalsNumber) {
151
151
  let SubTotalWithTax = 0;
152
152
  let LaborTotalAfterDisc = this.GetCustLaborTotalAfterDiscount(LaborList);
153
153
  if (IsTaxable) {
154
- SubTotalWithTax = LaborTotalAfterDisc + LaborTaxAmount;
154
+ SubTotalWithTax = (0, aggregation_1.addition)(LaborTotalAfterDisc, LaborTaxAmount);
155
155
  }
156
156
  else {
157
- SubTotalWithTax = tr_utils_1.TrUtils.FixedTo((LaborTotalAfterDisc - dupRecordData.LDisc) - dupRecordData.Disc);
157
+ SubTotalWithTax = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.subtraction)(LaborTotalAfterDisc - dupRecordData.LDisc, dupRecordData.Disc), DecimalsNumber);
158
158
  }
159
159
  return SubTotalWithTax;
160
160
  }
161
- static GetDetailedTotalsData(argRecordData, dupRecordData, TaxCodes) {
162
- argRecordData.CustLaborDiscTotal = this.GetCustLaborDiscountedTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), dupRecordData);
161
+ static GetDetailedTotalsData(argRecordData, dupRecordData, TaxCodes, DecimalsNumber) {
162
+ argRecordData.CustLaborDiscTotal = this.GetCustLaborDiscountedTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), dupRecordData, DecimalsNumber);
163
163
  argRecordData.CustLaborTotalAfterDisc = this.GetCustLaborTotalAfterDiscount(dupRecordData.Ops);
164
- argRecordData.CustLaborTotalBeforeDisc = tr_utils_1.TrUtils.FixedTo(argRecordData.CustLaborTotalAfterDisc
165
- + argRecordData.CustLaborDiscTotal);
164
+ argRecordData.CustLaborTotalBeforeDisc = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(argRecordData.CustLaborTotalAfterDisc, argRecordData.CustLaborDiscTotal), DecimalsNumber);
166
165
  argRecordData.CustLaborITax = this.GetCustLaborTaxTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax));
167
166
  argRecordData.CustLaborSGST = this.GetCustLaborSGSTTaxTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax));
168
167
  argRecordData.CustLaborCGST = this.GetCustLaborCGSTTaxTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax));
169
168
  argRecordData.CustLaborIGST = this.GetCustLaborIGSTTaxTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax));
170
169
  argRecordData.CustLaborLDiscAmount = this.GetLaborLDiscAmount(argRecordData.CustLaborTotalAfterDisc, argRecordData.LDisc);
171
170
  argRecordData.CustLaborAfterLDisc = argRecordData.CustLaborTotalAfterDisc;
172
- argRecordData.CustLaborAfterTax = tr_utils_1.TrUtils.FixedTo(argRecordData.CustLaborITax + argRecordData.CustLaborAfterLDisc);
171
+ argRecordData.CustLaborAfterTax = tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(argRecordData.CustLaborITax, argRecordData.CustLaborAfterLDisc), DecimalsNumber);
173
172
  argRecordData.CustTotalRoundedBy = argRecordData.Round;
174
173
  argRecordData.CustRoundedTotal = argRecordData.Total;
175
174
  for (var key in argRecordData) {
@@ -177,12 +176,12 @@ class AppointmentTotalsService {
177
176
  key !== 'LDisc' && key !== 'LPerc' && key !== 'PDisc' &&
178
177
  key !== 'PPerc' && key !== 'Disc' && key !== 'Perc' && key !== 'Tax'
179
178
  && typeof argRecordData[key] === 'number') {
180
- argRecordData[key] = tr_utils_1.TrUtils.FixPriceValue(argRecordData[key]);
179
+ argRecordData[key] = tr_utils_1.TrUtils.FixPriceValue(argRecordData[key], DecimalsNumber);
181
180
  }
182
181
  }
183
182
  return argRecordData;
184
183
  }
185
- static GetCustLaborDiscountedTotal(LaborList, isTaxable, finalTotalsData) {
184
+ static GetCustLaborDiscountedTotal(LaborList, isTaxable, finalTotalsData, DecimalsNumber) {
186
185
  let LaborDiscountedTotal = 0;
187
186
  let overallLaborDisc = 0;
188
187
  if (!isTaxable) {
@@ -191,13 +190,13 @@ class AppointmentTotalsService {
191
190
  LaborList.forEach((Labor) => {
192
191
  LaborDiscountedTotal += Labor.CustDiscountedPrice;
193
192
  });
194
- return tr_utils_1.TrUtils.FixedTo(LaborDiscountedTotal + overallLaborDisc);
193
+ return tr_utils_1.TrUtils.FixedTo((0, aggregation_1.addition)(LaborDiscountedTotal, overallLaborDisc), DecimalsNumber);
195
194
  }
196
195
  static GetCustLaborCGSTTaxTotal(opCodesList, IsTaxable) {
197
196
  let TotalTaxAmt = 0;
198
197
  if (IsTaxable) {
199
198
  opCodesList.forEach((Labor) => {
200
- TotalTaxAmt = TotalTaxAmt + Labor.CCGST;
199
+ TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Labor.CCGST);
201
200
  });
202
201
  }
203
202
  return TotalTaxAmt;
@@ -206,7 +205,7 @@ class AppointmentTotalsService {
206
205
  let TotalTaxAmt = 0;
207
206
  if (IsTaxable) {
208
207
  opCodesList.forEach((Labor) => {
209
- TotalTaxAmt = TotalTaxAmt + Labor.CIGST;
208
+ TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Labor.CIGST);
210
209
  });
211
210
  }
212
211
  return TotalTaxAmt;
@@ -215,7 +214,7 @@ class AppointmentTotalsService {
215
214
  let TotalTaxAmt = 0;
216
215
  if (IsTaxable) {
217
216
  opCodesList.forEach((Labor) => {
218
- TotalTaxAmt = TotalTaxAmt + Labor.CSGST;
217
+ TotalTaxAmt = (0, aggregation_1.addition)(TotalTaxAmt, Labor.CSGST);
219
218
  });
220
219
  }
221
220
  return TotalTaxAmt;
@@ -14,13 +14,13 @@ export declare class GSTROXlsxFileService {
14
14
  };
15
15
  static ws: any;
16
16
  static MainHeadings: any[];
17
- static GetGSTROExcelData(MainData: any, WOTypes: any): any;
17
+ static GetGSTROExcelData(MainData: any, WOTypes: any, EntitySettings: any): any;
18
18
  static GetTotals(MainData: any, WOTypes: any): any;
19
19
  static GetWOTypeName(Type: any, WOTypes: any): any;
20
20
  static setHeadingInCell(MainData: any): void;
21
- static setInvoiceDetailsInCell(MainData: any): void;
22
- static SetInvoiceDataInExcel(InvoiceInfo: any, Index: any): void;
23
- static ConvertToString(Text: any, IsString: any): any;
21
+ static setInvoiceDetailsInCell(MainData: any, DecimalsNumber: number): void;
22
+ static SetInvoiceDataInExcel(InvoiceInfo: any, Index: any, DecimalsNumber: number): void;
23
+ static ConvertToString(Text: any, IsString: any, DecimalsNumber: number): any;
24
24
  static SetDataInCell(Data: any, ColRange: number, RowNum: any): void;
25
25
  static getcelltype(cell: any): any;
26
26
  static ConvertDateToReadableFormat(DateObject: any): any;
@@ -27,7 +27,7 @@ exports.GSTROXlsxFileService = void 0;
27
27
  const XLSX = __importStar(require("xlsx"));
28
28
  const tr_utils_1 = require("../../utils/tr-utils");
29
29
  class GSTROXlsxFileService {
30
- static GetGSTROExcelData(MainData, WOTypes) {
30
+ static GetGSTROExcelData(MainData, WOTypes, EntitySettings) {
31
31
  this.wb = {};
32
32
  this.ws = {};
33
33
  this.Row = 0;
@@ -40,7 +40,7 @@ class GSTROXlsxFileService {
40
40
  this.wb.SheetNames = [];
41
41
  MainData = this.GetTotals(MainData, WOTypes);
42
42
  this.setHeadingInCell(MainData);
43
- this.setInvoiceDetailsInCell(MainData);
43
+ this.setInvoiceDetailsInCell(MainData, EntitySettings);
44
44
  this.ws['!ref'] = XLSX.utils.encode_range(this.range);
45
45
  this.ws['!merges'] = this.MergeArray;
46
46
  this.ws["!cols"] = [{ wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 50 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 }, { wch: 15 },
@@ -767,16 +767,16 @@ class GSTROXlsxFileService {
767
767
  });
768
768
  this.Row += 2;
769
769
  }
770
- static setInvoiceDetailsInCell(MainData) {
770
+ static setInvoiceDetailsInCell(MainData, DecimalsNumber) {
771
771
  let SNO = 0;
772
772
  MainData.forEach((InvoiceList) => {
773
773
  InvoiceList.Invoices.forEach((invoice, Index) => {
774
774
  SNO = SNO + 1;
775
- this.SetInvoiceDataInExcel(invoice, SNO);
775
+ this.SetInvoiceDataInExcel(invoice, SNO, DecimalsNumber);
776
776
  });
777
777
  });
778
778
  }
779
- static SetInvoiceDataInExcel(InvoiceInfo, Index) {
779
+ static SetInvoiceDataInExcel(InvoiceInfo, Index, DecimalsNumber) {
780
780
  // console.log(InvoiceInfo);
781
781
  InvoiceInfo.CrDate = this.ConvertDateToReadableFormat(InvoiceInfo.CrDate);
782
782
  let InvoiceData = [];
@@ -844,7 +844,7 @@ class GSTROXlsxFileService {
844
844
  });
845
845
  let ColStart = 0;
846
846
  InvoiceData.forEach((InvData) => {
847
- InvData.text = this.ConvertToString(InvData.text, InvData.IsString);
847
+ InvData.text = this.ConvertToString(InvData.text, InvData.IsString, DecimalsNumber);
848
848
  this.SetDataInCell(InvData.text, ColStart, this.Row);
849
849
  this.MergeArray.push({
850
850
  s: { r: this.Row, c: ColStart },
@@ -854,7 +854,7 @@ class GSTROXlsxFileService {
854
854
  });
855
855
  this.Row += 1;
856
856
  }
857
- static ConvertToString(Text, IsString) {
857
+ static ConvertToString(Text, IsString, DecimalsNumber) {
858
858
  if (IsString) {
859
859
  if (Text == null) {
860
860
  Text = '';
@@ -866,7 +866,7 @@ class GSTROXlsxFileService {
866
866
  }
867
867
  }
868
868
  if (typeof Text === 'number') {
869
- return Number(tr_utils_1.TrUtils.FixedTo(Text));
869
+ return Number(tr_utils_1.TrUtils.FixedTo(Text, DecimalsNumber));
870
870
  }
871
871
  else {
872
872
  return Text;
@@ -4,12 +4,12 @@ export declare class GSTR1ExcelService {
4
4
  static MergeArray: any[];
5
5
  static range: any;
6
6
  static ws: any;
7
- static GetGSTR1ExcelData(MainData: any): any;
7
+ static GetGSTR1ExcelData(MainData: any, EntitySettings: any): any;
8
8
  static GetTotals(MainData: any): any;
9
9
  static setHeadingInCell(): void;
10
- static setInvoiceDetailsInCell(MainData: any): void;
11
- static SetInvoiceDataInExcel(InvoiceList: any): void;
12
- static ConvertToString(Text: any, IsString: any): any;
10
+ static setInvoiceDetailsInCell(MainData: any, DecimalsNumber: number): void;
11
+ static SetInvoiceDataInExcel(InvoiceList: any, DecimalsNumber: number): void;
12
+ static ConvertToString(Text: any, IsString: any, DecimalsNumber: number): any;
13
13
  static SetDataInCell(Data: any, ColRange: number, RowNum: any): void;
14
14
  static getcelltype(cell: any): any;
15
15
  static ConvertDateToReadableFormat(DateObject: any): any;