shareneus 1.7.343 → 1.7.345
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/accounting/invoice/invoice-total.service.js +10 -5
- package/dist/shared/totals-section/pdf-totals.section.js +1 -1
- package/dist/shared/transactions-pdf.service.js +2 -0
- package/package.json +1 -1
- package/src/accounting/invoice/invoice-total.service.ts +10 -5
- package/src/shared/totals-section/pdf-totals.section.ts +1 -1
- package/src/shared/transactions-pdf.service.ts +2 -0
|
@@ -268,6 +268,7 @@ class InvoiceTotalsService {
|
|
|
268
268
|
finalTotalsData.CustPartCGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(PartTaxInfo[0]);
|
|
269
269
|
finalTotalsData.CustPartIGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(PartTaxInfo[2]);
|
|
270
270
|
finalTotalsData.CustPartSGST = tr_utils_1.TrUtils.SetValueToZeroIfNull(PartTaxInfo[1]);
|
|
271
|
+
finalTotalsData.CustPartCESS = tr_utils_1.TrUtils.SetValueToZeroIfNull(PartTaxInfo[3]);
|
|
271
272
|
finalTotalsData.CustLaborAfterTax = (0, math_operations_1.Add)(finalTotalsData.CustLaborITax, finalTotalsData.CustLaborTotalAfterDisc);
|
|
272
273
|
finalTotalsData.CustPartAfterTax = (0, math_operations_1.Add)(finalTotalsData.CustPartITax, finalTotalsData.CustPartsTotalAfterDisc);
|
|
273
274
|
finalTotalsData.CustTaxGroupData = this.GetTaxGroupingForPartsByHSN(PartsList, TaxCodes, DecimalsNumber);
|
|
@@ -471,10 +472,10 @@ class InvoiceTotalsService {
|
|
|
471
472
|
if (IsIndependentTax) {
|
|
472
473
|
PartsList.forEach((Part) => {
|
|
473
474
|
if (Part.Ret === true) {
|
|
474
|
-
RetTotalTaxAmt = (0, math_operations_1.Add)(RetTotalTaxAmt, Part.CGST, Part.SGST, Part.IGST);
|
|
475
|
+
RetTotalTaxAmt = (0, math_operations_1.Add)(RetTotalTaxAmt, Part.CGST, Part.SGST, Part.IGST, Part.CESS);
|
|
475
476
|
}
|
|
476
477
|
else {
|
|
477
|
-
TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Part.CGST, Part.SGST, Part.IGST);
|
|
478
|
+
TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Part.CGST, Part.SGST, Part.IGST, Part.CESS);
|
|
478
479
|
}
|
|
479
480
|
});
|
|
480
481
|
}
|
|
@@ -485,7 +486,7 @@ class InvoiceTotalsService {
|
|
|
485
486
|
if (IsIndependentTax) {
|
|
486
487
|
PartsList.forEach((Part) => {
|
|
487
488
|
if (Part.Ret === true) {
|
|
488
|
-
RetTotalTaxAmt = (0, math_operations_1.Add)(RetTotalTaxAmt, Part.CGST, Part.SGST, Part.IGST);
|
|
489
|
+
RetTotalTaxAmt = (0, math_operations_1.Add)(RetTotalTaxAmt, Part.CGST, Part.SGST, Part.IGST, Part.CESS);
|
|
489
490
|
}
|
|
490
491
|
});
|
|
491
492
|
}
|
|
@@ -496,7 +497,7 @@ class InvoiceTotalsService {
|
|
|
496
497
|
if (IsIndependentTax) {
|
|
497
498
|
PartsList.forEach((Part) => {
|
|
498
499
|
if (tr_utils_1.TrUtils.IsNull(Part.Ret) || Part.Ret === false) {
|
|
499
|
-
NonRetTotalTaxAmt = (0, math_operations_1.Add)(NonRetTotalTaxAmt, Part.CGST, Part.SGST, Part.IGST);
|
|
500
|
+
NonRetTotalTaxAmt = (0, math_operations_1.Add)(NonRetTotalTaxAmt, Part.CGST, Part.SGST, Part.IGST, Part.CESS);
|
|
500
501
|
}
|
|
501
502
|
});
|
|
502
503
|
}
|
|
@@ -582,21 +583,25 @@ class InvoiceTotalsService {
|
|
|
582
583
|
let TotalIGSTAmt = 0;
|
|
583
584
|
let TotalSGSTAmt = 0;
|
|
584
585
|
let RetTotalSGSTAmt = 0;
|
|
586
|
+
let TotalCESSAmt = 0;
|
|
587
|
+
let RetTotalCESSAmt = 0;
|
|
585
588
|
if (IsIndependentTax) {
|
|
586
589
|
PartsList.forEach((Part) => {
|
|
587
590
|
if (Part.Ret === true) {
|
|
588
591
|
RetTotalCGSTAmt = (0, math_operations_1.Add)(RetTotalCGSTAmt, Part.CGST);
|
|
589
592
|
RetTotalSGSTAmt = (0, math_operations_1.Add)(RetTotalSGSTAmt, Part.SGST);
|
|
590
593
|
RetTotalIGSTAmt = (0, math_operations_1.Add)(RetTotalIGSTAmt, Part.IGST);
|
|
594
|
+
RetTotalCESSAmt = (0, math_operations_1.Add)(RetTotalCESSAmt, Part.CESS);
|
|
591
595
|
}
|
|
592
596
|
else {
|
|
593
597
|
TotalCGSTAmt = (0, math_operations_1.Add)(TotalCGSTAmt, Part.CGST);
|
|
594
598
|
TotalSGSTAmt = (0, math_operations_1.Add)(TotalSGSTAmt, Part.SGST);
|
|
595
599
|
TotalIGSTAmt = (0, math_operations_1.Add)(TotalIGSTAmt, Part.IGST);
|
|
600
|
+
TotalCESSAmt = (0, math_operations_1.Add)(TotalCESSAmt, Part.CESS);
|
|
596
601
|
}
|
|
597
602
|
});
|
|
598
603
|
}
|
|
599
|
-
return [TotalCGSTAmt, TotalSGSTAmt, TotalIGSTAmt];
|
|
604
|
+
return [TotalCGSTAmt, TotalSGSTAmt, TotalIGSTAmt, TotalCESSAmt, RetTotalCGSTAmt];
|
|
600
605
|
}
|
|
601
606
|
static GetTaxGroupingForPartsByHSN(Parts, TaxCodes, DecimalsNumber) {
|
|
602
607
|
Parts = this.GetCombinedTaxPercentage(tr_utils_1.TrUtils.Stringify(Parts), TaxCodes);
|
|
@@ -571,7 +571,7 @@ function resolveTotals(invoiceData, totalTax, printConfigData = {}, taxMode = ''
|
|
|
571
571
|
? itemsDiscount + servicesDiscount + overallDiscount
|
|
572
572
|
: (0, pdf_table_section_1.readNumericValue)(invoiceData, ['Disc', 'Discount', 'TotDisc']);
|
|
573
573
|
const roundOff = (0, pdf_table_section_1.readNumericValue)(invoiceData, ['Round', 'RoundOff']);
|
|
574
|
-
const taxFromInvoice = (0, pdf_table_section_1.readNumericValue)(invoiceData, ['TotalTax', 'TaxTotal', 'TaxAmt', 'GSTTotal', 'CustItemITax']);
|
|
574
|
+
const taxFromInvoice = (0, pdf_table_section_1.readNumericValue)(invoiceData, ['TotalTax', 'TaxTotal', 'TaxAmt', 'GSTTotal', 'CustItemITax', 'CustPartITax']);
|
|
575
575
|
const totalTaxValue = taxFromInvoice !== 0 ? taxFromInvoice : totalTax;
|
|
576
576
|
const returnTotal = (0, pdf_shared_utils_1.firstValue)(invoiceData === null || invoiceData === void 0 ? void 0 : invoiceData.RetTotal);
|
|
577
577
|
const finalTotalRaw = (0, pdf_shared_utils_1.firstValue)(invoiceData === null || invoiceData === void 0 ? void 0 : invoiceData.FinalTotal, invoiceData === null || invoiceData === void 0 ? void 0 : invoiceData.Total, invoiceData === null || invoiceData === void 0 ? void 0 : invoiceData.GrandTotal, invoiceData === null || invoiceData === void 0 ? void 0 : invoiceData.NetTotal);
|
|
@@ -44,12 +44,14 @@ function GetInvoicePDF(invoiceData, entityData, headerConfig, printConfig, taxCo
|
|
|
44
44
|
invPrint = (0, unified_invoice_pdf_service_1.GetInvoicePrint)(invoicePrintData, numberofCopies, withPass, options.Size, options.MoreDiscDetails, options.Orientation);
|
|
45
45
|
}
|
|
46
46
|
else {
|
|
47
|
+
console.log("options", options);
|
|
47
48
|
if (options.PartInvoice && options.LaborInvoice) {
|
|
48
49
|
invoicePrintData.Round = tr_utils_1.TrUtils.FixedTo(invoiceData.Round);
|
|
49
50
|
invoicePrintData.Total = tr_utils_1.TrUtils.FixedTo(invoiceData.Total);
|
|
50
51
|
invoicePrintData.SubToal = tr_utils_1.TrUtils.FixedTo(invoiceData.SubToal);
|
|
51
52
|
invoicePrintData.TaxTotal = tr_utils_1.TrUtils.FixedTo(invoiceData.TaxTotal);
|
|
52
53
|
}
|
|
54
|
+
console.log("invoicePrintData", invoicePrintData);
|
|
53
55
|
delete invoicePrintData.SIndTotal;
|
|
54
56
|
invPrint = (0, invoice_pdf_service_1.CreateInvoicePDFService)(invoicePrintData, printConfigData, numberofCopies);
|
|
55
57
|
}
|
package/package.json
CHANGED
|
@@ -335,6 +335,7 @@ export class InvoiceTotalsService {
|
|
|
335
335
|
finalTotalsData.CustPartCGST = TrUtils.SetValueToZeroIfNull(PartTaxInfo[0]);
|
|
336
336
|
finalTotalsData.CustPartIGST = TrUtils.SetValueToZeroIfNull(PartTaxInfo[2]);
|
|
337
337
|
finalTotalsData.CustPartSGST = TrUtils.SetValueToZeroIfNull(PartTaxInfo[1]);
|
|
338
|
+
finalTotalsData.CustPartCESS = TrUtils.SetValueToZeroIfNull(PartTaxInfo[3]);
|
|
338
339
|
|
|
339
340
|
finalTotalsData.CustLaborAfterTax = Add(finalTotalsData.CustLaborITax, finalTotalsData.CustLaborTotalAfterDisc);
|
|
340
341
|
finalTotalsData.CustPartAfterTax = Add(finalTotalsData.CustPartITax, finalTotalsData.CustPartsTotalAfterDisc);
|
|
@@ -573,9 +574,9 @@ export class InvoiceTotalsService {
|
|
|
573
574
|
if (IsIndependentTax) {
|
|
574
575
|
PartsList.forEach((Part: any) => {
|
|
575
576
|
if (Part.Ret === true) {
|
|
576
|
-
RetTotalTaxAmt = Add(RetTotalTaxAmt, Part.CGST, Part.SGST, Part.IGST);
|
|
577
|
+
RetTotalTaxAmt = Add(RetTotalTaxAmt, Part.CGST, Part.SGST, Part.IGST, Part.CESS);
|
|
577
578
|
} else {
|
|
578
|
-
TotalTaxAmt = Add(TotalTaxAmt, Part.CGST, Part.SGST, Part.IGST);
|
|
579
|
+
TotalTaxAmt = Add(TotalTaxAmt, Part.CGST, Part.SGST, Part.IGST, Part.CESS);
|
|
579
580
|
}
|
|
580
581
|
});
|
|
581
582
|
}
|
|
@@ -587,7 +588,7 @@ export class InvoiceTotalsService {
|
|
|
587
588
|
if (IsIndependentTax) {
|
|
588
589
|
PartsList.forEach((Part: any) => {
|
|
589
590
|
if (Part.Ret === true) {
|
|
590
|
-
RetTotalTaxAmt = Add(RetTotalTaxAmt, Part.CGST, Part.SGST, Part.IGST);
|
|
591
|
+
RetTotalTaxAmt = Add(RetTotalTaxAmt, Part.CGST, Part.SGST, Part.IGST, Part.CESS);
|
|
591
592
|
}
|
|
592
593
|
});
|
|
593
594
|
}
|
|
@@ -599,7 +600,7 @@ export class InvoiceTotalsService {
|
|
|
599
600
|
if (IsIndependentTax) {
|
|
600
601
|
PartsList.forEach((Part: any) => {
|
|
601
602
|
if (TrUtils.IsNull(Part.Ret) || Part.Ret === false) {
|
|
602
|
-
NonRetTotalTaxAmt = Add(NonRetTotalTaxAmt, Part.CGST, Part.SGST, Part.IGST);
|
|
603
|
+
NonRetTotalTaxAmt = Add(NonRetTotalTaxAmt, Part.CGST, Part.SGST, Part.IGST, Part.CESS);
|
|
603
604
|
}
|
|
604
605
|
});
|
|
605
606
|
}
|
|
@@ -694,20 +695,24 @@ export class InvoiceTotalsService {
|
|
|
694
695
|
let TotalIGSTAmt: number = 0;
|
|
695
696
|
let TotalSGSTAmt: number = 0;
|
|
696
697
|
let RetTotalSGSTAmt: number = 0;
|
|
698
|
+
let TotalCESSAmt: number = 0;
|
|
699
|
+
let RetTotalCESSAmt: number = 0;
|
|
697
700
|
if (IsIndependentTax) {
|
|
698
701
|
PartsList.forEach((Part: any) => {
|
|
699
702
|
if (Part.Ret === true) {
|
|
700
703
|
RetTotalCGSTAmt = Add(RetTotalCGSTAmt, Part.CGST);
|
|
701
704
|
RetTotalSGSTAmt = Add(RetTotalSGSTAmt, Part.SGST);
|
|
702
705
|
RetTotalIGSTAmt = Add(RetTotalIGSTAmt, Part.IGST);
|
|
706
|
+
RetTotalCESSAmt = Add(RetTotalCESSAmt, Part.CESS);
|
|
703
707
|
} else {
|
|
704
708
|
TotalCGSTAmt = Add(TotalCGSTAmt, Part.CGST);
|
|
705
709
|
TotalSGSTAmt = Add(TotalSGSTAmt, Part.SGST);
|
|
706
710
|
TotalIGSTAmt = Add(TotalIGSTAmt, Part.IGST);
|
|
711
|
+
TotalCESSAmt = Add(TotalCESSAmt, Part.CESS);
|
|
707
712
|
}
|
|
708
713
|
});
|
|
709
714
|
}
|
|
710
|
-
return [TotalCGSTAmt, TotalSGSTAmt, TotalIGSTAmt];
|
|
715
|
+
return [TotalCGSTAmt, TotalSGSTAmt, TotalIGSTAmt, TotalCESSAmt, RetTotalCGSTAmt];
|
|
711
716
|
}
|
|
712
717
|
|
|
713
718
|
static GetTaxGroupingForPartsByHSN(Parts: any, TaxCodes: any, DecimalsNumber: any) {
|
|
@@ -693,7 +693,7 @@ function resolveTotals(invoiceData: any, totalTax: number, printConfigData: any
|
|
|
693
693
|
? itemsDiscount + servicesDiscount + overallDiscount
|
|
694
694
|
: readNumericValue(invoiceData, ['Disc', 'Discount', 'TotDisc']);
|
|
695
695
|
const roundOff = readNumericValue(invoiceData, ['Round', 'RoundOff']);
|
|
696
|
-
const taxFromInvoice = readNumericValue(invoiceData, ['TotalTax', 'TaxTotal', 'TaxAmt', 'GSTTotal', 'CustItemITax']);
|
|
696
|
+
const taxFromInvoice = readNumericValue(invoiceData, ['TotalTax', 'TaxTotal', 'TaxAmt', 'GSTTotal', 'CustItemITax', 'CustPartITax']);
|
|
697
697
|
const totalTaxValue = taxFromInvoice !== 0 ? taxFromInvoice : totalTax;
|
|
698
698
|
const returnTotal = firstValue(invoiceData?.RetTotal);
|
|
699
699
|
const finalTotalRaw = firstValue(invoiceData?.FinalTotal, invoiceData?.Total, invoiceData?.GrandTotal, invoiceData?.NetTotal);
|
|
@@ -40,12 +40,14 @@ export function GetInvoicePDF(invoiceData: any, entityData: any, headerConfig: a
|
|
|
40
40
|
if (options.ConsolidateGST) {
|
|
41
41
|
invPrint = GetInvoicePrint(invoicePrintData, numberofCopies, withPass, options.Size, options.MoreDiscDetails, options.Orientation);
|
|
42
42
|
} else {
|
|
43
|
+
console.log("options", options);
|
|
43
44
|
if(options.PartInvoice && options.LaborInvoice){
|
|
44
45
|
invoicePrintData.Round = TrUtils.FixedTo(invoiceData.Round);
|
|
45
46
|
invoicePrintData.Total = TrUtils.FixedTo(invoiceData.Total);
|
|
46
47
|
invoicePrintData.SubToal = TrUtils.FixedTo(invoiceData.SubToal);
|
|
47
48
|
invoicePrintData.TaxTotal = TrUtils.FixedTo(invoiceData.TaxTotal);
|
|
48
49
|
}
|
|
50
|
+
console.log("invoicePrintData", invoicePrintData);
|
|
49
51
|
delete invoicePrintData.SIndTotal;
|
|
50
52
|
invPrint = CreateInvoicePDFService(invoicePrintData, printConfigData, numberofCopies);
|
|
51
53
|
}
|