shareneus 1.7.352 → 1.7.354
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.
- package/dist/sales-receive/sales-receive-print.service.js +5 -2
- package/dist/services/est.print-service.d.ts +3 -0
- package/dist/services/est.print-service.js +70 -8
- package/dist/services/ro-print-service.js +10 -0
- package/dist/shared/shared-pdf.service.d.ts +2 -1
- package/dist/shared/shared-pdf.service.js +17 -5
- package/package.json +1 -1
- package/src/sales-receive/sales-receive-print.service.ts +5 -2
- package/src/services/est.print-service.ts +79 -9
- package/src/services/ro-print-service.ts +28 -18
- package/src/shared/shared-pdf.service.ts +20 -5
|
@@ -75,6 +75,7 @@ class SalesReceivePrintService {
|
|
|
75
75
|
const itemCGST = this.GetTaxAmountFromTaxes(Item, 'CGST', Item.CGST);
|
|
76
76
|
const itemSGST = this.GetTaxAmountFromTaxes(Item, 'SGST', Item.SGST);
|
|
77
77
|
const itemIGST = this.GetTaxAmountFromTaxes(Item, 'IGST', Item.IGST);
|
|
78
|
+
const itemCESS = this.GetTaxAmountFromTaxes(Item, 'CESS', Item.CESS);
|
|
78
79
|
Item.TCode = this.GetTCodeFromTaxes(Item);
|
|
79
80
|
Item.AfterPartDisc = (0, math_operations_1.Subtract)(Item.UnAmt, Item.Disc, Item.RecDisc);
|
|
80
81
|
if (Consolidate) {
|
|
@@ -83,7 +84,8 @@ class SalesReceivePrintService {
|
|
|
83
84
|
let CTaxAmtPerItem = (0, math_operations_1.Divide)(itemCGST, Item.Qty);
|
|
84
85
|
let STaxAmtPerItem = (0, math_operations_1.Divide)(itemSGST, Item.Qty);
|
|
85
86
|
let ITaxAmtPerItem = (0, math_operations_1.Divide)(itemIGST, Item.Qty);
|
|
86
|
-
|
|
87
|
+
let CESSAmtPerItem = (0, math_operations_1.Divide)(itemCESS, Item.Qty);
|
|
88
|
+
Item.UnPr = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Add)(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem, CESSAmtPerItem), DecimalsNumber);
|
|
87
89
|
}
|
|
88
90
|
else {
|
|
89
91
|
Item.UnPr = tr_utils_1.TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
|
|
@@ -94,9 +96,10 @@ class SalesReceivePrintService {
|
|
|
94
96
|
Item.CGSTPerc = this.GetTaxRateFromTaxes(Item, 'CGST', shared_print_service_1.PrintSharedService.GetCGSTValueBasedOnTaxCode(Item.TCode, TaxCodes));
|
|
95
97
|
Item.SGSTPerc = this.GetTaxRateFromTaxes(Item, 'SGST', shared_print_service_1.PrintSharedService.GetSGSTValueBasedOnTaxCode(Item.TCode, TaxCodes));
|
|
96
98
|
Item.IGSTPerc = this.GetTaxRateFromTaxes(Item, 'IGST', shared_print_service_1.PrintSharedService.GetIGSTValueBasedOnTaxCode(Item.TCode, TaxCodes));
|
|
99
|
+
Item.CESSPerc = this.GetTaxRateFromTaxes(Item, 'CESS', null);
|
|
97
100
|
// Calculate amount after tax based on tax type
|
|
98
101
|
if (IsTaxable) {
|
|
99
|
-
Item.AfterPartTax = (0, math_operations_1.Add)(Item.AfterPartDisc, itemCGST, itemSGST, itemIGST);
|
|
102
|
+
Item.AfterPartTax = (0, math_operations_1.Add)(Item.AfterPartDisc, itemCGST, itemSGST, itemIGST, itemCESS);
|
|
100
103
|
}
|
|
101
104
|
else {
|
|
102
105
|
Item.AfterPartTax = Item.AfterPartDisc;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export declare class EstPrintService {
|
|
2
2
|
static GetTaxAmountFromGroup(item: any, taxGroupKey: string, taxCode: string, fallbackKey: string): any;
|
|
3
|
+
static GetTCode(item: any): any;
|
|
4
|
+
static GetTaxRateFromGroup(item: any, taxGroupKey: string, taxCode: string): number;
|
|
5
|
+
static GetTaxRate(item: any, taxCode: string, preferredTaxGroupKey?: string): number;
|
|
3
6
|
static GetEstimatePrintInfo(OriginalROData: any, OriginalCustomerData: any, OriginalVehicleData: any, OriginalEntityData: any, image: any, Payee: any, InsCompanyName: any, AsCustomerOnly: boolean, AsInsuranceOnly: boolean, AsCustomerAndInsurance: boolean, AsInsuranceOrCustomer: boolean, TaxCodes: any, OverallEst: boolean, SuppEstIndex: any, AsEstimated: boolean, isInitial: boolean, isReverse: boolean, Consolidate: boolean): any;
|
|
4
7
|
static GetROBasicDetailsForPrint(ROPrintData: any, argROData: any, Product: any, OverallEst: any, isInitial: boolean): any;
|
|
5
8
|
static GetPrintConditionsBasedOnInput(ROPrintData: any, IncludeGST: boolean, Payee: any, AsCustomerOnly: boolean, AsInsuranceOnly: boolean, AsCustomerAndInsurance: boolean, AsInsuranceOrCustomer: boolean, SType: any, Consolidate: boolean): any;
|
|
@@ -19,6 +19,48 @@ class EstPrintService {
|
|
|
19
19
|
}
|
|
20
20
|
return tr_utils_1.TrUtils.SetValueToZeroIfNull(item === null || item === void 0 ? void 0 : item[fallbackKey]);
|
|
21
21
|
}
|
|
22
|
+
static GetTCode(item) {
|
|
23
|
+
const taxGroupKeys = ['CTaxes', 'ATaxes', 'ETaxes'];
|
|
24
|
+
for (const taxGroupKey of taxGroupKeys) {
|
|
25
|
+
const groupedTaxes = item === null || item === void 0 ? void 0 : item[taxGroupKey];
|
|
26
|
+
if (!Array.isArray(groupedTaxes)) {
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
const matchedTax = groupedTaxes.find((tax) => !tr_utils_1.TrUtils.IsNull(tax === null || tax === void 0 ? void 0 : tax.TaxCodeId));
|
|
30
|
+
if (!tr_utils_1.TrUtils.IsNull(matchedTax === null || matchedTax === void 0 ? void 0 : matchedTax.TaxCodeId)) {
|
|
31
|
+
return matchedTax.TaxCodeId;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return item === null || item === void 0 ? void 0 : item.TCode;
|
|
35
|
+
}
|
|
36
|
+
static GetTaxRateFromGroup(item, taxGroupKey, taxCode) {
|
|
37
|
+
const groupedTaxes = item === null || item === void 0 ? void 0 : item[taxGroupKey];
|
|
38
|
+
if (Array.isArray(groupedTaxes)) {
|
|
39
|
+
const matchedTaxes = groupedTaxes.filter((tax) => (tax === null || tax === void 0 ? void 0 : tax.Code) === taxCode);
|
|
40
|
+
if (matchedTaxes.length !== 0) {
|
|
41
|
+
return tr_utils_1.TrUtils.FixedTo(matchedTaxes.reduce((total, tax) => (0, math_operations_1.Add)(total, tax === null || tax === void 0 ? void 0 : tax.Rate), 0));
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return 0;
|
|
45
|
+
}
|
|
46
|
+
static GetTaxRate(item, taxCode, preferredTaxGroupKey) {
|
|
47
|
+
const taxGroupKeys = [];
|
|
48
|
+
if (typeof preferredTaxGroupKey === 'string' && preferredTaxGroupKey.length !== 0) {
|
|
49
|
+
taxGroupKeys.push(preferredTaxGroupKey);
|
|
50
|
+
}
|
|
51
|
+
['CTaxes', 'ATaxes', 'ETaxes'].forEach((groupKey) => {
|
|
52
|
+
if (taxGroupKeys.indexOf(groupKey) === -1) {
|
|
53
|
+
taxGroupKeys.push(groupKey);
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
for (const taxGroupKey of taxGroupKeys) {
|
|
57
|
+
const rate = this.GetTaxRateFromGroup(item, taxGroupKey, taxCode);
|
|
58
|
+
if (!tr_utils_1.TrUtils.IsZero(rate)) {
|
|
59
|
+
return rate;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return 0;
|
|
63
|
+
}
|
|
22
64
|
static GetEstimatePrintInfo(OriginalROData, OriginalCustomerData, OriginalVehicleData, OriginalEntityData, image, Payee, InsCompanyName, AsCustomerOnly, AsInsuranceOnly, AsCustomerAndInsurance, AsInsuranceOrCustomer, TaxCodes, OverallEst, SuppEstIndex, AsEstimated, isInitial, isReverse, Consolidate) {
|
|
23
65
|
let ROPrintData = {};
|
|
24
66
|
let argROData = tr_utils_1.TrUtils.Stringify(OriginalROData);
|
|
@@ -427,11 +469,13 @@ class EstPrintService {
|
|
|
427
469
|
Labor.CCGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'CGST', 'CCGST'), DecimalsNumber);
|
|
428
470
|
Labor.CSGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'SGST', 'CSGST'), DecimalsNumber);
|
|
429
471
|
Labor.CIGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'IGST', 'CIGST'), DecimalsNumber);
|
|
472
|
+
Labor.CCESS = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'CESS', 'CCESS'), DecimalsNumber);
|
|
430
473
|
Labor.Disc = tr_utils_1.TrUtils.FixPriceValue(Labor.Disc, DecimalsNumber);
|
|
431
474
|
Labor.AssPr = tr_utils_1.TrUtils.FixPriceValue(Labor.AssPr, DecimalsNumber);
|
|
432
475
|
Labor.ACGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ATaxes', 'CGST', 'ACGST'), DecimalsNumber);
|
|
433
476
|
Labor.ASGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ATaxes', 'SGST', 'ASGST'), DecimalsNumber);
|
|
434
477
|
Labor.AIGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ATaxes', 'IGST', 'AIGST'), DecimalsNumber);
|
|
478
|
+
Labor.ACESS = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ATaxes', 'CESS', 'ACESS'), DecimalsNumber);
|
|
435
479
|
if (Consolidate) {
|
|
436
480
|
if (Labor.PBy === enums_1.PayTypeEnum.Customer) {
|
|
437
481
|
Labor.EstPr = tr_utils_1.TrUtils.FixPriceValue(Labor.CustAfterTax, DecimalsNumber);
|
|
@@ -449,6 +493,7 @@ class EstPrintService {
|
|
|
449
493
|
Labor.ECGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ETaxes', 'CGST', 'ECGST'), DecimalsNumber);
|
|
450
494
|
Labor.ESGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ETaxes', 'SGST', 'ESGST'), DecimalsNumber);
|
|
451
495
|
Labor.EIGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ETaxes', 'IGST', 'EIGST'), DecimalsNumber);
|
|
496
|
+
Labor.ECESS = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ETaxes', 'CESS', 'ECESS'), DecimalsNumber);
|
|
452
497
|
if (tr_utils_1.TrUtils.IsNull(Labor.CollId)) {
|
|
453
498
|
let LaborColli = {
|
|
454
499
|
_id: Labor._id,
|
|
@@ -470,12 +515,14 @@ class EstPrintService {
|
|
|
470
515
|
Part.CCGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'CTaxes', 'CGST', 'CCGST'), DecimalsNumber);
|
|
471
516
|
Part.CSGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'CTaxes', 'SGST', 'CSGST'), DecimalsNumber);
|
|
472
517
|
Part.CIGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'CTaxes', 'IGST', 'CIGST'), DecimalsNumber);
|
|
518
|
+
Part.CCESS = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'CTaxes', 'CESS', 'CCESS'), DecimalsNumber);
|
|
473
519
|
Part.Disc = tr_utils_1.TrUtils.FixPriceValue(Part.Disc, DecimalsNumber);
|
|
474
520
|
Part.AssPr = tr_utils_1.TrUtils.FixPriceValue(Part.AssPr, DecimalsNumber);
|
|
475
521
|
Part.AssAmt = tr_utils_1.TrUtils.FixPriceValue(Part.AssAmt, DecimalsNumber);
|
|
476
522
|
Part.ACGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'ATaxes', 'CGST', 'ACGST'), DecimalsNumber);
|
|
477
523
|
Part.ASGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'ATaxes', 'SGST', 'ASGST'), DecimalsNumber);
|
|
478
524
|
Part.AIGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'ATaxes', 'IGST', 'AIGST'), DecimalsNumber);
|
|
525
|
+
Part.ACESS = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'ATaxes', 'CESS', 'ACESS'), DecimalsNumber);
|
|
479
526
|
Part.EstPr = tr_utils_1.TrUtils.FixPriceValue(Part.EstPr, DecimalsNumber);
|
|
480
527
|
if (Consolidate) {
|
|
481
528
|
if (Part.PBy === enums_1.PayTypeEnum.Customer) {
|
|
@@ -495,6 +542,7 @@ class EstPrintService {
|
|
|
495
542
|
Part.ECGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'ETaxes', 'CGST', 'ECGST'), DecimalsNumber);
|
|
496
543
|
Part.ESGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'ETaxes', 'SGST', 'ESGST'), DecimalsNumber);
|
|
497
544
|
Part.EIGST = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'ETaxes', 'IGST', 'EIGST'), DecimalsNumber);
|
|
545
|
+
Part.ECESS = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'ETaxes', 'CESS', 'ECESS'), DecimalsNumber);
|
|
498
546
|
if (tr_utils_1.TrUtils.IsNull(Part.CollId)) {
|
|
499
547
|
let LaborIndex = ROPrintData.Ops.findIndex((Labor) => {
|
|
500
548
|
return Labor._id === Part.OpId;
|
|
@@ -841,11 +889,13 @@ class EstPrintService {
|
|
|
841
889
|
Labor.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ETaxes', 'CGST', 'ECGST'), DecimalsNumber);
|
|
842
890
|
Labor.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ETaxes', 'SGST', 'ESGST'), DecimalsNumber);
|
|
843
891
|
Labor.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ETaxes', 'IGST', 'EIGST'), DecimalsNumber);
|
|
892
|
+
Labor.CESSAmt = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ETaxes', 'CESS', 'ECESS'), DecimalsNumber);
|
|
844
893
|
}
|
|
845
894
|
else {
|
|
846
895
|
Labor.CGSTAmt = 0;
|
|
847
896
|
Labor.SGSTAmt = 0;
|
|
848
897
|
Labor.IGSTAmt = 0;
|
|
898
|
+
Labor.CESSAmt = 0;
|
|
849
899
|
}
|
|
850
900
|
}
|
|
851
901
|
else {
|
|
@@ -853,16 +903,21 @@ class EstPrintService {
|
|
|
853
903
|
Labor.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'CGST', 'CCGST'), DecimalsNumber);
|
|
854
904
|
Labor.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'SGST', 'CSGST'), DecimalsNumber);
|
|
855
905
|
Labor.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'IGST', 'CIGST'), DecimalsNumber);
|
|
906
|
+
Labor.CESSAmt = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'CESS', 'CCESS'), DecimalsNumber);
|
|
856
907
|
}
|
|
857
908
|
else {
|
|
858
909
|
Labor.CGSTAmt = 0;
|
|
859
910
|
Labor.SGSTAmt = 0;
|
|
860
911
|
Labor.IGSTAmt = 0;
|
|
912
|
+
Labor.CESSAmt = 0;
|
|
861
913
|
}
|
|
862
914
|
}
|
|
863
|
-
Labor.
|
|
864
|
-
Labor.
|
|
865
|
-
Labor.
|
|
915
|
+
const taxGroupKey = (Labor.Sts === enums_1.LaborStatusEnum.New || Labor.Sts === enums_1.LaborStatusEnum.WtngForAppr) ? 'ETaxes' : 'CTaxes';
|
|
916
|
+
Labor.TCode = this.GetTCode(Labor);
|
|
917
|
+
Labor.CGSTPerc = this.GetTaxRate(Labor, 'CGST', taxGroupKey);
|
|
918
|
+
Labor.SGSTPerc = this.GetTaxRate(Labor, 'SGST', taxGroupKey);
|
|
919
|
+
Labor.IGSTPerc = this.GetTaxRate(Labor, 'IGST', taxGroupKey);
|
|
920
|
+
Labor.CESSPerc = this.GetTaxRate(Labor, 'CESS', taxGroupKey);
|
|
866
921
|
});
|
|
867
922
|
return LaborList;
|
|
868
923
|
}
|
|
@@ -874,11 +929,13 @@ class EstPrintService {
|
|
|
874
929
|
Item.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Item, 'ETaxes', 'CGST', 'ECGST'), DecimalsNumber);
|
|
875
930
|
Item.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Item, 'ETaxes', 'SGST', 'ESGST'), DecimalsNumber);
|
|
876
931
|
Item.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Item, 'ETaxes', 'IGST', 'EIGST'), DecimalsNumber);
|
|
932
|
+
Item.CESSAmt = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Item, 'ETaxes', 'CESS', 'ECESS'), DecimalsNumber);
|
|
877
933
|
}
|
|
878
934
|
else {
|
|
879
935
|
Item.CGSTAmt = 0;
|
|
880
936
|
Item.SGSTAmt = 0;
|
|
881
937
|
Item.IGSTAmt = 0;
|
|
938
|
+
Item.CESSAmt = 0;
|
|
882
939
|
}
|
|
883
940
|
}
|
|
884
941
|
else {
|
|
@@ -886,16 +943,21 @@ class EstPrintService {
|
|
|
886
943
|
Item.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Item, 'CTaxes', 'CGST', 'CCGST'), DecimalsNumber);
|
|
887
944
|
Item.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Item, 'CTaxes', 'SGST', 'CSGST'), DecimalsNumber);
|
|
888
945
|
Item.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Item, 'CTaxes', 'IGST', 'CIGST'), DecimalsNumber);
|
|
946
|
+
Item.CESSAmt = tr_utils_1.TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Item, 'CTaxes', 'CESS', 'CCESS'), DecimalsNumber);
|
|
889
947
|
}
|
|
890
948
|
else {
|
|
891
949
|
Item.CGSTAmt = 0;
|
|
892
950
|
Item.SGSTAmt = 0;
|
|
893
951
|
Item.IGSTAmt = 0;
|
|
952
|
+
Item.CESSAmt = 0;
|
|
894
953
|
}
|
|
895
954
|
}
|
|
896
|
-
|
|
897
|
-
Item.
|
|
898
|
-
Item.
|
|
955
|
+
const taxGroupKey = (LaborStatus === enums_1.LaborStatusEnum.New || LaborStatus === enums_1.LaborStatusEnum.WtngForAppr) ? 'ETaxes' : 'CTaxes';
|
|
956
|
+
Item.TCode = this.GetTCode(Item);
|
|
957
|
+
Item.CGSTPerc = this.GetTaxRate(Item, 'CGST', taxGroupKey);
|
|
958
|
+
Item.SGSTPerc = this.GetTaxRate(Item, 'SGST', taxGroupKey);
|
|
959
|
+
Item.IGSTPerc = this.GetTaxRate(Item, 'IGST', taxGroupKey);
|
|
960
|
+
Item.CESSPerc = this.GetTaxRate(Item, 'CESS', taxGroupKey);
|
|
899
961
|
});
|
|
900
962
|
return Items;
|
|
901
963
|
}
|
|
@@ -959,7 +1021,7 @@ class EstPrintService {
|
|
|
959
1021
|
}
|
|
960
1022
|
static CheckLaborTaxItemIndex(LaborList) {
|
|
961
1023
|
let TaxIndex = LaborList.findIndex((Labor) => {
|
|
962
|
-
if (!tr_utils_1.TrUtils.
|
|
1024
|
+
if (!tr_utils_1.TrUtils.IsNull(this.GetTCode(Labor))) {
|
|
963
1025
|
return Labor;
|
|
964
1026
|
}
|
|
965
1027
|
});
|
|
@@ -967,7 +1029,7 @@ class EstPrintService {
|
|
|
967
1029
|
}
|
|
968
1030
|
static CheckPartTaxItemIndex(PartsList) {
|
|
969
1031
|
let TaxIndex = PartsList.findIndex((Part) => {
|
|
970
|
-
if (!tr_utils_1.TrUtils.
|
|
1032
|
+
if (!tr_utils_1.TrUtils.IsNull(this.GetTCode(Part))) {
|
|
971
1033
|
return Part;
|
|
972
1034
|
}
|
|
973
1035
|
});
|
|
@@ -647,12 +647,14 @@ class ROPrintService {
|
|
|
647
647
|
Labor.CGSTAmt = tr_utils_1.TrUtils.FixedTo(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'CGST', 'CCGST'), DecimalsNumber);
|
|
648
648
|
Labor.SGSTAmt = tr_utils_1.TrUtils.FixedTo(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'SGST', 'CSGST'), DecimalsNumber);
|
|
649
649
|
Labor.IGSTAmt = tr_utils_1.TrUtils.FixedTo(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'IGST', 'CIGST'), DecimalsNumber);
|
|
650
|
+
Labor.CESSAmt = tr_utils_1.TrUtils.FixedTo(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'CESS', 'CCESS'), DecimalsNumber);
|
|
650
651
|
}
|
|
651
652
|
else {
|
|
652
653
|
Labor.UnPr = tr_utils_1.TrUtils.FixedTo(Labor.Pr, DecimalsNumber);
|
|
653
654
|
Labor.CGSTAmt = 0;
|
|
654
655
|
Labor.SGSTAmt = 0;
|
|
655
656
|
Labor.IGSTAmt = 0;
|
|
657
|
+
Labor.CESSAmt = 0;
|
|
656
658
|
}
|
|
657
659
|
}
|
|
658
660
|
else if (AsInsuranceOnly) {
|
|
@@ -667,6 +669,7 @@ class ROPrintService {
|
|
|
667
669
|
Labor.CGSTAmt = tr_utils_1.TrUtils.FixedTo(this.GetTaxAmountFromGroup(Labor, 'ATaxes', 'CGST', 'ACGST'), DecimalsNumber);
|
|
668
670
|
Labor.SGSTAmt = tr_utils_1.TrUtils.FixedTo(this.GetTaxAmountFromGroup(Labor, 'ATaxes', 'SGST', 'ASGST'), DecimalsNumber);
|
|
669
671
|
Labor.IGSTAmt = tr_utils_1.TrUtils.FixedTo(this.GetTaxAmountFromGroup(Labor, 'ATaxes', 'IGST', 'AIGST'), DecimalsNumber);
|
|
672
|
+
Labor.CESSAmt = tr_utils_1.TrUtils.FixedTo(this.GetTaxAmountFromGroup(Labor, 'ATaxes', 'CESS', 'ACESS'), DecimalsNumber);
|
|
670
673
|
Labor.AssPr = tr_utils_1.TrUtils.FixedTo(Labor.AssPr, DecimalsNumber);
|
|
671
674
|
}
|
|
672
675
|
else {
|
|
@@ -675,12 +678,14 @@ class ROPrintService {
|
|
|
675
678
|
Labor.CGSTAmt = 0;
|
|
676
679
|
Labor.SGSTAmt = 0;
|
|
677
680
|
Labor.IGSTAmt = 0;
|
|
681
|
+
Labor.CESSAmt = 0;
|
|
678
682
|
}
|
|
679
683
|
}
|
|
680
684
|
Labor.TCode = this.GetTCode(Labor);
|
|
681
685
|
Labor.CGSTPerc = this.GetTaxRate(Labor, 'CGST', taxGroupKey);
|
|
682
686
|
Labor.SGSTPerc = this.GetTaxRate(Labor, 'SGST', taxGroupKey);
|
|
683
687
|
Labor.IGSTPerc = this.GetTaxRate(Labor, 'IGST', taxGroupKey);
|
|
688
|
+
Labor.CESSPerc = this.GetTaxRate(Labor, 'CESS', taxGroupKey);
|
|
684
689
|
});
|
|
685
690
|
return LaborList;
|
|
686
691
|
}
|
|
@@ -698,12 +703,14 @@ class ROPrintService {
|
|
|
698
703
|
Item.CGSTAmt = tr_utils_1.TrUtils.FixedTo(this.GetTaxAmountFromGroup(Item, 'CTaxes', 'CGST', 'CCGST'), DecimalsNumber);
|
|
699
704
|
Item.SGSTAmt = tr_utils_1.TrUtils.FixedTo(this.GetTaxAmountFromGroup(Item, 'CTaxes', 'SGST', 'CSGST'), DecimalsNumber);
|
|
700
705
|
Item.IGSTAmt = tr_utils_1.TrUtils.FixedTo(this.GetTaxAmountFromGroup(Item, 'CTaxes', 'IGST', 'CIGST'), DecimalsNumber);
|
|
706
|
+
Item.CESSAmt = tr_utils_1.TrUtils.FixedTo(this.GetTaxAmountFromGroup(Item, 'CTaxes', 'CESS', 'CCESS'), DecimalsNumber);
|
|
701
707
|
}
|
|
702
708
|
else {
|
|
703
709
|
Item.UnPr = tr_utils_1.TrUtils.FixedTo(Item.UnPr, DecimalsNumber);
|
|
704
710
|
Item.CGSTAmt = 0;
|
|
705
711
|
Item.SGSTAmt = 0;
|
|
706
712
|
Item.IGSTAmt = 0;
|
|
713
|
+
Item.CESSAmt = 0;
|
|
707
714
|
}
|
|
708
715
|
}
|
|
709
716
|
else if (AsInsuranceOnly) {
|
|
@@ -718,6 +725,7 @@ class ROPrintService {
|
|
|
718
725
|
Item.CGSTAmt = tr_utils_1.TrUtils.FixedTo(this.GetTaxAmountFromGroup(Item, 'ATaxes', 'CGST', 'ACGST'), DecimalsNumber);
|
|
719
726
|
Item.SGSTAmt = tr_utils_1.TrUtils.FixedTo(this.GetTaxAmountFromGroup(Item, 'ATaxes', 'SGST', 'ASGST'), DecimalsNumber);
|
|
720
727
|
Item.IGSTAmt = tr_utils_1.TrUtils.FixedTo(this.GetTaxAmountFromGroup(Item, 'ATaxes', 'IGST', 'AIGST'), DecimalsNumber);
|
|
728
|
+
Item.CESSAmt = tr_utils_1.TrUtils.FixedTo(this.GetTaxAmountFromGroup(Item, 'ATaxes', 'CESS', 'ACESS'), DecimalsNumber);
|
|
721
729
|
Item.AssPr = tr_utils_1.TrUtils.FixedTo(Item.AssPr, DecimalsNumber);
|
|
722
730
|
}
|
|
723
731
|
else {
|
|
@@ -726,6 +734,7 @@ class ROPrintService {
|
|
|
726
734
|
Item.CGSTAmt = 0;
|
|
727
735
|
Item.SGSTAmt = 0;
|
|
728
736
|
Item.IGSTAmt = 0;
|
|
737
|
+
Item.CESSAmt = 0;
|
|
729
738
|
}
|
|
730
739
|
}
|
|
731
740
|
if (!tr_utils_1.TrUtils.IsZero(Item.Qty) && !tr_utils_1.TrUtils.CheckInvalidSelect(Item.UoM)) {
|
|
@@ -735,6 +744,7 @@ class ROPrintService {
|
|
|
735
744
|
Item.CGSTPerc = this.GetTaxRate(Item, 'CGST', taxGroupKey);
|
|
736
745
|
Item.SGSTPerc = this.GetTaxRate(Item, 'SGST', taxGroupKey);
|
|
737
746
|
Item.IGSTPerc = this.GetTaxRate(Item, 'IGST', taxGroupKey);
|
|
747
|
+
Item.CESSPerc = this.GetTaxRate(Item, 'CESS', taxGroupKey);
|
|
738
748
|
});
|
|
739
749
|
return Items;
|
|
740
750
|
}
|
|
@@ -536,7 +536,7 @@ export declare class SharedPDFService {
|
|
|
536
536
|
lineHeight: number;
|
|
537
537
|
Field: string;
|
|
538
538
|
}[];
|
|
539
|
-
static CreateHeadingAllTaxList(ShowIGST: any): {
|
|
539
|
+
static CreateHeadingAllTaxList(ShowIGST: any, hasCESS: boolean): {
|
|
540
540
|
text: string;
|
|
541
541
|
style: string;
|
|
542
542
|
fontSize: number;
|
|
@@ -544,6 +544,7 @@ export declare class SharedPDFService {
|
|
|
544
544
|
Field: string;
|
|
545
545
|
alignment: string;
|
|
546
546
|
}[];
|
|
547
|
+
static hasCESS(items: any[]): boolean;
|
|
547
548
|
static CreateHSNTaxTable1(PartsTaxInfo: any, ShowAccParts: any, ShowIGST: any, ShowTaxColumn: any): any;
|
|
548
549
|
static CreateHSNTaxTable(PartsTaxInfo: any, ShowAccParts: any, ShowIGST: any, ShowTaxColumn: any): any;
|
|
549
550
|
static GetFinalTotalDetails1(RecordData: any, BasicLaborTotal: any, OverAllMainLaborDiscount: any, LCGST: any, LSGST: any, LIGST: any, PIGST: any, ShowIGST: any, ShowTaxColumn: any, BasicPartsTotal: any, OverAllMainPartsDiscount: any, PCGST: any, PSGST: any, PartsTaxInfo: any, ShowAccParts: any, LaborAfterGST: any, PartsAfterGST: any, OverAllRecordDiscount: any, For: any, OverAllRecordTotal: any, Rounded: any, GrandTotal: any, ShowDetailedLaborTaxInfo: any, ShowDetailedPartTaxInfo: any, istaxable: boolean, LaborTotalTax: any, PartTotalTax: any, Consolidate: boolean, From: string, Adj: any, CustLaborTaxGroupDataByPerc: any, STotal: any, isAuto: boolean, moreDiscDetails: boolean): {
|
|
@@ -1692,7 +1692,7 @@ class SharedPDFService {
|
|
|
1692
1692
|
}
|
|
1693
1693
|
return HeaderNames;
|
|
1694
1694
|
}
|
|
1695
|
-
static CreateHeadingAllTaxList(ShowIGST) {
|
|
1695
|
+
static CreateHeadingAllTaxList(ShowIGST, hasCESS) {
|
|
1696
1696
|
let HeaderNames = [
|
|
1697
1697
|
// { text: 'CGST', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'CGST' },
|
|
1698
1698
|
// { text: 'SGST', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'SGST' },
|
|
@@ -1704,27 +1704,39 @@ class SharedPDFService {
|
|
|
1704
1704
|
if (ShowIGST) {
|
|
1705
1705
|
// HeaderNames.splice(1, 0, { text: 'IGST(%)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'IGST' });
|
|
1706
1706
|
HeaderNames.splice(2, 0, { text: 'IGST(Rs.)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'IGSTAmt', alignment: 'right' });
|
|
1707
|
+
if (hasCESS) {
|
|
1708
|
+
HeaderNames.splice(3, 0, { text: 'CESS(Rs.)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'CESSAmt', alignment: 'right' });
|
|
1709
|
+
}
|
|
1707
1710
|
}
|
|
1708
1711
|
else {
|
|
1709
1712
|
// HeaderNames.splice(1, 0, { text: 'CGST(%)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'CGST' });
|
|
1710
1713
|
HeaderNames.splice(2, 0, { text: 'CGST(Rs.)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'CGSTAmt', alignment: 'right' });
|
|
1711
1714
|
// HeaderNames.splice(3, 0, { text: 'SGST(%)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'CGST' });
|
|
1712
1715
|
HeaderNames.splice(3, 0, { text: 'SGST(Rs.)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'SGSTAmt', alignment: 'right' });
|
|
1716
|
+
if (hasCESS) {
|
|
1717
|
+
HeaderNames.splice(4, 0, { text: 'CESS(Rs.)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'CESSAmt', alignment: 'right' });
|
|
1718
|
+
}
|
|
1713
1719
|
}
|
|
1714
1720
|
return HeaderNames;
|
|
1715
1721
|
}
|
|
1722
|
+
static hasCESS(items) {
|
|
1723
|
+
if (tr_utils_1.TrUtils.IsNull(items) || (items === null || items === void 0 ? void 0 : items.length) === 0) {
|
|
1724
|
+
return false;
|
|
1725
|
+
}
|
|
1726
|
+
return items.some(item => { var _a; return (_a = item.Taxes) === null || _a === void 0 ? void 0 : _a.some((tax) => { var _a; return ((_a = tax.Code) === null || _a === void 0 ? void 0 : _a.toUpperCase()) === 'CESS'; }); });
|
|
1727
|
+
}
|
|
1716
1728
|
static CreateHSNTaxTable1(PartsTaxInfo, ShowAccParts, ShowIGST, ShowTaxColumn) {
|
|
1717
1729
|
if (!tr_utils_1.TrUtils.IsNull(PartsTaxInfo) && PartsTaxInfo.length !== 0 && ShowAccParts && ShowTaxColumn) {
|
|
1718
1730
|
var body = [];
|
|
1719
|
-
|
|
1731
|
+
const hasCESS = this.hasCESS(PartsTaxInfo);
|
|
1732
|
+
let columns = this.CreateHeadingAllTaxList(ShowIGST, hasCESS);
|
|
1720
1733
|
body.push(columns);
|
|
1721
1734
|
PartsTaxInfo.forEach((part) => {
|
|
1722
1735
|
var dataRow = [];
|
|
1723
1736
|
columns.forEach((column) => {
|
|
1724
1737
|
if (!tr_utils_1.TrUtils.IsFixedZero(part[column.Field]) &&
|
|
1725
|
-
!tr_utils_1.TrUtils.IsNull(part[column.Field]) || column.Field === 'SGST' || column.Field === 'CGST' || column.Field === 'SGSTAmt' || column.Field === 'CGSTAmt'
|
|
1726
|
-
|
|
1727
|
-
if (column.Field === 'TotalTaxableAmount' || column.Field === 'SGSTAmt' || column.Field === 'CGSTAmt' || column.Field === 'IGSTAmt') {
|
|
1738
|
+
!tr_utils_1.TrUtils.IsNull(part[column.Field]) || column.Field === 'SGST' || column.Field === 'CGST' || column.Field === 'SGSTAmt' || column.Field === 'CGSTAmt' || column.Field === 'CESSAmt' || column.Field === 'TotalTaxableAmount') {
|
|
1739
|
+
if (column.Field === 'TotalTaxableAmount' || column.Field === 'SGSTAmt' || column.Field === 'CGSTAmt' || column.Field === 'IGSTAmt' || column.Field === 'CESSAmt') {
|
|
1728
1740
|
dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(part[column.Field]), alignment: 'right', opacity: 0.7, nowrap: true, fontSize: 6 });
|
|
1729
1741
|
}
|
|
1730
1742
|
else if (column.Field === 'CombinedTaxPercentage') {
|
package/package.json
CHANGED
|
@@ -86,6 +86,7 @@ export class SalesReceivePrintService {
|
|
|
86
86
|
const itemCGST = this.GetTaxAmountFromTaxes(Item, 'CGST', Item.CGST);
|
|
87
87
|
const itemSGST = this.GetTaxAmountFromTaxes(Item, 'SGST', Item.SGST);
|
|
88
88
|
const itemIGST = this.GetTaxAmountFromTaxes(Item, 'IGST', Item.IGST);
|
|
89
|
+
const itemCESS = this.GetTaxAmountFromTaxes(Item, 'CESS', Item.CESS);
|
|
89
90
|
Item.TCode = this.GetTCodeFromTaxes(Item);
|
|
90
91
|
Item.AfterPartDisc = Subtract(Item.UnAmt, Item.Disc, Item.RecDisc);
|
|
91
92
|
if (Consolidate) {
|
|
@@ -94,7 +95,8 @@ export class SalesReceivePrintService {
|
|
|
94
95
|
let CTaxAmtPerItem = Divide(itemCGST, Item.Qty);
|
|
95
96
|
let STaxAmtPerItem = Divide(itemSGST, Item.Qty);
|
|
96
97
|
let ITaxAmtPerItem = Divide(itemIGST, Item.Qty);
|
|
97
|
-
|
|
98
|
+
let CESSAmtPerItem = Divide(itemCESS, Item.Qty);
|
|
99
|
+
Item.UnPr = TrUtils.FixedTo(Add(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem, CESSAmtPerItem), DecimalsNumber);
|
|
98
100
|
} else {
|
|
99
101
|
Item.UnPr = TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
|
|
100
102
|
}
|
|
@@ -104,9 +106,10 @@ export class SalesReceivePrintService {
|
|
|
104
106
|
Item.CGSTPerc = this.GetTaxRateFromTaxes(Item, 'CGST', PrintSharedService.GetCGSTValueBasedOnTaxCode(Item.TCode, TaxCodes));
|
|
105
107
|
Item.SGSTPerc = this.GetTaxRateFromTaxes(Item, 'SGST', PrintSharedService.GetSGSTValueBasedOnTaxCode(Item.TCode, TaxCodes));
|
|
106
108
|
Item.IGSTPerc = this.GetTaxRateFromTaxes(Item, 'IGST', PrintSharedService.GetIGSTValueBasedOnTaxCode(Item.TCode, TaxCodes));
|
|
109
|
+
Item.CESSPerc = this.GetTaxRateFromTaxes(Item, 'CESS', null);
|
|
107
110
|
// Calculate amount after tax based on tax type
|
|
108
111
|
if (IsTaxable) {
|
|
109
|
-
Item.AfterPartTax = Add(Item.AfterPartDisc, itemCGST, itemSGST, itemIGST);
|
|
112
|
+
Item.AfterPartTax = Add(Item.AfterPartDisc, itemCGST, itemSGST, itemIGST, itemCESS);
|
|
110
113
|
} else {
|
|
111
114
|
Item.AfterPartTax = Item.AfterPartDisc;
|
|
112
115
|
}
|
|
@@ -22,6 +22,56 @@ export class EstPrintService {
|
|
|
22
22
|
return TrUtils.SetValueToZeroIfNull(item?.[fallbackKey]);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
static GetTCode(item: any) {
|
|
26
|
+
const taxGroupKeys: string[] = ['CTaxes', 'ATaxes', 'ETaxes'];
|
|
27
|
+
|
|
28
|
+
for (const taxGroupKey of taxGroupKeys) {
|
|
29
|
+
const groupedTaxes = item?.[taxGroupKey];
|
|
30
|
+
if (!Array.isArray(groupedTaxes)) {
|
|
31
|
+
continue;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const matchedTax = groupedTaxes.find((tax: any) => !TrUtils.IsNull(tax?.TaxCodeId));
|
|
35
|
+
if (!TrUtils.IsNull(matchedTax?.TaxCodeId)) {
|
|
36
|
+
return matchedTax.TaxCodeId;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return item?.TCode;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
static GetTaxRateFromGroup(item: any, taxGroupKey: string, taxCode: string) {
|
|
44
|
+
const groupedTaxes = item?.[taxGroupKey];
|
|
45
|
+
if (Array.isArray(groupedTaxes)) {
|
|
46
|
+
const matchedTaxes = groupedTaxes.filter((tax: any) => tax?.Code === taxCode);
|
|
47
|
+
if (matchedTaxes.length !== 0) {
|
|
48
|
+
return TrUtils.FixedTo(matchedTaxes.reduce((total: number, tax: any) => Add(total, tax?.Rate), 0));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
static GetTaxRate(item: any, taxCode: string, preferredTaxGroupKey?: string) {
|
|
55
|
+
const taxGroupKeys: string[] = [];
|
|
56
|
+
|
|
57
|
+
if (typeof preferredTaxGroupKey === 'string' && preferredTaxGroupKey.length !== 0) {
|
|
58
|
+
taxGroupKeys.push(preferredTaxGroupKey);
|
|
59
|
+
}
|
|
60
|
+
['CTaxes', 'ATaxes', 'ETaxes'].forEach((groupKey: string) => {
|
|
61
|
+
if (taxGroupKeys.indexOf(groupKey) === -1) {
|
|
62
|
+
taxGroupKeys.push(groupKey);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
for (const taxGroupKey of taxGroupKeys) {
|
|
67
|
+
const rate = this.GetTaxRateFromGroup(item, taxGroupKey, taxCode);
|
|
68
|
+
if (!TrUtils.IsZero(rate)) {
|
|
69
|
+
return rate;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return 0;
|
|
73
|
+
}
|
|
74
|
+
|
|
25
75
|
static GetEstimatePrintInfo(OriginalROData: any, OriginalCustomerData: any, OriginalVehicleData: any, OriginalEntityData: any,
|
|
26
76
|
image: any, Payee: any, InsCompanyName: any, AsCustomerOnly: boolean, AsInsuranceOnly: boolean,
|
|
27
77
|
AsCustomerAndInsurance: boolean, AsInsuranceOrCustomer: boolean, TaxCodes: any, OverallEst: boolean,
|
|
@@ -490,11 +540,13 @@ export class EstPrintService {
|
|
|
490
540
|
Labor.CCGST = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'CGST', 'CCGST'), DecimalsNumber);
|
|
491
541
|
Labor.CSGST = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'SGST', 'CSGST'), DecimalsNumber);
|
|
492
542
|
Labor.CIGST = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'IGST', 'CIGST'), DecimalsNumber);
|
|
543
|
+
Labor.CCESS = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'CESS', 'CCESS'), DecimalsNumber);
|
|
493
544
|
Labor.Disc = TrUtils.FixPriceValue(Labor.Disc, DecimalsNumber);
|
|
494
545
|
Labor.AssPr = TrUtils.FixPriceValue(Labor.AssPr, DecimalsNumber);
|
|
495
546
|
Labor.ACGST = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ATaxes', 'CGST', 'ACGST'), DecimalsNumber);
|
|
496
547
|
Labor.ASGST = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ATaxes', 'SGST', 'ASGST'), DecimalsNumber);
|
|
497
548
|
Labor.AIGST = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ATaxes', 'IGST', 'AIGST'), DecimalsNumber);
|
|
549
|
+
Labor.ACESS = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ATaxes', 'CESS', 'ACESS'), DecimalsNumber);
|
|
498
550
|
if (Consolidate) {
|
|
499
551
|
if (Labor.PBy === PayTypeEnum.Customer) {
|
|
500
552
|
Labor.EstPr = TrUtils.FixPriceValue(Labor.CustAfterTax, DecimalsNumber);
|
|
@@ -510,6 +562,7 @@ export class EstPrintService {
|
|
|
510
562
|
Labor.ECGST = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ETaxes', 'CGST', 'ECGST'), DecimalsNumber);
|
|
511
563
|
Labor.ESGST = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ETaxes', 'SGST', 'ESGST'), DecimalsNumber);
|
|
512
564
|
Labor.EIGST = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ETaxes', 'IGST', 'EIGST'), DecimalsNumber);
|
|
565
|
+
Labor.ECESS = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ETaxes', 'CESS', 'ECESS'), DecimalsNumber);
|
|
513
566
|
if (TrUtils.IsNull(Labor.CollId)) {
|
|
514
567
|
let LaborColli: any = {
|
|
515
568
|
_id: Labor._id,
|
|
@@ -533,12 +586,14 @@ export class EstPrintService {
|
|
|
533
586
|
Part.CCGST = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'CTaxes', 'CGST', 'CCGST'), DecimalsNumber);
|
|
534
587
|
Part.CSGST = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'CTaxes', 'SGST', 'CSGST'), DecimalsNumber);
|
|
535
588
|
Part.CIGST = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'CTaxes', 'IGST', 'CIGST'), DecimalsNumber);
|
|
589
|
+
Part.CCESS = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'CTaxes', 'CESS', 'CCESS'), DecimalsNumber);
|
|
536
590
|
Part.Disc = TrUtils.FixPriceValue(Part.Disc, DecimalsNumber);
|
|
537
591
|
Part.AssPr = TrUtils.FixPriceValue(Part.AssPr, DecimalsNumber);
|
|
538
592
|
Part.AssAmt = TrUtils.FixPriceValue(Part.AssAmt, DecimalsNumber);
|
|
539
593
|
Part.ACGST = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'ATaxes', 'CGST', 'ACGST'), DecimalsNumber);
|
|
540
594
|
Part.ASGST = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'ATaxes', 'SGST', 'ASGST'), DecimalsNumber);
|
|
541
595
|
Part.AIGST = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'ATaxes', 'IGST', 'AIGST'), DecimalsNumber);
|
|
596
|
+
Part.ACESS = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'ATaxes', 'CESS', 'ACESS'), DecimalsNumber);
|
|
542
597
|
Part.EstPr = TrUtils.FixPriceValue(Part.EstPr, DecimalsNumber);
|
|
543
598
|
if (Consolidate) {
|
|
544
599
|
if (Part.PBy === PayTypeEnum.Customer) {
|
|
@@ -556,6 +611,7 @@ export class EstPrintService {
|
|
|
556
611
|
Part.ECGST = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'ETaxes', 'CGST', 'ECGST'), DecimalsNumber);
|
|
557
612
|
Part.ESGST = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'ETaxes', 'SGST', 'ESGST'), DecimalsNumber);
|
|
558
613
|
Part.EIGST = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'ETaxes', 'IGST', 'EIGST'), DecimalsNumber);
|
|
614
|
+
Part.ECESS = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Part, 'ETaxes', 'CESS', 'ECESS'), DecimalsNumber);
|
|
559
615
|
if (TrUtils.IsNull(Part.CollId)) {
|
|
560
616
|
let LaborIndex: any = ROPrintData.Ops.findIndex((Labor: any) => {
|
|
561
617
|
return Labor._id === Part.OpId;
|
|
@@ -924,25 +980,32 @@ export class EstPrintService {
|
|
|
924
980
|
Labor.CGSTAmt = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ETaxes', 'CGST', 'ECGST'), DecimalsNumber);
|
|
925
981
|
Labor.SGSTAmt = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ETaxes', 'SGST', 'ESGST'), DecimalsNumber);
|
|
926
982
|
Labor.IGSTAmt = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ETaxes', 'IGST', 'EIGST'), DecimalsNumber);
|
|
983
|
+
Labor.CESSAmt = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'ETaxes', 'CESS', 'ECESS'), DecimalsNumber);
|
|
927
984
|
} else {
|
|
928
985
|
Labor.CGSTAmt = 0;
|
|
929
986
|
Labor.SGSTAmt = 0;
|
|
930
987
|
Labor.IGSTAmt = 0;
|
|
988
|
+
Labor.CESSAmt = 0;
|
|
931
989
|
}
|
|
932
990
|
} else {
|
|
933
991
|
if (IncludeGST) {
|
|
934
992
|
Labor.CGSTAmt = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'CGST', 'CCGST'), DecimalsNumber);
|
|
935
993
|
Labor.SGSTAmt = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'SGST', 'CSGST'), DecimalsNumber);
|
|
936
994
|
Labor.IGSTAmt = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'IGST', 'CIGST'), DecimalsNumber);
|
|
995
|
+
Labor.CESSAmt = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'CESS', 'CCESS'), DecimalsNumber);
|
|
937
996
|
} else {
|
|
938
997
|
Labor.CGSTAmt = 0;
|
|
939
998
|
Labor.SGSTAmt = 0;
|
|
940
999
|
Labor.IGSTAmt = 0;
|
|
1000
|
+
Labor.CESSAmt = 0;
|
|
941
1001
|
}
|
|
942
1002
|
}
|
|
943
|
-
Labor.
|
|
944
|
-
Labor.
|
|
945
|
-
Labor.
|
|
1003
|
+
const taxGroupKey = (Labor.Sts === LaborStatusEnum.New || Labor.Sts === LaborStatusEnum.WtngForAppr) ? 'ETaxes' : 'CTaxes';
|
|
1004
|
+
Labor.TCode = this.GetTCode(Labor);
|
|
1005
|
+
Labor.CGSTPerc = this.GetTaxRate(Labor, 'CGST', taxGroupKey);
|
|
1006
|
+
Labor.SGSTPerc = this.GetTaxRate(Labor, 'SGST', taxGroupKey);
|
|
1007
|
+
Labor.IGSTPerc = this.GetTaxRate(Labor, 'IGST', taxGroupKey);
|
|
1008
|
+
Labor.CESSPerc = this.GetTaxRate(Labor, 'CESS', taxGroupKey);
|
|
946
1009
|
});
|
|
947
1010
|
return LaborList;
|
|
948
1011
|
}
|
|
@@ -955,25 +1018,32 @@ export class EstPrintService {
|
|
|
955
1018
|
Item.CGSTAmt = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Item, 'ETaxes', 'CGST', 'ECGST'), DecimalsNumber);
|
|
956
1019
|
Item.SGSTAmt = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Item, 'ETaxes', 'SGST', 'ESGST'), DecimalsNumber);
|
|
957
1020
|
Item.IGSTAmt = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Item, 'ETaxes', 'IGST', 'EIGST'), DecimalsNumber);
|
|
1021
|
+
Item.CESSAmt = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Item, 'ETaxes', 'CESS', 'ECESS'), DecimalsNumber);
|
|
958
1022
|
} else {
|
|
959
1023
|
Item.CGSTAmt = 0;
|
|
960
1024
|
Item.SGSTAmt = 0;
|
|
961
1025
|
Item.IGSTAmt = 0;
|
|
1026
|
+
Item.CESSAmt = 0;
|
|
962
1027
|
}
|
|
963
1028
|
} else {
|
|
964
1029
|
if (IncludeGST) {
|
|
965
1030
|
Item.CGSTAmt = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Item, 'CTaxes', 'CGST', 'CCGST'), DecimalsNumber);
|
|
966
1031
|
Item.SGSTAmt = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Item, 'CTaxes', 'SGST', 'CSGST'), DecimalsNumber);
|
|
967
1032
|
Item.IGSTAmt = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Item, 'CTaxes', 'IGST', 'CIGST'), DecimalsNumber);
|
|
1033
|
+
Item.CESSAmt = TrUtils.FixPriceValue(this.GetTaxAmountFromGroup(Item, 'CTaxes', 'CESS', 'CCESS'), DecimalsNumber);
|
|
968
1034
|
} else {
|
|
969
1035
|
Item.CGSTAmt = 0;
|
|
970
1036
|
Item.SGSTAmt = 0;
|
|
971
1037
|
Item.IGSTAmt = 0;
|
|
1038
|
+
Item.CESSAmt = 0;
|
|
972
1039
|
}
|
|
973
1040
|
}
|
|
974
|
-
|
|
975
|
-
Item.
|
|
976
|
-
Item.
|
|
1041
|
+
const taxGroupKey = (LaborStatus === LaborStatusEnum.New || LaborStatus === LaborStatusEnum.WtngForAppr) ? 'ETaxes' : 'CTaxes';
|
|
1042
|
+
Item.TCode = this.GetTCode(Item);
|
|
1043
|
+
Item.CGSTPerc = this.GetTaxRate(Item, 'CGST', taxGroupKey);
|
|
1044
|
+
Item.SGSTPerc = this.GetTaxRate(Item, 'SGST', taxGroupKey);
|
|
1045
|
+
Item.IGSTPerc = this.GetTaxRate(Item, 'IGST', taxGroupKey);
|
|
1046
|
+
Item.CESSPerc = this.GetTaxRate(Item, 'CESS', taxGroupKey);
|
|
977
1047
|
});
|
|
978
1048
|
return Items;
|
|
979
1049
|
}
|
|
@@ -1044,7 +1114,7 @@ export class EstPrintService {
|
|
|
1044
1114
|
|
|
1045
1115
|
static CheckLaborTaxItemIndex(LaborList: any[]) {
|
|
1046
1116
|
let TaxIndex: any = LaborList.findIndex((Labor: any) => {
|
|
1047
|
-
if (!TrUtils.
|
|
1117
|
+
if (!TrUtils.IsNull(this.GetTCode(Labor))) {
|
|
1048
1118
|
return Labor;
|
|
1049
1119
|
}
|
|
1050
1120
|
});
|
|
@@ -1053,7 +1123,7 @@ export class EstPrintService {
|
|
|
1053
1123
|
|
|
1054
1124
|
static CheckPartTaxItemIndex(PartsList: any[]) {
|
|
1055
1125
|
let TaxIndex: any = PartsList.findIndex((Part: any) => {
|
|
1056
|
-
if (!TrUtils.
|
|
1126
|
+
if (!TrUtils.IsNull(this.GetTCode(Part))) {
|
|
1057
1127
|
return Part;
|
|
1058
1128
|
}
|
|
1059
1129
|
});
|
|
@@ -1125,7 +1195,7 @@ export class EstPrintService {
|
|
|
1125
1195
|
});
|
|
1126
1196
|
return SParts;
|
|
1127
1197
|
}
|
|
1128
|
-
|
|
1198
|
+
|
|
1129
1199
|
static SeparateCollisionBySuppIndex(Collisions: any, SuppEstCodeValue: any) {
|
|
1130
1200
|
let FilteredCollisions: any[] = [];
|
|
1131
1201
|
FilteredCollisions = Collisions.filter((Collision: any) => {
|
|
@@ -73,7 +73,7 @@ export class ROPrintService {
|
|
|
73
73
|
static GetRepairOrderPrintInfo(OriginalROData: any, OriginalCustomerData: any, OriginalVehicleData: any,
|
|
74
74
|
OriginalEntityData: any, image: any,
|
|
75
75
|
IncludeGST: boolean, ConsolidateGST: boolean, Payee: any, InsCompanyName: any, AsCustomerOnly: boolean,
|
|
76
|
-
AsInsuranceOnly: boolean, TaxCodes: any, OrderType: any, isReverse:boolean) {
|
|
76
|
+
AsInsuranceOnly: boolean, TaxCodes: any, OrderType: any, isReverse: boolean) {
|
|
77
77
|
|
|
78
78
|
let ROPrintData: any = {};
|
|
79
79
|
|
|
@@ -536,16 +536,16 @@ export class ROPrintService {
|
|
|
536
536
|
ROPrintData.Colli.forEach((Collision: any) => {
|
|
537
537
|
let LineTotal: number = 0;
|
|
538
538
|
if (!TrUtils.IsNull(Collision.PartData)) {
|
|
539
|
-
LineTotal = Add(LineTotal,this.GetCollisionPartLineTotal(Collision.PartData, ConsolidateGST, AsCustomerOnly, AsInsuranceOnly));
|
|
539
|
+
LineTotal = Add(LineTotal, this.GetCollisionPartLineTotal(Collision.PartData, ConsolidateGST, AsCustomerOnly, AsInsuranceOnly));
|
|
540
540
|
}
|
|
541
541
|
if (!TrUtils.IsNull(Collision.RRFData)) {
|
|
542
|
-
LineTotal = Add(LineTotal,this.GetCollisionLaborLineTotal(Collision.RRFData, ConsolidateGST, AsCustomerOnly, AsInsuranceOnly));
|
|
542
|
+
LineTotal = Add(LineTotal, this.GetCollisionLaborLineTotal(Collision.RRFData, ConsolidateGST, AsCustomerOnly, AsInsuranceOnly));
|
|
543
543
|
}
|
|
544
544
|
if (!TrUtils.IsNull(Collision.PtngData)) {
|
|
545
|
-
LineTotal = Add(LineTotal,this.GetCollisionLaborLineTotal(Collision.PtngData, ConsolidateGST, AsCustomerOnly, AsInsuranceOnly));
|
|
545
|
+
LineTotal = Add(LineTotal, this.GetCollisionLaborLineTotal(Collision.PtngData, ConsolidateGST, AsCustomerOnly, AsInsuranceOnly));
|
|
546
546
|
}
|
|
547
547
|
if (!TrUtils.IsNull(Collision.DtngData)) {
|
|
548
|
-
LineTotal = Add(LineTotal,this.GetCollisionLaborLineTotal(Collision.DtngData, ConsolidateGST, AsCustomerOnly, AsInsuranceOnly));
|
|
548
|
+
LineTotal = Add(LineTotal, this.GetCollisionLaborLineTotal(Collision.DtngData, ConsolidateGST, AsCustomerOnly, AsInsuranceOnly));
|
|
549
549
|
}
|
|
550
550
|
Collision.LineTotal = TrUtils.FixPriceValue(LineTotal, DecimalsNumber);
|
|
551
551
|
});
|
|
@@ -569,9 +569,9 @@ export class ROPrintService {
|
|
|
569
569
|
}
|
|
570
570
|
} else {
|
|
571
571
|
if (ConsolidateGST) {
|
|
572
|
-
LineTotal = Add(PartData.InsAfterTaxPerItem
|
|
572
|
+
LineTotal = Add(PartData.InsAfterTaxPerItem, PartData.CustAfterTaxPerItem);
|
|
573
573
|
} else {
|
|
574
|
-
LineTotal = Add(PartData.InsAfterPartDisc
|
|
574
|
+
LineTotal = Add(PartData.InsAfterPartDisc, PartData.CustAfterPartDisc);
|
|
575
575
|
}
|
|
576
576
|
}
|
|
577
577
|
return Number(LineTotal);
|
|
@@ -593,9 +593,9 @@ export class ROPrintService {
|
|
|
593
593
|
}
|
|
594
594
|
} else {
|
|
595
595
|
if (ConsolidateGST) {
|
|
596
|
-
LineTotal = Add(LaborData.CustAfterTax
|
|
596
|
+
LineTotal = Add(LaborData.CustAfterTax, LaborData.InsAfterTax);
|
|
597
597
|
} else {
|
|
598
|
-
LineTotal = Add(LaborData.InsAfterLaborDisc
|
|
598
|
+
LineTotal = Add(LaborData.InsAfterLaborDisc, LaborData.CustAfterLaborDisc);
|
|
599
599
|
}
|
|
600
600
|
}
|
|
601
601
|
return Number(LineTotal);
|
|
@@ -617,9 +617,9 @@ export class ROPrintService {
|
|
|
617
617
|
}
|
|
618
618
|
} else {
|
|
619
619
|
if (IncludeGST) {
|
|
620
|
-
LineTotal = Add(LaborData.CustAfterTax
|
|
620
|
+
LineTotal = Add(LaborData.CustAfterTax, LaborData.InsAfterTax);
|
|
621
621
|
} else {
|
|
622
|
-
LineTotal = Add(LaborData.InsAfterLaborDisc
|
|
622
|
+
LineTotal = Add(LaborData.InsAfterLaborDisc, LaborData.CustAfterLaborDisc);
|
|
623
623
|
}
|
|
624
624
|
}
|
|
625
625
|
return TrUtils.FixPriceValue(LineTotal, DecimalsNumber);
|
|
@@ -641,21 +641,21 @@ export class ROPrintService {
|
|
|
641
641
|
}
|
|
642
642
|
} else {
|
|
643
643
|
if (IncludeGST) {
|
|
644
|
-
LineTotal = Add(PartData.InsAfterTax
|
|
644
|
+
LineTotal = Add(PartData.InsAfterTax, PartData.CustAfterTax);
|
|
645
645
|
} else {
|
|
646
|
-
LineTotal = Add(PartData.InsAfterPartDisc
|
|
646
|
+
LineTotal = Add(PartData.InsAfterPartDisc, PartData.CustAfterPartDisc);
|
|
647
647
|
}
|
|
648
648
|
}
|
|
649
649
|
return TrUtils.FixPriceValue(LineTotal, DecimalsNumber);
|
|
650
650
|
}
|
|
651
651
|
|
|
652
|
-
static ReverseItemsForROPrint(argROData: any, isReverse:boolean) {
|
|
653
|
-
if(isReverse){
|
|
652
|
+
static ReverseItemsForROPrint(argROData: any, isReverse: boolean) {
|
|
653
|
+
if (isReverse) {
|
|
654
654
|
argROData.Comps = TrUtils.IsNull(argROData.Comps) ? [] : argROData.Comps.reverse();
|
|
655
655
|
argROData.Ops = TrUtils.IsNull(argROData.Ops) ? [] : argROData.Ops.reverse();
|
|
656
656
|
argROData.Parts = TrUtils.IsNull(argROData.Parts) ? [] : argROData.Parts.reverse();
|
|
657
657
|
argROData.Colli = TrUtils.IsNull(argROData.Colli) ? [] : argROData.Colli.reverse();
|
|
658
|
-
}else{
|
|
658
|
+
} else {
|
|
659
659
|
argROData.Comps = TrUtils.IsNull(argROData.Comps) ? [] : argROData.Comps;
|
|
660
660
|
argROData.Ops = TrUtils.IsNull(argROData.Ops) ? [] : argROData.Ops;
|
|
661
661
|
argROData.Parts = TrUtils.IsNull(argROData.Parts) ? [] : argROData.Parts;
|
|
@@ -716,7 +716,7 @@ export class ROPrintService {
|
|
|
716
716
|
}
|
|
717
717
|
|
|
718
718
|
static GetLaborPrintInfo(LaborList: any, ConsolidateGST: boolean,
|
|
719
|
-
IncludeGST: boolean, AsCustomerOnly: boolean, AsInsuranceOnly: boolean, _TaxCodes: any[], DecimalsNumber:number) {
|
|
719
|
+
IncludeGST: boolean, AsCustomerOnly: boolean, AsInsuranceOnly: boolean, _TaxCodes: any[], DecimalsNumber: number) {
|
|
720
720
|
LaborList.forEach((Labor: any) => {
|
|
721
721
|
Labor.HSN = Labor.SAC;
|
|
722
722
|
let taxGroupKey = 'CTaxes';
|
|
@@ -730,11 +730,13 @@ export class ROPrintService {
|
|
|
730
730
|
Labor.CGSTAmt = TrUtils.FixedTo(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'CGST', 'CCGST'), DecimalsNumber);
|
|
731
731
|
Labor.SGSTAmt = TrUtils.FixedTo(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'SGST', 'CSGST'), DecimalsNumber);
|
|
732
732
|
Labor.IGSTAmt = TrUtils.FixedTo(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'IGST', 'CIGST'), DecimalsNumber);
|
|
733
|
+
Labor.CESSAmt = TrUtils.FixedTo(this.GetTaxAmountFromGroup(Labor, 'CTaxes', 'CESS', 'CCESS'), DecimalsNumber);
|
|
733
734
|
} else {
|
|
734
735
|
Labor.UnPr = TrUtils.FixedTo(Labor.Pr, DecimalsNumber);
|
|
735
736
|
Labor.CGSTAmt = 0;
|
|
736
737
|
Labor.SGSTAmt = 0;
|
|
737
738
|
Labor.IGSTAmt = 0;
|
|
739
|
+
Labor.CESSAmt = 0;
|
|
738
740
|
}
|
|
739
741
|
} else if (AsInsuranceOnly) {
|
|
740
742
|
taxGroupKey = 'ATaxes';
|
|
@@ -747,6 +749,7 @@ export class ROPrintService {
|
|
|
747
749
|
Labor.CGSTAmt = TrUtils.FixedTo(this.GetTaxAmountFromGroup(Labor, 'ATaxes', 'CGST', 'ACGST'), DecimalsNumber);
|
|
748
750
|
Labor.SGSTAmt = TrUtils.FixedTo(this.GetTaxAmountFromGroup(Labor, 'ATaxes', 'SGST', 'ASGST'), DecimalsNumber);
|
|
749
751
|
Labor.IGSTAmt = TrUtils.FixedTo(this.GetTaxAmountFromGroup(Labor, 'ATaxes', 'IGST', 'AIGST'), DecimalsNumber);
|
|
752
|
+
Labor.CESSAmt = TrUtils.FixedTo(this.GetTaxAmountFromGroup(Labor, 'ATaxes', 'CESS', 'ACESS'), DecimalsNumber);
|
|
750
753
|
Labor.AssPr = TrUtils.FixedTo(Labor.AssPr, DecimalsNumber);
|
|
751
754
|
} else {
|
|
752
755
|
Labor.UnPr = TrUtils.FixedTo(Labor.AssPr, DecimalsNumber);
|
|
@@ -754,12 +757,14 @@ export class ROPrintService {
|
|
|
754
757
|
Labor.CGSTAmt = 0;
|
|
755
758
|
Labor.SGSTAmt = 0;
|
|
756
759
|
Labor.IGSTAmt = 0;
|
|
760
|
+
Labor.CESSAmt = 0;
|
|
757
761
|
}
|
|
758
762
|
}
|
|
759
763
|
Labor.TCode = this.GetTCode(Labor);
|
|
760
764
|
Labor.CGSTPerc = this.GetTaxRate(Labor, 'CGST', taxGroupKey);
|
|
761
765
|
Labor.SGSTPerc = this.GetTaxRate(Labor, 'SGST', taxGroupKey);
|
|
762
766
|
Labor.IGSTPerc = this.GetTaxRate(Labor, 'IGST', taxGroupKey);
|
|
767
|
+
Labor.CESSPerc = this.GetTaxRate(Labor, 'CESS', taxGroupKey);
|
|
763
768
|
});
|
|
764
769
|
return LaborList;
|
|
765
770
|
}
|
|
@@ -778,11 +783,13 @@ export class ROPrintService {
|
|
|
778
783
|
Item.CGSTAmt = TrUtils.FixedTo(this.GetTaxAmountFromGroup(Item, 'CTaxes', 'CGST', 'CCGST'), DecimalsNumber);
|
|
779
784
|
Item.SGSTAmt = TrUtils.FixedTo(this.GetTaxAmountFromGroup(Item, 'CTaxes', 'SGST', 'CSGST'), DecimalsNumber);
|
|
780
785
|
Item.IGSTAmt = TrUtils.FixedTo(this.GetTaxAmountFromGroup(Item, 'CTaxes', 'IGST', 'CIGST'), DecimalsNumber);
|
|
786
|
+
Item.CESSAmt = TrUtils.FixedTo(this.GetTaxAmountFromGroup(Item, 'CTaxes', 'CESS', 'CCESS'), DecimalsNumber);
|
|
781
787
|
} else {
|
|
782
788
|
Item.UnPr = TrUtils.FixedTo(Item.UnPr, DecimalsNumber);
|
|
783
789
|
Item.CGSTAmt = 0;
|
|
784
790
|
Item.SGSTAmt = 0;
|
|
785
791
|
Item.IGSTAmt = 0;
|
|
792
|
+
Item.CESSAmt = 0;
|
|
786
793
|
}
|
|
787
794
|
} else if (AsInsuranceOnly) {
|
|
788
795
|
taxGroupKey = 'ATaxes';
|
|
@@ -795,6 +802,7 @@ export class ROPrintService {
|
|
|
795
802
|
Item.CGSTAmt = TrUtils.FixedTo(this.GetTaxAmountFromGroup(Item, 'ATaxes', 'CGST', 'ACGST'), DecimalsNumber);
|
|
796
803
|
Item.SGSTAmt = TrUtils.FixedTo(this.GetTaxAmountFromGroup(Item, 'ATaxes', 'SGST', 'ASGST'), DecimalsNumber);
|
|
797
804
|
Item.IGSTAmt = TrUtils.FixedTo(this.GetTaxAmountFromGroup(Item, 'ATaxes', 'IGST', 'AIGST'), DecimalsNumber);
|
|
805
|
+
Item.CESSAmt = TrUtils.FixedTo(this.GetTaxAmountFromGroup(Item, 'ATaxes', 'CESS', 'ACESS'), DecimalsNumber);
|
|
798
806
|
Item.AssPr = TrUtils.FixedTo(Item.AssPr, DecimalsNumber);
|
|
799
807
|
} else {
|
|
800
808
|
Item.UnPr = TrUtils.FixedTo(Item.AssPr, DecimalsNumber);
|
|
@@ -802,6 +810,7 @@ export class ROPrintService {
|
|
|
802
810
|
Item.CGSTAmt = 0;
|
|
803
811
|
Item.SGSTAmt = 0;
|
|
804
812
|
Item.IGSTAmt = 0;
|
|
813
|
+
Item.CESSAmt = 0;
|
|
805
814
|
}
|
|
806
815
|
}
|
|
807
816
|
if (!TrUtils.IsZero(Item.Qty) && !TrUtils.CheckInvalidSelect(Item.UoM)) {
|
|
@@ -811,6 +820,7 @@ export class ROPrintService {
|
|
|
811
820
|
Item.CGSTPerc = this.GetTaxRate(Item, 'CGST', taxGroupKey);
|
|
812
821
|
Item.SGSTPerc = this.GetTaxRate(Item, 'SGST', taxGroupKey);
|
|
813
822
|
Item.IGSTPerc = this.GetTaxRate(Item, 'IGST', taxGroupKey);
|
|
823
|
+
Item.CESSPerc = this.GetTaxRate(Item, 'CESS', taxGroupKey);
|
|
814
824
|
});
|
|
815
825
|
return Items;
|
|
816
826
|
}
|
|
@@ -840,7 +850,7 @@ export class ROPrintService {
|
|
|
840
850
|
return PrintInfo;
|
|
841
851
|
|
|
842
852
|
}
|
|
843
|
-
|
|
853
|
+
|
|
844
854
|
static GetFormatForROPrint(For: any, ROPrintData: any, argROType: any) {
|
|
845
855
|
let ROLaborParts: any = {};
|
|
846
856
|
ROLaborParts.Ops = ROPrintData.Ops;
|
|
@@ -1790,7 +1790,7 @@ export class SharedPDFService {
|
|
|
1790
1790
|
return HeaderNames;
|
|
1791
1791
|
}
|
|
1792
1792
|
|
|
1793
|
-
static CreateHeadingAllTaxList(ShowIGST: any) {
|
|
1793
|
+
static CreateHeadingAllTaxList(ShowIGST: any, hasCESS: boolean) {
|
|
1794
1794
|
let HeaderNames = [
|
|
1795
1795
|
// { text: 'CGST', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'CGST' },
|
|
1796
1796
|
// { text: 'SGST', style: 'tableheader', fontSize: 6, lineHeight: 0.3, Field: 'SGST' },
|
|
@@ -1802,27 +1802,42 @@ export class SharedPDFService {
|
|
|
1802
1802
|
if (ShowIGST) {
|
|
1803
1803
|
// HeaderNames.splice(1, 0, { text: 'IGST(%)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'IGST' });
|
|
1804
1804
|
HeaderNames.splice(2, 0, { text: 'IGST(Rs.)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'IGSTAmt', alignment: 'right' });
|
|
1805
|
+
if (hasCESS) {
|
|
1806
|
+
HeaderNames.splice(3, 0, { text: 'CESS(Rs.)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'CESSAmt', alignment: 'right' });
|
|
1807
|
+
}
|
|
1805
1808
|
} else {
|
|
1806
1809
|
// HeaderNames.splice(1, 0, { text: 'CGST(%)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'CGST' });
|
|
1807
1810
|
HeaderNames.splice(2, 0, { text: 'CGST(Rs.)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'CGSTAmt', alignment: 'right' });
|
|
1808
1811
|
// HeaderNames.splice(3, 0, { text: 'SGST(%)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'CGST' });
|
|
1809
1812
|
HeaderNames.splice(3, 0, { text: 'SGST(Rs.)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'SGSTAmt', alignment: 'right' });
|
|
1813
|
+
if (hasCESS) {
|
|
1814
|
+
HeaderNames.splice(4, 0, { text: 'CESS(Rs.)', style: 'tableheader2', fontSize: 6, lineHeight: 0.3, Field: 'CESSAmt', alignment: 'right' });
|
|
1815
|
+
}
|
|
1810
1816
|
}
|
|
1817
|
+
|
|
1811
1818
|
return HeaderNames;
|
|
1812
1819
|
}
|
|
1820
|
+
static hasCESS(items: any[]): boolean {
|
|
1821
|
+
if (TrUtils.IsNull(items) || items?.length === 0) {
|
|
1822
|
+
return false;
|
|
1823
|
+
}
|
|
1824
|
+
return items.some(item =>
|
|
1825
|
+
item.Taxes?.some((tax: any) => tax.Code?.toUpperCase() === 'CESS')
|
|
1826
|
+
);
|
|
1827
|
+
}
|
|
1813
1828
|
|
|
1814
1829
|
static CreateHSNTaxTable1(PartsTaxInfo: any, ShowAccParts: any, ShowIGST: any, ShowTaxColumn: any) {
|
|
1815
1830
|
if (!TrUtils.IsNull(PartsTaxInfo) && PartsTaxInfo.length !== 0 && ShowAccParts && ShowTaxColumn) {
|
|
1816
1831
|
var body: any = [];
|
|
1817
|
-
|
|
1832
|
+
const hasCESS: boolean = this.hasCESS(PartsTaxInfo);
|
|
1833
|
+
let columns: any = this.CreateHeadingAllTaxList(ShowIGST, hasCESS);
|
|
1818
1834
|
body.push(columns);
|
|
1819
1835
|
PartsTaxInfo.forEach((part: any) => {
|
|
1820
1836
|
var dataRow: any = [];
|
|
1821
1837
|
columns.forEach((column: any) => {
|
|
1822
1838
|
if (!TrUtils.IsFixedZero(part[column.Field]) &&
|
|
1823
|
-
!TrUtils.IsNull(part[column.Field]) || column.Field === 'SGST' || column.Field === 'CGST' || column.Field === 'SGSTAmt' || column.Field === 'CGSTAmt'
|
|
1824
|
-
|
|
1825
|
-
if (column.Field === 'TotalTaxableAmount' || column.Field === 'SGSTAmt' || column.Field === 'CGSTAmt' || column.Field === 'IGSTAmt') {
|
|
1839
|
+
!TrUtils.IsNull(part[column.Field]) || column.Field === 'SGST' || column.Field === 'CGST' || column.Field === 'SGSTAmt' || column.Field === 'CGSTAmt' || column.Field === 'CESSAmt' || column.Field === 'TotalTaxableAmount') {
|
|
1840
|
+
if (column.Field === 'TotalTaxableAmount' || column.Field === 'SGSTAmt' || column.Field === 'CGSTAmt' || column.Field === 'IGSTAmt' || column.Field === 'CESSAmt') {
|
|
1826
1841
|
dataRow.push({ text: TrUtils.FixPriceValue(part[column.Field]), alignment: 'right', opacity: 0.7, nowrap: true, fontSize: 6 });
|
|
1827
1842
|
} else if (column.Field === 'CombinedTaxPercentage') {
|
|
1828
1843
|
dataRow.push({ text: part[column.Field].toString() + '%', alignment: 'left', opacity: 0.7, nowrap: true, fontSize: 6 });
|