shareneus 1.4.90 → 1.4.92
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.
|
@@ -873,7 +873,7 @@ class DCLandscapePdfService {
|
|
|
873
873
|
heights: [105, 105, 105],
|
|
874
874
|
body: [
|
|
875
875
|
[
|
|
876
|
-
shared_pdf_service_1.SharedPDFService.
|
|
876
|
+
shared_pdf_service_1.SharedPDFService.PartsTaxAmounts1(ROPrintData.CustTaxGroupData, true, ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn),
|
|
877
877
|
// SharedPDFService.GetTaxOnParts(ROPrintData.CustPartsTotalBeforeDisc, ROPrintData.CustPartsDiscTotal, ROPrintData.CustPartCGST,
|
|
878
878
|
// ROPrintData.CustPartSGST, ROPrintData.ShowAccParts, ROPrintData.CustPartIGST, ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn,
|
|
879
879
|
// ROPrintData.ShowTaxColumn, ROPrintData.From),
|
|
@@ -9,6 +9,8 @@ export declare class DeliveryChallanTotalsService {
|
|
|
9
9
|
static GetSubTotalFor(PartsList: any): any;
|
|
10
10
|
static GetPartsTotalAfterDiscount(PartsList: any): any;
|
|
11
11
|
static GetDetailedTotalsData(finalTotalsData: any, IsIndependentTax: boolean, PartsList: any, TaxCodes: any, DecimalsNumber: number): any;
|
|
12
|
+
static GetTaxGroupingForPartsByPerc(Parts: any, TaxCodes: any, DecimalsNumber: any): any[];
|
|
13
|
+
static ComparePartsByPerc(Parts: any, TaxCodes: any): any[];
|
|
12
14
|
static GetLaborDiscountedTotal(LaborList: any): any;
|
|
13
15
|
static GetPartDiscountedTotal(PartsList: any): any;
|
|
14
16
|
static GetPartsTaxTotalFor(PartsList: any, IsIndependentTax: boolean): any;
|
|
@@ -22,6 +24,6 @@ export declare class DeliveryChallanTotalsService {
|
|
|
22
24
|
static GetTaxGroupingForPartsByHSN(Parts: any, TaxCodes: any, DecimalsNumber: number): any[];
|
|
23
25
|
static GetCombinedTaxPercentage(Parts: any, TaxCodes: any): any;
|
|
24
26
|
static ComparePartsByHSN(Parts: any, TaxCodes: any): any[];
|
|
25
|
-
static GetTaxGroupingInfoByHSN(FinalMatchedParts: any, TaxCodes: any, DecimalsNumber:
|
|
27
|
+
static GetTaxGroupingInfoByHSN(FinalMatchedParts: any, TaxCodes: any, DecimalsNumber: any): any[];
|
|
26
28
|
static GetGSTValueBasedOnTaxCode(TCode: any, TaxCodes: any): any[];
|
|
27
29
|
}
|
|
@@ -123,6 +123,7 @@ class DeliveryChallanTotalsService {
|
|
|
123
123
|
// finalTotalsData.CustLaborAfterTax = TrUtils.FixedTo(finalTotalsData.CustLaborITax + finalTotalsData.CustLaborTotalAfterDisc);
|
|
124
124
|
finalTotalsData.CustPartAfterTax = (0, aggregation_1.addition)(finalTotalsData.CustPartITax, finalTotalsData.CustPartsTotalAfterDisc);
|
|
125
125
|
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForPartsByHSN(PartsList, TaxCodes, DecimalsNumber);
|
|
126
|
+
finalTotalsData.CustTaxGroupDataByPerc = this.GetTaxGroupingForPartsByPerc(PartsList, TaxCodes, DecimalsNumber);
|
|
126
127
|
finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round, DecimalsNumber);
|
|
127
128
|
finalTotalsData.CustRoundedTotal = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Total, DecimalsNumber);
|
|
128
129
|
for (var key in finalTotalsData) {
|
|
@@ -135,6 +136,43 @@ class DeliveryChallanTotalsService {
|
|
|
135
136
|
}
|
|
136
137
|
return finalTotalsData;
|
|
137
138
|
}
|
|
139
|
+
static GetTaxGroupingForPartsByPerc(Parts, TaxCodes, DecimalsNumber) {
|
|
140
|
+
Parts = this.GetCombinedTaxPercentage(tr_utils_1.TrUtils.Stringify(Parts), TaxCodes);
|
|
141
|
+
// Parts = this.ResetPartsHSNIfInvalid(Parts);
|
|
142
|
+
let FinalMatchedParts = this.ComparePartsByPerc(Parts, TaxCodes);
|
|
143
|
+
return this.GetTaxGroupingInfoByHSN(FinalMatchedParts, TaxCodes, DecimalsNumber);
|
|
144
|
+
}
|
|
145
|
+
static ComparePartsByPerc(Parts, TaxCodes) {
|
|
146
|
+
let FinalMatchedParts = [];
|
|
147
|
+
Parts === null || Parts === void 0 ? void 0 : Parts.forEach((Part) => {
|
|
148
|
+
let MatchedPartsBasedOnHSN = Parts.filter((argPart) => {
|
|
149
|
+
let PartFound = false;
|
|
150
|
+
FinalMatchedParts.forEach((FinalArgParts) => {
|
|
151
|
+
let PartIndex = FinalArgParts.findIndex((FinalArgPart) => {
|
|
152
|
+
return FinalArgPart._id === argPart._id;
|
|
153
|
+
});
|
|
154
|
+
if (PartIndex !== -1) {
|
|
155
|
+
PartFound = true;
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
// let argGSTValues: any[] = this.GetGSTValueBasedOnTaxCode(argPart.TCode, TaxCodes);
|
|
159
|
+
// let argCGST = argGSTValues[0];
|
|
160
|
+
// let argSGST = argGSTValues[1];
|
|
161
|
+
// let argIGST = argGSTValues[2];
|
|
162
|
+
// let partGSTValues: any[] = this.GetGSTValueBasedOnTaxCode(Part.TCode, TaxCodes);
|
|
163
|
+
// let partCGST = partGSTValues[0];
|
|
164
|
+
// let partSGST = partGSTValues[1];
|
|
165
|
+
// let partIGST = partGSTValues[2];
|
|
166
|
+
return (!PartFound) &&
|
|
167
|
+
(argPart.CGSTAmt === Part.CGSTAmt) && (argPart.IGSTAmt === Part.IGSTAmt) &&
|
|
168
|
+
(argPart.SGSTAmt === Part.SGSTAmt);
|
|
169
|
+
});
|
|
170
|
+
if (MatchedPartsBasedOnHSN.length !== 0) {
|
|
171
|
+
FinalMatchedParts.push(MatchedPartsBasedOnHSN);
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
return FinalMatchedParts;
|
|
175
|
+
}
|
|
138
176
|
static GetLaborDiscountedTotal(LaborList) {
|
|
139
177
|
let LaborDiscountedTotal = 0;
|
|
140
178
|
LaborList.forEach((Labor) => {
|
|
@@ -290,15 +328,24 @@ class DeliveryChallanTotalsService {
|
|
|
290
328
|
let TaxInfo = {};
|
|
291
329
|
let TaxOnAmount = 0;
|
|
292
330
|
let TaxAmount = 0;
|
|
331
|
+
let CGSTAmt = 0;
|
|
332
|
+
let SGSTAmt = 0;
|
|
333
|
+
let IGSTAmt = 0;
|
|
293
334
|
let HSN = MatchedPart[0].HSN;
|
|
294
335
|
TaxInfo.CombinedTaxPercentage = MatchedPart[0].CombinedTaxPercentage;
|
|
295
336
|
MatchedPart.forEach((argMatchedGSTPart) => {
|
|
296
|
-
TaxOnAmount = (0, aggregation_1.addition)(TaxOnAmount, argMatchedGSTPart.AfterPartDisc);
|
|
297
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount, argMatchedGSTPart.CGST);
|
|
298
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount, argMatchedGSTPart.IGST);
|
|
299
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount, argMatchedGSTPart.SGST);
|
|
337
|
+
TaxOnAmount = (0, aggregation_1.addition)(TaxOnAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.AfterPartDisc, DecimalsNumber));
|
|
338
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CGST, DecimalsNumber));
|
|
339
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.IGST, DecimalsNumber));
|
|
340
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.SGST, DecimalsNumber));
|
|
341
|
+
CGSTAmt = (0, aggregation_1.addition)(CGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CGST, DecimalsNumber));
|
|
342
|
+
SGSTAmt = (0, aggregation_1.addition)(SGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.SGST, DecimalsNumber));
|
|
343
|
+
IGSTAmt = (0, aggregation_1.addition)(IGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.IGST, DecimalsNumber));
|
|
300
344
|
});
|
|
301
345
|
TaxInfo.HSN = HSN;
|
|
346
|
+
TaxInfo.CGSTAmt = CGSTAmt;
|
|
347
|
+
TaxInfo.SGSTAmt = SGSTAmt;
|
|
348
|
+
TaxInfo.IGSTAmt = IGSTAmt;
|
|
302
349
|
TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount, DecimalsNumber);
|
|
303
350
|
TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount, DecimalsNumber);
|
|
304
351
|
TaxInfo.ItemsCount = MatchedPart.length;
|