shareneus 1.4.93 → 1.4.95
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.
|
@@ -9,6 +9,8 @@ export declare class CreditNoteTotalsService {
|
|
|
9
9
|
static GetSubTotalFor(LaborList: any, PartsList: any): any;
|
|
10
10
|
static GetPartsTotalAfterDiscount(PartsList: any): any;
|
|
11
11
|
static GetDetailedTotalsData(finalTotalsData: any, IsIndependentTax: boolean, opCodesList: any, 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 GetPartDiscountedTotal(PartsList: any, isTaxable: boolean, finalTotalsData: any): any;
|
|
13
15
|
static GetPartsTaxTotalFor(PartsList: any, IsIndependentTax: boolean): any;
|
|
14
16
|
static GetCustomerTotalBasedOnTaxType(finalTotalsData: any, LaborTaxAmount: number, PartsTaxAmount: number, LaborList: any, PartsList: any, IsIndependentTax: boolean): any;
|
|
@@ -20,6 +22,6 @@ export declare class CreditNoteTotalsService {
|
|
|
20
22
|
static GetTaxGroupingForPartsByHSN(Parts: any, TaxCodes: any, DecimalsNumber: number): any[];
|
|
21
23
|
static GetCombinedTaxPercentage(Parts: any, TaxCodes: any): any;
|
|
22
24
|
static ComparePartsByHSN(Parts: any, TaxCodes: any): any[];
|
|
23
|
-
static GetTaxGroupingInfoByHSN(FinalMatchedParts: any, TaxCodes: any, DecimalsNumber:
|
|
25
|
+
static GetTaxGroupingInfoByHSN(FinalMatchedParts: any, TaxCodes: any, DecimalsNumber: any): any[];
|
|
24
26
|
static GetGSTValueBasedOnTaxCode(TCode: any, TaxCodes: any): any[];
|
|
25
27
|
}
|
|
@@ -126,6 +126,7 @@ class CreditNoteTotalsService {
|
|
|
126
126
|
// finalTotalsData.CustLaborAfterTax = addition(finalTotalsData.CustLaborITax, finalTotalsData.CustLaborTotalAfterDisc);
|
|
127
127
|
finalTotalsData.CustPartAfterTax = (0, aggregation_1.addition)(finalTotalsData.CustPartITax, finalTotalsData.CustPartsTotalAfterDisc);
|
|
128
128
|
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForPartsByHSN(tr_utils_1.TrUtils.Stringify(PartsList), TaxCodes, DecimalsNumber);
|
|
129
|
+
finalTotalsData.CustTaxGroupDataByPerc = this.GetTaxGroupingForPartsByPerc(PartsList, TaxCodes, DecimalsNumber);
|
|
129
130
|
finalTotalsData.CustTotalRoundedBy = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Round, DecimalsNumber);
|
|
130
131
|
finalTotalsData.CustRoundedTotal = tr_utils_1.TrUtils.FixedTo(finalTotalsData.Total, DecimalsNumber);
|
|
131
132
|
for (var key in finalTotalsData) {
|
|
@@ -138,6 +139,43 @@ class CreditNoteTotalsService {
|
|
|
138
139
|
}
|
|
139
140
|
return finalTotalsData;
|
|
140
141
|
}
|
|
142
|
+
static GetTaxGroupingForPartsByPerc(Parts, TaxCodes, DecimalsNumber) {
|
|
143
|
+
Parts = this.GetCombinedTaxPercentage(tr_utils_1.TrUtils.Stringify(Parts), TaxCodes);
|
|
144
|
+
// Parts = this.ResetPartsHSNIfInvalid(Parts);
|
|
145
|
+
let FinalMatchedParts = this.ComparePartsByPerc(Parts, TaxCodes);
|
|
146
|
+
return this.GetTaxGroupingInfoByHSN(FinalMatchedParts, TaxCodes, DecimalsNumber);
|
|
147
|
+
}
|
|
148
|
+
static ComparePartsByPerc(Parts, TaxCodes) {
|
|
149
|
+
let FinalMatchedParts = [];
|
|
150
|
+
Parts === null || Parts === void 0 ? void 0 : Parts.forEach((Part) => {
|
|
151
|
+
let MatchedPartsBasedOnHSN = Parts.filter((argPart) => {
|
|
152
|
+
let PartFound = false;
|
|
153
|
+
FinalMatchedParts.forEach((FinalArgParts) => {
|
|
154
|
+
let PartIndex = FinalArgParts.findIndex((FinalArgPart) => {
|
|
155
|
+
return FinalArgPart._id === argPart._id;
|
|
156
|
+
});
|
|
157
|
+
if (PartIndex !== -1) {
|
|
158
|
+
PartFound = true;
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
// let argGSTValues: any[] = this.GetGSTValueBasedOnTaxCode(argPart.TCode, TaxCodes);
|
|
162
|
+
// let argCGST = argGSTValues[0];
|
|
163
|
+
// let argSGST = argGSTValues[1];
|
|
164
|
+
// let argIGST = argGSTValues[2];
|
|
165
|
+
// let partGSTValues: any[] = this.GetGSTValueBasedOnTaxCode(Part.TCode, TaxCodes);
|
|
166
|
+
// let partCGST = partGSTValues[0];
|
|
167
|
+
// let partSGST = partGSTValues[1];
|
|
168
|
+
// let partIGST = partGSTValues[2];
|
|
169
|
+
return (!PartFound) &&
|
|
170
|
+
(argPart.CGSTAmt === Part.CGSTAmt) && (argPart.IGSTAmt === Part.IGSTAmt) &&
|
|
171
|
+
(argPart.SGSTAmt === Part.SGSTAmt);
|
|
172
|
+
});
|
|
173
|
+
if (MatchedPartsBasedOnHSN.length !== 0) {
|
|
174
|
+
FinalMatchedParts.push(MatchedPartsBasedOnHSN);
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
return FinalMatchedParts;
|
|
178
|
+
}
|
|
141
179
|
static GetPartDiscountedTotal(PartsList, isTaxable, finalTotalsData) {
|
|
142
180
|
let PartsDiscountedTotal = 0;
|
|
143
181
|
let overallPartDisc = 0;
|
|
@@ -278,15 +316,24 @@ class CreditNoteTotalsService {
|
|
|
278
316
|
let TaxInfo = {};
|
|
279
317
|
let TaxOnAmount = 0;
|
|
280
318
|
let TaxAmount = 0;
|
|
319
|
+
let CGSTAmt = 0;
|
|
320
|
+
let SGSTAmt = 0;
|
|
321
|
+
let IGSTAmt = 0;
|
|
281
322
|
let HSN = MatchedPart[0].HSN;
|
|
282
323
|
TaxInfo.CombinedTaxPercentage = MatchedPart[0].CombinedTaxPercentage;
|
|
283
324
|
MatchedPart.forEach((argMatchedGSTPart) => {
|
|
284
|
-
TaxOnAmount = (0, aggregation_1.addition)(TaxOnAmount, argMatchedGSTPart.AfterPartDisc);
|
|
285
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount, argMatchedGSTPart.CGST);
|
|
286
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount, argMatchedGSTPart.IGST);
|
|
287
|
-
TaxAmount = (0, aggregation_1.addition)(TaxAmount, argMatchedGSTPart.SGST);
|
|
325
|
+
TaxOnAmount = (0, aggregation_1.addition)(TaxOnAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.AfterPartDisc, DecimalsNumber));
|
|
326
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CGST, DecimalsNumber));
|
|
327
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.IGST, DecimalsNumber));
|
|
328
|
+
TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.SGST, DecimalsNumber));
|
|
329
|
+
CGSTAmt = (0, aggregation_1.addition)(CGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CGST, DecimalsNumber));
|
|
330
|
+
SGSTAmt = (0, aggregation_1.addition)(SGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.SGST, DecimalsNumber));
|
|
331
|
+
IGSTAmt = (0, aggregation_1.addition)(IGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.IGST, DecimalsNumber));
|
|
288
332
|
});
|
|
289
333
|
TaxInfo.HSN = HSN;
|
|
334
|
+
TaxInfo.CGSTAmt = CGSTAmt;
|
|
335
|
+
TaxInfo.SGSTAmt = SGSTAmt;
|
|
336
|
+
TaxInfo.IGSTAmt = IGSTAmt;
|
|
290
337
|
TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount, DecimalsNumber);
|
|
291
338
|
TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount, DecimalsNumber);
|
|
292
339
|
TaxInfo.ItemsCount = MatchedPart.length;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AdjustmentDrugPDFService = void 0;
|
|
4
4
|
const my_date_1 = require("../../utils/my-date");
|
|
5
|
+
const tr_utils_1 = require("../../utils/tr-utils");
|
|
5
6
|
class AdjustmentDrugPDFService {
|
|
6
7
|
static GetPrint(ReOrderPointData, DatesDetails) {
|
|
7
8
|
// console.log('ReOrderPointData', ReOrderPointData);
|
|
@@ -135,7 +136,7 @@ class AdjustmentDrugPDFService {
|
|
|
135
136
|
let dataRow = [];
|
|
136
137
|
dataRow.push({ text: index + 1, alignment: 'center' });
|
|
137
138
|
dataRow.push({ text: item.Name });
|
|
138
|
-
dataRow.push({ text: item.Batch.BN, alignment: 'left', style: ['headerstyle'], });
|
|
139
|
+
dataRow.push({ text: tr_utils_1.TrUtils.IsNull(item.Batch) ? '' : item.Batch.BN, alignment: 'left', style: ['headerstyle'], });
|
|
139
140
|
// dataRow.push({ text: MyDate.ConvertUTCDateToReadableExDateTxt(item.Batch.ExDt), alignment: 'center', style: ['headerstyle'], });
|
|
140
141
|
dataRow.push({ text: item.Qty, alignment: 'right', style: ['headerstyle'], });
|
|
141
142
|
// dataRow.push({ text: TrUtils.FixPriceValue(item.Batch.Cost, DecimalsNumber), alignment: 'right', style: ['headerstyle'], });
|