shareneus 1.4.48 → 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 (47) 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/shared-inv-pdf.service.d.ts +6 -6
  22. package/dist/accounting/invoice/shared-inv-pdf.service.js +29 -29
  23. package/dist/appointments/appointments/appointment-total.service.d.ts +6 -6
  24. package/dist/appointments/appointments/appointment-total.service.js +28 -29
  25. package/dist/purchases/purchase-order/po-totals.service.d.ts +7 -7
  26. package/dist/purchases/purchase-order/po-totals.service.js +24 -25
  27. package/dist/purchases/purchase-order/purchase-order-print.service.js +3 -3
  28. package/dist/purchases/purchase-order/purchase-order-totals.service.d.ts +10 -10
  29. package/dist/purchases/purchase-order/purchase-order-totals.service.js +27 -27
  30. package/dist/purchases/vendor-debit-note/vendor-debit-note-print.service.d.ts +1 -2
  31. package/dist/purchases/vendor-debit-note/vendor-debit-note-print.service.js +10 -32
  32. package/dist/sales/delivery-challan/delivery-challan-print.service.d.ts +1 -2
  33. package/dist/sales/delivery-challan/delivery-challan-print.service.js +9 -32
  34. package/dist/sales/sales/sales-print.service.d.ts +2 -2
  35. package/dist/sales/sales/sales-print.service.js +17 -17
  36. package/dist/services/est.print-service.d.ts +18 -18
  37. package/dist/services/est.print-service.js +132 -132
  38. package/dist/services/ro-print-service.d.ts +6 -6
  39. package/dist/services/ro-print-service.js +39 -39
  40. package/dist/shared/shared-pdf.service.d.ts +0 -16
  41. package/dist/shared/shared-pdf.service.js +36 -34
  42. package/dist/shared/shared-print.service.js +1 -0
  43. package/dist/utils/tr-utils.d.ts +2 -3
  44. package/dist/utils/tr-utils.js +5 -5
  45. package/package.json +1 -1
  46. package/dist/shared/shared-pdfs/shared-pdf.service.d.ts +0 -926
  47. package/dist/shared/shared-pdfs/shared-pdf.service.js +0 -2608
@@ -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;
@@ -1,24 +1,24 @@
1
1
  export declare class POTotalsService {
2
- static GetTotalsValue(ItemsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, Disc: any, Perc: any, TaxCodes: any, WithItems: boolean): any;
2
+ static GetTotalsValue(ItemsList: any, IsIndependentTax: boolean, DetailedInfo: boolean, Disc: any, Perc: any, TaxCodes: any, WithItems: boolean, EntitySettings: any): any;
3
3
  static CalculateItemValues(ItemsList: any): any;
4
4
  static ResetItemValues(ItemsList: any): any;
5
5
  static ResetItemValueIfInvalid(Item: any): any;
6
6
  static GetItemDiscountedPrice(Price: any, Qty: any, Disc: any, DiscInPerc: boolean): any;
7
7
  static GetItemTotalAfterDiscount(Price: any, Qty: any, Disc: any, DiscInPerc: boolean): number;
8
- static GetFinalPODataForSave(ItemsList: any, IsIndependentTax: boolean, Disc: any, Perc: any, DetailedInfo: boolean): any;
8
+ static GetFinalPODataForSave(ItemsList: any, IsIndependentTax: boolean, Disc: any, Perc: any, DetailedInfo: boolean, DecimalsNumber: number): any;
9
9
  static ResetRecordDiscountsIfInvalid(Disc: any, Perc: boolean, finalTotalsData: any, DetailedInfo: boolean): any;
10
- static GetFinalTotalsData(finalTotalsData: any, ItemsList: any, IsIndependentTax: boolean, Disc: any, Perc: boolean, DetailedInfo: boolean): any;
10
+ static GetFinalTotalsData(finalTotalsData: any, ItemsList: any, IsIndependentTax: boolean, Disc: any, Perc: boolean, DetailedInfo: boolean, DecimalsNumber: number): any;
11
11
  static GetSubTotal(ItemsList: any): any;
12
- static GetDetailedTotalsData(finalTotalsData: any, IsIndependentTax: boolean, ItemsList: any, TaxCodes: any): any;
12
+ static GetDetailedTotalsData(finalTotalsData: any, IsIndependentTax: boolean, ItemsList: any, TaxCodes: any, DecimalsNumber: number): any;
13
13
  static GetItemGSTTaxTotal(ItemsList: Array<any>): number[];
14
14
  static GetItemDiscountedTotal(ItemsList: any): any;
15
15
  static GetItemsTotalAfterDiscount(ItemsList: any): any;
16
16
  static GetItemsTaxTotal(ItemsList: any, IsIndependentTax: boolean): any;
17
17
  static GetTotalBasedOnTaxType(ItemsTaxAmount: number, ItemsList: any, IsIndependentTax: boolean, Discount: number, DiscInPerc: boolean): number;
18
- static GetItemsTaxGrouping(ItemsList: any, TaxCodes: any): any[];
19
- static GetTaxGroupingItemsByHSN(Items: any, TaxCodes: any): any[];
18
+ static GetItemsTaxGrouping(ItemsList: any, TaxCodes: any, DecimalsNumber: number): any[];
19
+ static GetTaxGroupingItemsByHSN(Items: any, TaxCodes: any, DecimalsNumber: number): any[];
20
20
  static GetCombinedTaxPercentage(Items: any, TaxCodes: any): any;
21
21
  static CompareItemsByHSN(Items: any, TaxCodes: any): any[];
22
- static GetTaxGroupingInfoByHSN(FinalMatchedItems: any, TaxCodes: any): any[];
22
+ static GetTaxGroupingInfoByHSN(FinalMatchedItems: any, TaxCodes: any, DecimalsNumber: number): any[];
23
23
  static GetGSTValueBasedOnTaxCode(TCode: any, argTaxCodes: any): any[];
24
24
  }
@@ -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
  }