shareneus 1.7.361 → 1.7.362

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.
@@ -50,6 +50,7 @@ export declare class ROTotalsService {
50
50
  static GetInsPartCGSTTaxTotal(PartsList: any, IsTaxable: boolean, isWorkOrder: boolean): any;
51
51
  static GetInsPartIGSTTaxTotal(PartsList: any, IsTaxable: boolean, isWorkOrder: boolean): any;
52
52
  static GetInsPartSGSTTaxTotal(PartsList: any, IsTaxable: boolean, isWorkOrder: boolean): any;
53
+ static GetInsPartCESSTaxTotal(PartsList: any, IsTaxable: boolean, isWorkOrder: boolean): any;
53
54
  static GetLaborLDiscAmount(LaborTotalAfterDisc: any, LDisc: any): any;
54
55
  static GetPartsPDiscAmount(PartsTotalAfterDisc: any, PDisc: any): any;
55
56
  static GetCustPartsTaxGrouping(PartsList: any, TaxCodes: any, isWorkOrder: boolean, DecimalsNumber: number): any[];
@@ -670,6 +670,7 @@ class ROTotalsService {
670
670
  argRecordData.InsPartCGST = this.GetInsPartCGSTTaxTotal(dupRecordData.Parts, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
671
671
  argRecordData.InsPartIGST = this.GetInsPartIGSTTaxTotal(dupRecordData.Parts, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
672
672
  argRecordData.InsPartSGST = this.GetInsPartSGSTTaxTotal(dupRecordData.Parts, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
673
+ argRecordData.InsPartCESS = this.GetInsPartCESSTaxTotal(dupRecordData.Parts, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
673
674
  argRecordData.InsLaborTotalAfterTax = (0, math_operations_1.Add)(argRecordData.InsLaborTotalAfterDisc, argRecordData.InsLaborITax);
674
675
  argRecordData.InsPartsTotalAfterTax = (0, math_operations_1.Add)(argRecordData.InsPartsTotalAfterDisc, argRecordData.InsPartITax);
675
676
  argRecordData.CustLaborDiscTotal = this.GetCustLaborDiscountedTotal(dupRecordData.Ops, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), dupRecordData);
@@ -968,6 +969,7 @@ class ROTotalsService {
968
969
  }
969
970
  });
970
971
  }
972
+ console.log('CESS TotalTaxAmt', TotalTaxAmt);
971
973
  return TotalTaxAmt;
972
974
  }
973
975
  static GetInsLaborCGSTTaxTotal(opCodesList, IsTaxable, isWorkOrder) {
@@ -1102,6 +1104,29 @@ class ROTotalsService {
1102
1104
  }
1103
1105
  return TotalTaxAmt;
1104
1106
  }
1107
+ static GetInsPartCESSTaxTotal(PartsList, IsTaxable, isWorkOrder) {
1108
+ let TotalTaxAmt = 0;
1109
+ if (IsTaxable) {
1110
+ PartsList.forEach((Part) => {
1111
+ if (!tr_utils_1.TrUtils.IsNull(Part.CollId) || Part.PBy === enums_1.PayTypeEnum.Insurance || Part.PBy === enums_1.PayTypeEnum.Shared) {
1112
+ if (isWorkOrder) {
1113
+ TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Part.ACESS);
1114
+ }
1115
+ else {
1116
+ if (Part.Sts !== enums_1.LaborStatusEnum.New && Part.Sts !== enums_1.LaborStatusEnum.WtngForAppr) {
1117
+ TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Part.ACESS);
1118
+ }
1119
+ else {
1120
+ if (Part.PBy === enums_1.PayTypeEnum.Insurance || Part.PBy === enums_1.PayTypeEnum.Shared) {
1121
+ TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Part.ECESS);
1122
+ }
1123
+ }
1124
+ }
1125
+ }
1126
+ });
1127
+ }
1128
+ return TotalTaxAmt;
1129
+ }
1105
1130
  static GetLaborLDiscAmount(LaborTotalAfterDisc, LDisc) {
1106
1131
  let LaborLDiscAmt = 0;
1107
1132
  if (!tr_utils_1.TrUtils.IsZero(LaborTotalAfterDisc)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.7.361",
3
+ "version": "1.7.362",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -57,23 +57,23 @@ export class ROTotalsService {
57
57
  Operation.Disc = TrUtils.SetValueToZeroIfNull(Operation.Disc);
58
58
  Operation.Pr = TrUtils.SetValueToZeroIfNull(Operation.Pr);
59
59
  Operation.AssPr = TrUtils.SetValueToZeroIfNull(Operation.AssPr);
60
- Operation.ACGST = this.GetTaxAmountFromGroup(Operation, 'ATaxes', 'CGST', 'ACGST');
61
- Operation.ASGST = this.GetTaxAmountFromGroup(Operation, 'ATaxes', 'SGST', 'ASGST');
62
- Operation.AIGST = this.GetTaxAmountFromGroup(Operation, 'ATaxes', 'IGST', 'AIGST');
63
- Operation.ACESS = this.GetTaxAmountFromGroup(Operation, 'ATaxes', 'CESS', 'ACESS');
64
- Operation.CCGST = this.GetTaxAmountFromGroup(Operation, 'CTaxes', 'CGST', 'CCGST');
65
- Operation.CSGST = this.GetTaxAmountFromGroup(Operation, 'CTaxes', 'SGST', 'CSGST');
66
- Operation.CIGST = this.GetTaxAmountFromGroup(Operation, 'CTaxes', 'IGST', 'CIGST');
67
- Operation.CCESS = this.GetTaxAmountFromGroup(Operation, 'CTaxes', 'CESS', 'CCESS');
60
+ Operation.ACGST = this.GetTaxAmountFromGroup(Operation, 'ATaxes', 'CGST', 'ACGST');
61
+ Operation.ASGST = this.GetTaxAmountFromGroup(Operation, 'ATaxes', 'SGST', 'ASGST');
62
+ Operation.AIGST = this.GetTaxAmountFromGroup(Operation, 'ATaxes', 'IGST', 'AIGST');
63
+ Operation.ACESS = this.GetTaxAmountFromGroup(Operation, 'ATaxes', 'CESS', 'ACESS');
64
+ Operation.CCGST = this.GetTaxAmountFromGroup(Operation, 'CTaxes', 'CGST', 'CCGST');
65
+ Operation.CSGST = this.GetTaxAmountFromGroup(Operation, 'CTaxes', 'SGST', 'CSGST');
66
+ Operation.CIGST = this.GetTaxAmountFromGroup(Operation, 'CTaxes', 'IGST', 'CIGST');
67
+ Operation.CCESS = this.GetTaxAmountFromGroup(Operation, 'CTaxes', 'CESS', 'CCESS');
68
68
  Operation.NetAmt = TrUtils.SetValueToZeroIfNull(Operation.NetAmt);
69
69
  Operation.RecDisc = TrUtils.SetValueToZeroIfNull(Operation.RecDisc);
70
70
 
71
71
  if (!isWorkOrder) {
72
72
  Operation.EstPr = TrUtils.SetValueToZeroIfNull(Operation.EstPr);
73
- Operation.ECGST = this.GetTaxAmountFromGroup(Operation, 'ETaxes', 'CGST', 'ECGST');
74
- Operation.ESGST = this.GetTaxAmountFromGroup(Operation, 'ETaxes', 'SGST', 'ESGST');
75
- Operation.EIGST = this.GetTaxAmountFromGroup(Operation, 'ETaxes', 'IGST', 'EIGST');
76
- Operation.ECESS = this.GetTaxAmountFromGroup(Operation, 'ETaxes', 'CESS', 'ECESS');
73
+ Operation.ECGST = this.GetTaxAmountFromGroup(Operation, 'ETaxes', 'CGST', 'ECGST');
74
+ Operation.ESGST = this.GetTaxAmountFromGroup(Operation, 'ETaxes', 'SGST', 'ESGST');
75
+ Operation.EIGST = this.GetTaxAmountFromGroup(Operation, 'ETaxes', 'IGST', 'EIGST');
76
+ Operation.ECESS = this.GetTaxAmountFromGroup(Operation, 'ETaxes', 'CESS', 'ECESS');
77
77
  }
78
78
  return Operation;
79
79
  }
@@ -134,26 +134,26 @@ export class ROTotalsService {
134
134
  } else {
135
135
  if (Operation.PBy === PayTypeEnum.Customer) {
136
136
  if (isWorkOrder) {
137
- Operation.CustAfterTax = Add(Operation.CustAfterLaborDisc, Operation.CCGST, Operation.CSGST, Operation.CIGST, Operation.CCESS);
137
+ Operation.CustAfterTax = Add(Operation.CustAfterLaborDisc, Operation.CCGST, Operation.CSGST, Operation.CIGST, Operation.CCESS);
138
138
  } else {
139
139
  if (Operation.Sts !== LaborStatusEnum.New && Operation.Sts !== LaborStatusEnum.WtngForAppr) {
140
- Operation.CustAfterTax = Add(Operation.CustAfterLaborDisc, Operation.CCGST, Operation.CSGST, Operation.CIGST, Operation.CCESS);
140
+ Operation.CustAfterTax = Add(Operation.CustAfterLaborDisc, Operation.CCGST, Operation.CSGST, Operation.CIGST, Operation.CCESS);
141
141
  } else {
142
- Operation.CustAfterTax = Add(Operation.CustAfterLaborDisc, Operation.ECGST, Operation.ESGST, Operation.EIGST, Operation.ECESS);
142
+ Operation.CustAfterTax = Add(Operation.CustAfterLaborDisc, Operation.ECGST, Operation.ESGST, Operation.EIGST, Operation.ECESS);
143
143
  }
144
144
  }
145
145
  Operation.InsAfterTax = 0;
146
146
  } else {
147
147
  if (isWorkOrder) {
148
- Operation.CustAfterTax = Add(Operation.CustAfterLaborDisc, Operation.CCGST, Operation.CSGST, Operation.CIGST, Operation.CCESS);
149
- Operation.InsAfterTax = Add(Operation.InsAfterLaborDisc, Operation.ACGST, Operation.ASGST, Operation.AIGST, Operation.ACESS);
148
+ Operation.CustAfterTax = Add(Operation.CustAfterLaborDisc, Operation.CCGST, Operation.CSGST, Operation.CIGST, Operation.CCESS);
149
+ Operation.InsAfterTax = Add(Operation.InsAfterLaborDisc, Operation.ACGST, Operation.ASGST, Operation.AIGST, Operation.ACESS);
150
150
  } else {
151
151
  if (Operation.Sts !== LaborStatusEnum.New && Operation.Sts !== LaborStatusEnum.WtngForAppr) {
152
- Operation.CustAfterTax = Add(Operation.CustAfterLaborDisc, Operation.CCGST, Operation.CSGST, Operation.CIGST, Operation.CCESS);
153
- Operation.InsAfterTax = Add(Operation.InsAfterLaborDisc, Operation.ACGST, Operation.ASGST, Operation.AIGST, Operation.ACESS);
152
+ Operation.CustAfterTax = Add(Operation.CustAfterLaborDisc, Operation.CCGST, Operation.CSGST, Operation.CIGST, Operation.CCESS);
153
+ Operation.InsAfterTax = Add(Operation.InsAfterLaborDisc, Operation.ACGST, Operation.ASGST, Operation.AIGST, Operation.ACESS);
154
154
  } else {
155
155
  Operation.CustAfterTax = 0;
156
- Operation.InsAfterTax = Add(Operation.InsAfterLaborDisc, Operation.ECGST, Operation.ESGST, Operation.EIGST, Operation.ECESS);
156
+ Operation.InsAfterTax = Add(Operation.InsAfterLaborDisc, Operation.ECGST, Operation.ESGST, Operation.EIGST, Operation.ECESS);
157
157
  }
158
158
  }
159
159
  }
@@ -202,24 +202,24 @@ export class ROTotalsService {
202
202
  Part.Disc = TrUtils.SetValueToZeroIfNull(Part.Disc);
203
203
  Part.UnPr = TrUtils.SetValueToZeroIfNull(Part.UnPr);
204
204
  Part.AssPr = TrUtils.SetValueToZeroIfNull(Part.AssPr);
205
- Part.ACGST = this.GetTaxAmountFromGroup(Part, 'ATaxes', 'CGST', 'ACGST');
206
- Part.ASGST = this.GetTaxAmountFromGroup(Part, 'ATaxes', 'SGST', 'ASGST');
207
- Part.AIGST = this.GetTaxAmountFromGroup(Part, 'ATaxes', 'IGST', 'AIGST');
208
- Part.ACESS = this.GetTaxAmountFromGroup(Part, 'ATaxes', 'CESS', 'ACESS');
209
- Part.CCGST = this.GetTaxAmountFromGroup(Part, 'CTaxes', 'CGST', 'CCGST');
210
- Part.CSGST = this.GetTaxAmountFromGroup(Part, 'CTaxes', 'SGST', 'CSGST');
211
- Part.CIGST = this.GetTaxAmountFromGroup(Part, 'CTaxes', 'IGST', 'CIGST');
212
- Part.CCESS = this.GetTaxAmountFromGroup(Part, 'CTaxes', 'CESS', 'CCESS');
205
+ Part.ACGST = this.GetTaxAmountFromGroup(Part, 'ATaxes', 'CGST', 'ACGST');
206
+ Part.ASGST = this.GetTaxAmountFromGroup(Part, 'ATaxes', 'SGST', 'ASGST');
207
+ Part.AIGST = this.GetTaxAmountFromGroup(Part, 'ATaxes', 'IGST', 'AIGST');
208
+ Part.ACESS = this.GetTaxAmountFromGroup(Part, 'ATaxes', 'CESS', 'ACESS');
209
+ Part.CCGST = this.GetTaxAmountFromGroup(Part, 'CTaxes', 'CGST', 'CCGST');
210
+ Part.CSGST = this.GetTaxAmountFromGroup(Part, 'CTaxes', 'SGST', 'CSGST');
211
+ Part.CIGST = this.GetTaxAmountFromGroup(Part, 'CTaxes', 'IGST', 'CIGST');
212
+ Part.CCESS = this.GetTaxAmountFromGroup(Part, 'CTaxes', 'CESS', 'CCESS');
213
213
  Part.UnAmt = TrUtils.SetValueToZeroIfNull(Part.UnAmt);
214
214
  Part.AssAmt = TrUtils.SetValueToZeroIfNull(Part.AssAmt);
215
215
  Part.NetAmt = TrUtils.SetValueToZeroIfNull(Part.NetAmt);
216
216
  Part.RecDisc = TrUtils.SetValueToZeroIfNull(Part.RecDisc);
217
217
  if (!isWorkOrder) {
218
218
  Part.EstPr = TrUtils.SetValueToZeroIfNull(Part.EstPr);
219
- Part.ECGST = this.GetTaxAmountFromGroup(Part, 'ETaxes', 'CGST', 'ECGST');
220
- Part.ESGST = this.GetTaxAmountFromGroup(Part, 'ETaxes', 'SGST', 'ESGST');
221
- Part.EIGST = this.GetTaxAmountFromGroup(Part, 'ETaxes', 'IGST', 'EIGST');
222
- Part.ECESS = this.GetTaxAmountFromGroup(Part, 'ETaxes', 'CESS', 'ECESS');
219
+ Part.ECGST = this.GetTaxAmountFromGroup(Part, 'ETaxes', 'CGST', 'ECGST');
220
+ Part.ESGST = this.GetTaxAmountFromGroup(Part, 'ETaxes', 'SGST', 'ESGST');
221
+ Part.EIGST = this.GetTaxAmountFromGroup(Part, 'ETaxes', 'IGST', 'EIGST');
222
+ Part.ECESS = this.GetTaxAmountFromGroup(Part, 'ETaxes', 'CESS', 'ECESS');
223
223
  Part.EstAmt = TrUtils.SetValueToZeroIfNull(Part.EstAmt);
224
224
  }
225
225
  return Part;
@@ -329,18 +329,18 @@ export class ROTotalsService {
329
329
  } else {
330
330
  if (TrUtils.IsNull(Part.CollId)) {
331
331
  if (isWorkOrder) {
332
- Part.CustAfterTax = Add(Part.CustAfterPartDisc, Part.CCGST, Part.CSGST, Part.CIGST, Part.CCESS);
332
+ Part.CustAfterTax = Add(Part.CustAfterPartDisc, Part.CCGST, Part.CSGST, Part.CIGST, Part.CCESS);
333
333
  if (TrUtils.IsNull(Part.OpId)) {
334
- Part.InsAfterTax = Add(Part.InsAfterPartDisc, Part.ACGST, Part.ASGST, Part.AIGST, Part.ACESS);
334
+ Part.InsAfterTax = Add(Part.InsAfterPartDisc, Part.ACGST, Part.ASGST, Part.AIGST, Part.ACESS);
335
335
  }
336
336
  } else {
337
337
  let LaborSts: string = this.GetPartParentStatus(Part, LaborList);
338
338
  if (LaborSts === LaborStatusEnum.New || LaborSts === LaborStatusEnum.WtngForAppr) {
339
- Part.CustAfterTax = Add(Part.CustAfterPartDisc, Part.ECGST, Part.ESGST, Part.EIGST, Part.ECESS);
339
+ Part.CustAfterTax = Add(Part.CustAfterPartDisc, Part.ECGST, Part.ESGST, Part.EIGST, Part.ECESS);
340
340
  } else {
341
- Part.CustAfterTax = Add(Part.CustAfterPartDisc, Part.CCGST, Part.CSGST, Part.CIGST, Part.CCESS);
341
+ Part.CustAfterTax = Add(Part.CustAfterPartDisc, Part.CCGST, Part.CSGST, Part.CIGST, Part.CCESS);
342
342
  if (TrUtils.IsNull(Part.OpId)) {
343
- Part.InsAfterTax = Add(Part.InsAfterPartDisc, Part.ACGST, Part.ASGST, Part.AIGST, Part.ACESS);
343
+ Part.InsAfterTax = Add(Part.InsAfterPartDisc, Part.ACGST, Part.ASGST, Part.AIGST, Part.ACESS);
344
344
  }
345
345
  }
346
346
  }
@@ -349,26 +349,26 @@ export class ROTotalsService {
349
349
  } else {
350
350
  if (Part.PBy === PayTypeEnum.Customer) {
351
351
  if (isWorkOrder) {
352
- Part.CustAfterTax = Add(Part.CustAfterPartDisc, Part.CCGST, Part.CSGST, Part.CIGST, Part.CCESS);
352
+ Part.CustAfterTax = Add(Part.CustAfterPartDisc, Part.CCGST, Part.CSGST, Part.CIGST, Part.CCESS);
353
353
  } else {
354
354
  if (Part.Sts !== LaborStatusEnum.New && Part.Sts !== LaborStatusEnum.WtngForAppr) {
355
- Part.CustAfterTax = Add(Part.CustAfterPartDisc, Part.CCGST, Part.CSGST, Part.CIGST, Part.CCESS);
355
+ Part.CustAfterTax = Add(Part.CustAfterPartDisc, Part.CCGST, Part.CSGST, Part.CIGST, Part.CCESS);
356
356
  } else {
357
- Part.CustAfterTax = Add(Part.CustAfterPartDisc, Part.ECGST, Part.ESGST, Part.EIGST, Part.ECESS);
357
+ Part.CustAfterTax = Add(Part.CustAfterPartDisc, Part.ECGST, Part.ESGST, Part.EIGST, Part.ECESS);
358
358
  }
359
359
  }
360
360
  Part.InsAfterTax = 0;
361
361
  } else {
362
362
  if (isWorkOrder) {
363
- Part.CustAfterTax = Add(Part.CustAfterPartDisc, Part.CCGST, Part.CSGST, Part.CIGST, Part.CCESS);
364
- Part.InsAfterTax = Add(Part.InsAfterPartDisc, Part.ACGST, Part.ASGST, Part.AIGST, Part.ACESS);
363
+ Part.CustAfterTax = Add(Part.CustAfterPartDisc, Part.CCGST, Part.CSGST, Part.CIGST, Part.CCESS);
364
+ Part.InsAfterTax = Add(Part.InsAfterPartDisc, Part.ACGST, Part.ASGST, Part.AIGST, Part.ACESS);
365
365
  } else {
366
366
  if (Part.Sts !== LaborStatusEnum.New && Part.Sts !== LaborStatusEnum.WtngForAppr) {
367
- Part.CustAfterTax = Add(Part.CustAfterPartDisc, Part.CCGST, Part.CSGST, Part.CIGST, Part.CCESS);
368
- Part.InsAfterTax = Add(Part.InsAfterPartDisc, Part.ACGST, Part.ASGST, Part.AIGST, Part.ACESS);
367
+ Part.CustAfterTax = Add(Part.CustAfterPartDisc, Part.CCGST, Part.CSGST, Part.CIGST, Part.CCESS);
368
+ Part.InsAfterTax = Add(Part.InsAfterPartDisc, Part.ACGST, Part.ASGST, Part.AIGST, Part.ACESS);
369
369
  } else {
370
370
  Part.CustAfterTax = 0;
371
- Part.InsAfterTax = Add(Part.InsAfterPartDisc, Part.ECGST, Part.ESGST, Part.EIGST, Part.ECESS);
371
+ Part.InsAfterTax = Add(Part.InsAfterPartDisc, Part.ECGST, Part.ESGST, Part.EIGST, Part.ECESS);
372
372
  }
373
373
  }
374
374
  }
@@ -490,17 +490,17 @@ export class ROTotalsService {
490
490
  if (isWorkOrder) {
491
491
  // if (Labor.PBy === PayTypeEnum.Customer) {
492
492
  if ((Labor.PBy === PayTypeEnum.Customer || Labor.PBy === PayTypeEnum.Shared)) {
493
- TotalTaxAmt = Add(TotalTaxAmt, Labor.CCGST, Labor.CSGST, Labor.CIGST, Labor.CCESS);
493
+ TotalTaxAmt = Add(TotalTaxAmt, Labor.CCGST, Labor.CSGST, Labor.CIGST, Labor.CCESS);
494
494
  }
495
495
  // }else{
496
496
  // TotalTaxAmt = Add(TotalTaxAmt , Labor.ACGST , Labor.ASGST , Labor.AIGST);
497
497
  // }
498
498
  } else {
499
499
  if (Labor.Sts !== LaborStatusEnum.New && Labor.Sts !== LaborStatusEnum.WtngForAppr) {
500
- TotalTaxAmt = Add(TotalTaxAmt, Labor.CCGST, Labor.CSGST, Labor.CIGST, Labor.CCESS);
500
+ TotalTaxAmt = Add(TotalTaxAmt, Labor.CCGST, Labor.CSGST, Labor.CIGST, Labor.CCESS);
501
501
  } else {
502
502
  if (Labor.PBy === PayTypeEnum.Customer) {
503
- TotalTaxAmt = Add(TotalTaxAmt, Labor.ECGST, Labor.ESGST, Labor.EIGST, Labor.ECESS);
503
+ TotalTaxAmt = Add(TotalTaxAmt, Labor.ECGST, Labor.ESGST, Labor.EIGST, Labor.ECESS);
504
504
  }
505
505
  }
506
506
  }
@@ -516,14 +516,14 @@ export class ROTotalsService {
516
516
  if (!TrUtils.IsNull(Part.CollId)) {
517
517
  if (isWorkOrder) {
518
518
  if ((Part.PBy === PayTypeEnum.Customer || Part.PBy === PayTypeEnum.Shared)) {
519
- TotalTaxAmt = Add(TotalTaxAmt, Part.CCGST, Part.CSGST, Part.CIGST, Part.CCESS);
519
+ TotalTaxAmt = Add(TotalTaxAmt, Part.CCGST, Part.CSGST, Part.CIGST, Part.CCESS);
520
520
  }
521
521
  } else {
522
522
  if (Part.Sts !== LaborStatusEnum.New && Part.Sts !== LaborStatusEnum.WtngForAppr) {
523
- TotalTaxAmt = Add(TotalTaxAmt, Part.CCGST, Part.CSGST, Part.CIGST, Part.CCESS);
523
+ TotalTaxAmt = Add(TotalTaxAmt, Part.CCGST, Part.CSGST, Part.CIGST, Part.CCESS);
524
524
  } else {
525
525
  if (Part.PBy === PayTypeEnum.Customer) {
526
- TotalTaxAmt = Add(TotalTaxAmt, Part.ECGST, Part.ESGST, Part.EIGST, Part.ECESS);
526
+ TotalTaxAmt = Add(TotalTaxAmt, Part.ECGST, Part.ESGST, Part.EIGST, Part.ECESS);
527
527
  }
528
528
  }
529
529
  }
@@ -531,7 +531,7 @@ export class ROTotalsService {
531
531
  if (isWorkOrder) {
532
532
  // if (Part.PBy === PayTypeEnum.Customer) {
533
533
  if ((Part.PBy === PayTypeEnum.Customer || Part.PBy === PayTypeEnum.Shared)) {
534
- TotalTaxAmt = Add(TotalTaxAmt, Part.CCGST, Part.CSGST, Part.CIGST, Part.CCESS);
534
+ TotalTaxAmt = Add(TotalTaxAmt, Part.CCGST, Part.CSGST, Part.CIGST, Part.CCESS);
535
535
  }
536
536
  // }else{
537
537
  // TotalTaxAmt = Add(TotalTaxAmt , Part.ACGST , Part.ASGST , Part.AIGST);
@@ -542,12 +542,12 @@ export class ROTotalsService {
542
542
  });
543
543
  if (Index !== -1) {
544
544
  if (OpsList[Index].Sts !== LaborStatusEnum.New && OpsList[Index].Sts !== LaborStatusEnum.WtngForAppr) {
545
- TotalTaxAmt = Add(TotalTaxAmt, Part.CCGST, Part.CSGST, Part.CIGST, Part.CCESS);
545
+ TotalTaxAmt = Add(TotalTaxAmt, Part.CCGST, Part.CSGST, Part.CIGST, Part.CCESS);
546
546
  } else {
547
- TotalTaxAmt = Add(TotalTaxAmt, Part.ECGST, Part.ESGST, Part.EIGST, Part.ECESS);
547
+ TotalTaxAmt = Add(TotalTaxAmt, Part.ECGST, Part.ESGST, Part.EIGST, Part.ECESS);
548
548
  }
549
549
  } else {
550
- TotalTaxAmt = Add(TotalTaxAmt, Part.CCGST, Part.CSGST, Part.CIGST, Part.CCESS);
550
+ TotalTaxAmt = Add(TotalTaxAmt, Part.CCGST, Part.CSGST, Part.CIGST, Part.CCESS);
551
551
  }
552
552
  }
553
553
  }
@@ -619,14 +619,14 @@ export class ROTotalsService {
619
619
  opCodesList.forEach((Labor: any) => {
620
620
  if (isWorkOrder) {
621
621
  if ((Labor.PBy === PayTypeEnum.Insurance || Labor.PBy === PayTypeEnum.Shared)) {
622
- TotalTaxAmt = Add(TotalTaxAmt, Labor.ACGST, Labor.ASGST, Labor.AIGST, Labor.ACESS);
622
+ TotalTaxAmt = Add(TotalTaxAmt, Labor.ACGST, Labor.ASGST, Labor.AIGST, Labor.ACESS);
623
623
  }
624
624
  } else {
625
625
  if (Labor.Sts !== LaborStatusEnum.New && Labor.Sts !== LaborStatusEnum.WtngForAppr) {
626
- TotalTaxAmt = Add(TotalTaxAmt, Labor.ACGST, Labor.ASGST, Labor.AIGST, Labor.ACESS);
626
+ TotalTaxAmt = Add(TotalTaxAmt, Labor.ACGST, Labor.ASGST, Labor.AIGST, Labor.ACESS);
627
627
  } else {
628
628
  if (Labor.PBy === PayTypeEnum.Insurance || Labor.PBy === PayTypeEnum.Shared) {
629
- TotalTaxAmt = Add(TotalTaxAmt, Labor.ECGST, Labor.ESGST, Labor.EIGST, Labor.ECESS);
629
+ TotalTaxAmt = Add(TotalTaxAmt, Labor.ECGST, Labor.ESGST, Labor.EIGST, Labor.ECESS);
630
630
  }
631
631
  }
632
632
  }
@@ -642,14 +642,14 @@ export class ROTotalsService {
642
642
  if (!TrUtils.IsNull(Part.CollId) || Part.PBy === PayTypeEnum.Insurance || Part.PBy === PayTypeEnum.Shared) {
643
643
  if (isWorkOrder) {
644
644
  if ((Part.PBy === PayTypeEnum.Insurance || Part.PBy === PayTypeEnum.Shared)) {
645
- TotalTaxAmt = Add(TotalTaxAmt, Part.ACGST, Part.ASGST, Part.AIGST, Part.ACESS);
645
+ TotalTaxAmt = Add(TotalTaxAmt, Part.ACGST, Part.ASGST, Part.AIGST, Part.ACESS);
646
646
  }
647
647
  } else {
648
648
  if (Part.Sts !== LaborStatusEnum.New && Part.Sts !== LaborStatusEnum.WtngForAppr) {
649
- TotalTaxAmt = Add(TotalTaxAmt, Part.ACGST, Part.ASGST, Part.AIGST, Part.ACESS);
649
+ TotalTaxAmt = Add(TotalTaxAmt, Part.ACGST, Part.ASGST, Part.AIGST, Part.ACESS);
650
650
  } else {
651
651
  if (Part.PBy === PayTypeEnum.Insurance || Part.PBy === PayTypeEnum.Shared) {
652
- TotalTaxAmt = Add(TotalTaxAmt, Part.ECGST, Part.ESGST, Part.EIGST, Part.ECESS);
652
+ TotalTaxAmt = Add(TotalTaxAmt, Part.ECGST, Part.ESGST, Part.EIGST, Part.ECESS);
653
653
  }
654
654
  }
655
655
  }
@@ -690,6 +690,7 @@ export class ROTotalsService {
690
690
  argRecordData.InsPartCGST = this.GetInsPartCGSTTaxTotal(dupRecordData.Parts, TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
691
691
  argRecordData.InsPartIGST = this.GetInsPartIGSTTaxTotal(dupRecordData.Parts, TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
692
692
  argRecordData.InsPartSGST = this.GetInsPartSGSTTaxTotal(dupRecordData.Parts, TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
693
+ argRecordData.InsPartCESS = this.GetInsPartCESSTaxTotal(dupRecordData.Parts, TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
693
694
 
694
695
  argRecordData.InsLaborTotalAfterTax = Add(argRecordData.InsLaborTotalAfterDisc,
695
696
  argRecordData.InsLaborITax);
@@ -713,10 +714,10 @@ export class ROTotalsService {
713
714
  argRecordData.CustLaborIGST = this.GetCustLaborIGSTTaxTotal(dupRecordData.Ops, TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
714
715
 
715
716
  argRecordData.CustPartITax = this.GetCustPartsTaxTotal(dupRecordData.Ops, dupRecordData.Parts, TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
716
- argRecordData.CustPartCGST = this.GetCustPartCGSTTaxTotal(dupRecordData.Ops, dupRecordData.Parts, TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
717
- argRecordData.CustPartIGST = this.GetCustPartIGSTTaxTotal(dupRecordData.Ops, dupRecordData.Parts, TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
718
- argRecordData.CustPartSGST = this.GetCustPartSGSTTaxTotal(dupRecordData.Ops, dupRecordData.Parts, TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
719
- argRecordData.CustPartCESS = this.GetCustPartCESSTaxTotal(dupRecordData.Ops, dupRecordData.Parts, TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
717
+ argRecordData.CustPartCGST = this.GetCustPartCGSTTaxTotal(dupRecordData.Ops, dupRecordData.Parts, TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
718
+ argRecordData.CustPartIGST = this.GetCustPartIGSTTaxTotal(dupRecordData.Ops, dupRecordData.Parts, TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
719
+ argRecordData.CustPartSGST = this.GetCustPartSGSTTaxTotal(dupRecordData.Ops, dupRecordData.Parts, TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
720
+ argRecordData.CustPartCESS = this.GetCustPartCESSTaxTotal(dupRecordData.Ops, dupRecordData.Parts, TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
720
721
 
721
722
 
722
723
  argRecordData.CustLaborLDiscAmount = this.GetLaborLDiscAmount(argRecordData.CustLaborTotalAfterDisc, argRecordData.LDisc);
@@ -911,11 +912,11 @@ export class ROTotalsService {
911
912
  return TotalTaxAmt;
912
913
  }
913
914
 
914
- static GetCustPartSGSTTaxTotal(OpsList: any, PartsList: any, IsTaxable: boolean, isWorkOrder: boolean) {
915
- let TotalTaxAmt: any = 0;
916
- if (IsTaxable) {
917
- PartsList.forEach((Part: any) => {
918
- if (!TrUtils.IsNull(Part.CollId)) {
915
+ static GetCustPartSGSTTaxTotal(OpsList: any, PartsList: any, IsTaxable: boolean, isWorkOrder: boolean) {
916
+ let TotalTaxAmt: any = 0;
917
+ if (IsTaxable) {
918
+ PartsList.forEach((Part: any) => {
919
+ if (!TrUtils.IsNull(Part.CollId)) {
919
920
  if (isWorkOrder) {
920
921
  TotalTaxAmt = Add(TotalTaxAmt, Part.CSGST);
921
922
  } else {
@@ -946,48 +947,49 @@ export class ROTotalsService {
946
947
  }
947
948
  }
948
949
  });
949
- }
950
- return TotalTaxAmt;
951
- }
952
-
953
- static GetCustPartCESSTaxTotal(OpsList: any, PartsList: any, IsTaxable: boolean, isWorkOrder: boolean) {
954
- let TotalTaxAmt: any = 0;
955
- if (IsTaxable) {
956
- PartsList.forEach((Part: any) => {
957
- if (!TrUtils.IsNull(Part.CollId)) {
958
- if (isWorkOrder) {
959
- TotalTaxAmt = Add(TotalTaxAmt, Part.CCESS);
960
- } else {
961
- if (Part.Sts !== LaborStatusEnum.New && Part.Sts !== LaborStatusEnum.WtngForAppr) {
962
- TotalTaxAmt = Add(TotalTaxAmt, Part.CCESS);
963
- } else {
964
- if (Part.PBy === PayTypeEnum.Customer) {
965
- TotalTaxAmt = Add(TotalTaxAmt, Part.ECESS);
966
- }
967
- }
968
- }
969
- } else {
970
- if (isWorkOrder) {
971
- TotalTaxAmt = Add(TotalTaxAmt, Part.CCESS);
972
- } else {
973
- let Index: any = OpsList.findIndex((labor: any) => {
974
- return labor._id === Part.OpId;
975
- });
976
- if (Index !== -1) {
977
- if (OpsList[Index].Sts !== LaborStatusEnum.New && OpsList[Index].Sts !== LaborStatusEnum.WtngForAppr) {
978
- TotalTaxAmt = Add(TotalTaxAmt, Part.CCESS);
979
- } else {
980
- TotalTaxAmt = Add(TotalTaxAmt, Part.ECESS);
981
- }
982
- } else {
983
- TotalTaxAmt = Add(TotalTaxAmt, Part.CCESS);
984
- }
985
- }
986
- }
987
- });
988
- }
989
- return TotalTaxAmt;
990
- }
950
+ }
951
+ return TotalTaxAmt;
952
+ }
953
+
954
+ static GetCustPartCESSTaxTotal(OpsList: any, PartsList: any, IsTaxable: boolean, isWorkOrder: boolean) {
955
+ let TotalTaxAmt: any = 0;
956
+ if (IsTaxable) {
957
+ PartsList.forEach((Part: any) => {
958
+ if (!TrUtils.IsNull(Part.CollId)) {
959
+ if (isWorkOrder) {
960
+ TotalTaxAmt = Add(TotalTaxAmt, Part.CCESS);
961
+ } else {
962
+ if (Part.Sts !== LaborStatusEnum.New && Part.Sts !== LaborStatusEnum.WtngForAppr) {
963
+ TotalTaxAmt = Add(TotalTaxAmt, Part.CCESS);
964
+ } else {
965
+ if (Part.PBy === PayTypeEnum.Customer) {
966
+ TotalTaxAmt = Add(TotalTaxAmt, Part.ECESS);
967
+ }
968
+ }
969
+ }
970
+ } else {
971
+ if (isWorkOrder) {
972
+ TotalTaxAmt = Add(TotalTaxAmt, Part.CCESS);
973
+ } else {
974
+ let Index: any = OpsList.findIndex((labor: any) => {
975
+ return labor._id === Part.OpId;
976
+ });
977
+ if (Index !== -1) {
978
+ if (OpsList[Index].Sts !== LaborStatusEnum.New && OpsList[Index].Sts !== LaborStatusEnum.WtngForAppr) {
979
+ TotalTaxAmt = Add(TotalTaxAmt, Part.CCESS);
980
+ } else {
981
+ TotalTaxAmt = Add(TotalTaxAmt, Part.ECESS);
982
+ }
983
+ } else {
984
+ TotalTaxAmt = Add(TotalTaxAmt, Part.CCESS);
985
+ }
986
+ }
987
+ }
988
+ });
989
+ }
990
+ console.log('CESS TotalTaxAmt', TotalTaxAmt);
991
+ return TotalTaxAmt;
992
+ }
991
993
 
992
994
  static GetInsLaborCGSTTaxTotal(opCodesList: any, IsTaxable: boolean, isWorkOrder: boolean) {
993
995
  let TotalTaxAmt: any = 0;
@@ -1115,6 +1117,28 @@ export class ROTotalsService {
1115
1117
  return TotalTaxAmt;
1116
1118
  }
1117
1119
 
1120
+ static GetInsPartCESSTaxTotal(PartsList: any, IsTaxable: boolean, isWorkOrder: boolean) {
1121
+ let TotalTaxAmt: any = 0;
1122
+ if (IsTaxable) {
1123
+ PartsList.forEach((Part: any) => {
1124
+ if (!TrUtils.IsNull(Part.CollId) || Part.PBy === PayTypeEnum.Insurance || Part.PBy === PayTypeEnum.Shared) {
1125
+ if (isWorkOrder) {
1126
+ TotalTaxAmt = Add(TotalTaxAmt, Part.ACESS);
1127
+ } else {
1128
+ if (Part.Sts !== LaborStatusEnum.New && Part.Sts !== LaborStatusEnum.WtngForAppr) {
1129
+ TotalTaxAmt = Add(TotalTaxAmt, Part.ACESS);
1130
+ } else {
1131
+ if (Part.PBy === PayTypeEnum.Insurance || Part.PBy === PayTypeEnum.Shared) {
1132
+ TotalTaxAmt = Add(TotalTaxAmt, Part.ECESS);
1133
+ }
1134
+ }
1135
+ }
1136
+ }
1137
+ });
1138
+ }
1139
+ return TotalTaxAmt;
1140
+ }
1141
+
1118
1142
  static GetLaborLDiscAmount(LaborTotalAfterDisc: any, LDisc: any) {
1119
1143
  let LaborLDiscAmt: any = 0;
1120
1144
 
@@ -1161,49 +1185,49 @@ export class ROTotalsService {
1161
1185
  let TaxInfo: any = {};
1162
1186
  let TaxOnAmount: any = 0;
1163
1187
  let TaxAmount: any = 0;
1164
- let CGSTAmt: any = 0;
1165
- let SGSTAmt: any = 0;
1166
- let IGSTAmt: any = 0;
1167
- let CESSAmt: any = 0;
1188
+ let CGSTAmt: any = 0;
1189
+ let SGSTAmt: any = 0;
1190
+ let IGSTAmt: any = 0;
1191
+ let CESSAmt: any = 0;
1168
1192
  let HSN: any = MatchedPart[0].HSN;
1169
1193
  TaxInfo.CombinedTaxPercentage = MatchedPart[0].CombinedTaxPercentage;
1170
1194
  MatchedPart.forEach((argMatchedGSTPart: any) => {
1171
1195
  TaxOnAmount = Add(TaxOnAmount, TrUtils.FixedTo(argMatchedGSTPart.CustAfterPartDisc, DecimalsNumber));
1172
1196
  if (isWorkOrder) {
1173
- CGSTAmt = Add(CGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.CCGST, DecimalsNumber));
1174
- IGSTAmt = Add(IGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.CIGST, DecimalsNumber));
1175
- SGSTAmt = Add(SGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.CSGST, DecimalsNumber));
1176
- CESSAmt = Add(CESSAmt, TrUtils.FixedTo(argMatchedGSTPart.CCESS, DecimalsNumber));
1177
- } else {
1178
- if (argMatchedGSTPart.Sts !== LaborStatusEnum.New && argMatchedGSTPart.Sts !== LaborStatusEnum.WtngForAppr) {
1179
- CGSTAmt = Add(CGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.CCGST, DecimalsNumber));
1180
- IGSTAmt = Add(IGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.CIGST, DecimalsNumber));
1181
- SGSTAmt = Add(SGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.CSGST, DecimalsNumber));
1182
- CESSAmt = Add(CESSAmt, TrUtils.FixedTo(argMatchedGSTPart.CCESS, DecimalsNumber));
1183
- } else {
1184
- if (argMatchedGSTPart.PBy === PayTypeEnum.Customer) {
1185
- CGSTAmt = Add(CGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.ECGST, DecimalsNumber));
1186
- IGSTAmt = Add(IGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.EIGST, DecimalsNumber));
1187
- SGSTAmt = Add(SGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.ESGST, DecimalsNumber));
1188
- CESSAmt = Add(CESSAmt, TrUtils.FixedTo(argMatchedGSTPart.ECESS, DecimalsNumber));
1189
- }
1190
- }
1191
- }
1192
- });
1193
- TaxAmount = Add(CGSTAmt, SGSTAmt, IGSTAmt, CESSAmt);
1194
- TaxInfo.HSN = HSN;
1195
- TaxInfo.TotalTaxableAmount = TrUtils.FixPriceValue(TaxOnAmount, DecimalsNumber);
1196
- TaxInfo.CGSTAmt = TrUtils.FixPriceValue(CGSTAmt, DecimalsNumber);
1197
- TaxInfo.SGSTAmt = TrUtils.FixPriceValue(SGSTAmt, DecimalsNumber);
1198
- TaxInfo.IGSTAmt = TrUtils.FixPriceValue(IGSTAmt, DecimalsNumber);
1199
- TaxInfo.CESSAmt = TrUtils.FixPriceValue(CESSAmt, DecimalsNumber);
1200
- TaxInfo.TotalTaxAmount = TrUtils.FixPriceValue(TaxAmount, DecimalsNumber);
1201
- TaxInfo.PartsCount = MatchedPart.length;
1202
- let GSTValues: any[] = this.GetGSTValueBasedOnTaxCode(MatchedPart[0], TaxCodes);
1203
- TaxInfo.CGST = GSTValues[0];
1204
- TaxInfo.SGST = GSTValues[1];
1205
- TaxInfo.IGST = GSTValues[2];
1206
- TaxInfo.CESS = GSTValues[3];
1197
+ CGSTAmt = Add(CGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.CCGST, DecimalsNumber));
1198
+ IGSTAmt = Add(IGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.CIGST, DecimalsNumber));
1199
+ SGSTAmt = Add(SGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.CSGST, DecimalsNumber));
1200
+ CESSAmt = Add(CESSAmt, TrUtils.FixedTo(argMatchedGSTPart.CCESS, DecimalsNumber));
1201
+ } else {
1202
+ if (argMatchedGSTPart.Sts !== LaborStatusEnum.New && argMatchedGSTPart.Sts !== LaborStatusEnum.WtngForAppr) {
1203
+ CGSTAmt = Add(CGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.CCGST, DecimalsNumber));
1204
+ IGSTAmt = Add(IGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.CIGST, DecimalsNumber));
1205
+ SGSTAmt = Add(SGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.CSGST, DecimalsNumber));
1206
+ CESSAmt = Add(CESSAmt, TrUtils.FixedTo(argMatchedGSTPart.CCESS, DecimalsNumber));
1207
+ } else {
1208
+ if (argMatchedGSTPart.PBy === PayTypeEnum.Customer) {
1209
+ CGSTAmt = Add(CGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.ECGST, DecimalsNumber));
1210
+ IGSTAmt = Add(IGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.EIGST, DecimalsNumber));
1211
+ SGSTAmt = Add(SGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.ESGST, DecimalsNumber));
1212
+ CESSAmt = Add(CESSAmt, TrUtils.FixedTo(argMatchedGSTPart.ECESS, DecimalsNumber));
1213
+ }
1214
+ }
1215
+ }
1216
+ });
1217
+ TaxAmount = Add(CGSTAmt, SGSTAmt, IGSTAmt, CESSAmt);
1218
+ TaxInfo.HSN = HSN;
1219
+ TaxInfo.TotalTaxableAmount = TrUtils.FixPriceValue(TaxOnAmount, DecimalsNumber);
1220
+ TaxInfo.CGSTAmt = TrUtils.FixPriceValue(CGSTAmt, DecimalsNumber);
1221
+ TaxInfo.SGSTAmt = TrUtils.FixPriceValue(SGSTAmt, DecimalsNumber);
1222
+ TaxInfo.IGSTAmt = TrUtils.FixPriceValue(IGSTAmt, DecimalsNumber);
1223
+ TaxInfo.CESSAmt = TrUtils.FixPriceValue(CESSAmt, DecimalsNumber);
1224
+ TaxInfo.TotalTaxAmount = TrUtils.FixPriceValue(TaxAmount, DecimalsNumber);
1225
+ TaxInfo.PartsCount = MatchedPart.length;
1226
+ let GSTValues: any[] = this.GetGSTValueBasedOnTaxCode(MatchedPart[0], TaxCodes);
1227
+ TaxInfo.CGST = GSTValues[0];
1228
+ TaxInfo.SGST = GSTValues[1];
1229
+ TaxInfo.IGST = GSTValues[2];
1230
+ TaxInfo.CESS = GSTValues[3];
1207
1231
  if (TaxOnAmount !== 0) {
1208
1232
  HSNTaxInfo.push(TaxInfo);
1209
1233
  }
@@ -1238,42 +1262,42 @@ export class ROTotalsService {
1238
1262
  let TaxInfo: any = {};
1239
1263
  let TaxOnAmount: any = 0;
1240
1264
  let TaxAmount: any = 0;
1241
- let CGSTAmt: any = 0;
1242
- let SGSTAmt: any = 0;
1243
- let IGSTAmt: any = 0;
1244
- let CESSAmt: any = 0;
1265
+ let CGSTAmt: any = 0;
1266
+ let SGSTAmt: any = 0;
1267
+ let IGSTAmt: any = 0;
1268
+ let CESSAmt: any = 0;
1245
1269
  let HSN: any = MatchedPart[0].HSN;
1246
1270
  TaxInfo.CombinedTaxPercentage = MatchedPart[0].CombinedTaxPercentage;
1247
1271
  MatchedPart.forEach((argMatchedGSTPart: any) => {
1248
1272
  TaxOnAmount = Add(TaxOnAmount, TrUtils.FixedTo(argMatchedGSTPart.InsAfterPartDisc, DecimalsNumber));
1249
1273
  if (argMatchedGSTPart.PBy === PayTypeEnum.Insurance || argMatchedGSTPart.PBy === PayTypeEnum.Shared) {
1250
1274
  if (argMatchedGSTPart.Sts !== LaborStatusEnum.New && argMatchedGSTPart.Sts !== LaborStatusEnum.WtngForAppr) {
1251
- CGSTAmt = Add(CGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.ACGST, DecimalsNumber));
1252
- IGSTAmt = Add(IGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.AIGST, DecimalsNumber));
1253
- SGSTAmt = Add(SGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.ASGST, DecimalsNumber));
1254
- CESSAmt = Add(CESSAmt, TrUtils.FixedTo(argMatchedGSTPart.ACESS, DecimalsNumber));
1255
- } else {
1256
- CGSTAmt = Add(CGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.ECGST, DecimalsNumber));
1257
- IGSTAmt = Add(IGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.EIGST, DecimalsNumber));
1258
- SGSTAmt = Add(SGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.ESGST, DecimalsNumber));
1259
- CESSAmt = Add(CESSAmt, TrUtils.FixedTo(argMatchedGSTPart.ECESS, DecimalsNumber));
1260
- }
1261
- }
1262
- });
1263
- TaxAmount = Add(CGSTAmt, SGSTAmt, IGSTAmt, CESSAmt);
1264
- TaxInfo.HSN = HSN;
1265
- TaxInfo.TotalTaxableAmount = TrUtils.FixPriceValue(TaxOnAmount, DecimalsNumber);
1266
- TaxInfo.CGSTAmt = TrUtils.FixPriceValue(CGSTAmt, DecimalsNumber);
1267
- TaxInfo.SGSTAmt = TrUtils.FixPriceValue(SGSTAmt, DecimalsNumber);
1268
- TaxInfo.IGSTAmt = TrUtils.FixPriceValue(IGSTAmt, DecimalsNumber);
1269
- TaxInfo.CESSAmt = TrUtils.FixPriceValue(CESSAmt, DecimalsNumber);
1270
- TaxInfo.TotalTaxAmount = TrUtils.FixPriceValue(TaxAmount, DecimalsNumber);
1271
- TaxInfo.PartsCount = MatchedPart.length;
1272
- let GSTValues: any[] = this.GetGSTValueBasedOnTaxCode(MatchedPart[0], TaxCodes);
1273
- TaxInfo.CGST = GSTValues[0];
1274
- TaxInfo.SGST = GSTValues[1];
1275
- TaxInfo.IGST = GSTValues[2];
1276
- TaxInfo.CESS = GSTValues[3];
1275
+ CGSTAmt = Add(CGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.ACGST, DecimalsNumber));
1276
+ IGSTAmt = Add(IGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.AIGST, DecimalsNumber));
1277
+ SGSTAmt = Add(SGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.ASGST, DecimalsNumber));
1278
+ CESSAmt = Add(CESSAmt, TrUtils.FixedTo(argMatchedGSTPart.ACESS, DecimalsNumber));
1279
+ } else {
1280
+ CGSTAmt = Add(CGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.ECGST, DecimalsNumber));
1281
+ IGSTAmt = Add(IGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.EIGST, DecimalsNumber));
1282
+ SGSTAmt = Add(SGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.ESGST, DecimalsNumber));
1283
+ CESSAmt = Add(CESSAmt, TrUtils.FixedTo(argMatchedGSTPart.ECESS, DecimalsNumber));
1284
+ }
1285
+ }
1286
+ });
1287
+ TaxAmount = Add(CGSTAmt, SGSTAmt, IGSTAmt, CESSAmt);
1288
+ TaxInfo.HSN = HSN;
1289
+ TaxInfo.TotalTaxableAmount = TrUtils.FixPriceValue(TaxOnAmount, DecimalsNumber);
1290
+ TaxInfo.CGSTAmt = TrUtils.FixPriceValue(CGSTAmt, DecimalsNumber);
1291
+ TaxInfo.SGSTAmt = TrUtils.FixPriceValue(SGSTAmt, DecimalsNumber);
1292
+ TaxInfo.IGSTAmt = TrUtils.FixPriceValue(IGSTAmt, DecimalsNumber);
1293
+ TaxInfo.CESSAmt = TrUtils.FixPriceValue(CESSAmt, DecimalsNumber);
1294
+ TaxInfo.TotalTaxAmount = TrUtils.FixPriceValue(TaxAmount, DecimalsNumber);
1295
+ TaxInfo.PartsCount = MatchedPart.length;
1296
+ let GSTValues: any[] = this.GetGSTValueBasedOnTaxCode(MatchedPart[0], TaxCodes);
1297
+ TaxInfo.CGST = GSTValues[0];
1298
+ TaxInfo.SGST = GSTValues[1];
1299
+ TaxInfo.IGST = GSTValues[2];
1300
+ TaxInfo.CESS = GSTValues[3];
1277
1301
  if (TaxOnAmount !== 0) {
1278
1302
  HSNTaxInfo.push(TaxInfo);
1279
1303
  }
@@ -1282,11 +1306,11 @@ export class ROTotalsService {
1282
1306
  }
1283
1307
 
1284
1308
  static GetGSTValueBasedOnTaxCode(item: any, TaxCodes: any) {
1285
- let CGST: number = 0;
1286
- let SGST: number = 0;
1287
- let IGST: number = 0;
1288
- let CESS: number = 0;
1289
- const taxGroupKeys: string[] = ['Taxes', 'CTaxes', 'ATaxes', 'ETaxes'];
1309
+ let CGST: number = 0;
1310
+ let SGST: number = 0;
1311
+ let IGST: number = 0;
1312
+ let CESS: number = 0;
1313
+ const taxGroupKeys: string[] = ['Taxes', 'CTaxes', 'ATaxes', 'ETaxes'];
1290
1314
 
1291
1315
  for (const taxGroupKey of taxGroupKeys) {
1292
1316
  const groupedTaxes = item?.[taxGroupKey];
@@ -1300,57 +1324,57 @@ export class ROTotalsService {
1300
1324
  SGST = groupedTaxes
1301
1325
  .filter((tax: any) => tax?.Code === 'SGST')
1302
1326
  .reduce((total: number, tax: any) => Add(total, tax?.Rate), 0);
1303
- IGST = groupedTaxes
1304
- .filter((tax: any) => tax?.Code === 'IGST')
1305
- .reduce((total: number, tax: any) => Add(total, tax?.Rate), 0);
1306
- CESS = groupedTaxes
1307
- .filter((tax: any) => tax?.Code === 'CESS')
1308
- .reduce((total: number, tax: any) => Add(total, tax?.Rate), 0);
1309
-
1310
- if (!TrUtils.IsZero(Add(CGST, SGST, IGST, CESS))) {
1311
- return [CGST, SGST, IGST, CESS];
1312
- }
1313
- }
1314
-
1315
- const TCode = item?.TCode;
1316
- if (TrUtils.IsNull(TCode)) {
1317
- return [CGST, SGST, IGST, CESS];
1318
- }
1327
+ IGST = groupedTaxes
1328
+ .filter((tax: any) => tax?.Code === 'IGST')
1329
+ .reduce((total: number, tax: any) => Add(total, tax?.Rate), 0);
1330
+ CESS = groupedTaxes
1331
+ .filter((tax: any) => tax?.Code === 'CESS')
1332
+ .reduce((total: number, tax: any) => Add(total, tax?.Rate), 0);
1333
+
1334
+ if (!TrUtils.IsZero(Add(CGST, SGST, IGST, CESS))) {
1335
+ return [CGST, SGST, IGST, CESS];
1336
+ }
1337
+ }
1338
+
1339
+ const TCode = item?.TCode;
1340
+ if (TrUtils.IsNull(TCode)) {
1341
+ return [CGST, SGST, IGST, CESS];
1342
+ }
1319
1343
  let TCodeIndex: any = TaxCodes.findIndex((TaxCode: any) => {
1320
1344
  return TaxCode._id === Number(TCode);
1321
1345
  });
1322
- if (TCodeIndex !== -1) {
1323
- const CESS = this.GetTaxComponentRate(TaxCodes[TCodeIndex], 'CESS');
1324
- if (TaxCodes[TCodeIndex].Type === 'Intra') {
1325
- return [TaxCodes[TCodeIndex].CGST, TaxCodes[TCodeIndex].SGST, 0, CESS];
1326
- } else {
1327
- return [0, 0, TaxCodes[TCodeIndex].IGST, CESS];
1328
- }
1329
- } else {
1330
- return [CGST, SGST, IGST, CESS];
1331
- }
1332
- }
1333
-
1334
- static GetTaxComponentRate(taxCode: any, code: string) {
1335
- const components = taxCode?.Components;
1336
- if (Array.isArray(components)) {
1337
- const matchedComponents = components.filter((component: any) => component?.Code === code);
1338
- if (matchedComponents.length !== 0) {
1339
- return matchedComponents.reduce((total: number, component: any) => Add(total, component?.Rate), 0);
1340
- }
1341
- }
1342
- return TrUtils.SetValueToZeroIfNull(taxCode?.[code]);
1343
- }
1346
+ if (TCodeIndex !== -1) {
1347
+ const CESS = this.GetTaxComponentRate(TaxCodes[TCodeIndex], 'CESS');
1348
+ if (TaxCodes[TCodeIndex].Type === 'Intra') {
1349
+ return [TaxCodes[TCodeIndex].CGST, TaxCodes[TCodeIndex].SGST, 0, CESS];
1350
+ } else {
1351
+ return [0, 0, TaxCodes[TCodeIndex].IGST, CESS];
1352
+ }
1353
+ } else {
1354
+ return [CGST, SGST, IGST, CESS];
1355
+ }
1356
+ }
1357
+
1358
+ static GetTaxComponentRate(taxCode: any, code: string) {
1359
+ const components = taxCode?.Components;
1360
+ if (Array.isArray(components)) {
1361
+ const matchedComponents = components.filter((component: any) => component?.Code === code);
1362
+ if (matchedComponents.length !== 0) {
1363
+ return matchedComponents.reduce((total: number, component: any) => Add(total, component?.Rate), 0);
1364
+ }
1365
+ }
1366
+ return TrUtils.SetValueToZeroIfNull(taxCode?.[code]);
1367
+ }
1344
1368
 
1345
1369
  static GetCombinedTaxPercentage(Parts: any, TaxCodes: any) {
1346
1370
  Parts.forEach((Part: any) => {
1347
1371
  let GSTValues: any[] = this.GetGSTValueBasedOnTaxCode(Part, TaxCodes);
1348
- let CGST = GSTValues[0];
1349
- let SGST = GSTValues[1];
1350
- let IGST = GSTValues[2];
1351
- let CESS = GSTValues[3];
1352
-
1353
- Part.CombinedTaxPercentage = Add(CGST, SGST, IGST, CESS);
1372
+ let CGST = GSTValues[0];
1373
+ let SGST = GSTValues[1];
1374
+ let IGST = GSTValues[2];
1375
+ let CESS = GSTValues[3];
1376
+
1377
+ Part.CombinedTaxPercentage = Add(CGST, SGST, IGST, CESS);
1354
1378
  });
1355
1379
  return Parts;
1356
1380
  }
@@ -1379,20 +1403,20 @@ export class ROTotalsService {
1379
1403
  });
1380
1404
 
1381
1405
  let argGSTValues: any[] = this.GetGSTValueBasedOnTaxCode(argPart, TaxCodes);
1382
- let argCGST = argGSTValues[0];
1383
- let argSGST = argGSTValues[1];
1384
- let argIGST = argGSTValues[2];
1385
- let argCESS = argGSTValues[3];
1386
-
1387
- let partGSTValues: any[] = this.GetGSTValueBasedOnTaxCode(Part, TaxCodes);
1388
- let partCGST = partGSTValues[0];
1389
- let partSGST = partGSTValues[1];
1390
- let partIGST = partGSTValues[2];
1391
- let partCESS = partGSTValues[3];
1392
-
1393
- return (argPart.HSN === Part.HSN) && (!PartFound) &&
1394
- (argCGST === partCGST) && (argIGST === partIGST) &&
1395
- (argSGST === partSGST) && (argCESS === partCESS);
1406
+ let argCGST = argGSTValues[0];
1407
+ let argSGST = argGSTValues[1];
1408
+ let argIGST = argGSTValues[2];
1409
+ let argCESS = argGSTValues[3];
1410
+
1411
+ let partGSTValues: any[] = this.GetGSTValueBasedOnTaxCode(Part, TaxCodes);
1412
+ let partCGST = partGSTValues[0];
1413
+ let partSGST = partGSTValues[1];
1414
+ let partIGST = partGSTValues[2];
1415
+ let partCESS = partGSTValues[3];
1416
+
1417
+ return (argPart.HSN === Part.HSN) && (!PartFound) &&
1418
+ (argCGST === partCGST) && (argIGST === partIGST) &&
1419
+ (argSGST === partSGST) && (argCESS === partCESS);
1396
1420
  });
1397
1421
  if (MatchedPartsBasedOnHSN.length !== 0) {
1398
1422
  FinalMatchedParts.push(MatchedPartsBasedOnHSN);