shareneus 1.7.359 → 1.7.361

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.
@@ -43,6 +43,7 @@ export declare class ROTotalsService {
43
43
  static GetCustPartCGSTTaxTotal(OpsList: any, PartsList: any, IsTaxable: boolean, isWorkOrder: boolean): any;
44
44
  static GetCustPartIGSTTaxTotal(OpsList: any, PartsList: any, IsTaxable: boolean, isWorkOrder: boolean): any;
45
45
  static GetCustPartSGSTTaxTotal(OpsList: any, PartsList: any, IsTaxable: boolean, isWorkOrder: boolean): any;
46
+ static GetCustPartCESSTaxTotal(OpsList: any, PartsList: any, IsTaxable: boolean, isWorkOrder: boolean): any;
46
47
  static GetInsLaborCGSTTaxTotal(opCodesList: any, IsTaxable: boolean, isWorkOrder: boolean): any;
47
48
  static GetInsLaborIGSTTaxTotal(opCodesList: any, IsTaxable: boolean, isWorkOrder: boolean): any;
48
49
  static GetInsLaborSGSTTaxTotal(opCodesList: any, IsTaxable: boolean, isWorkOrder: boolean): any;
@@ -686,6 +686,7 @@ class ROTotalsService {
686
686
  argRecordData.CustPartCGST = this.GetCustPartCGSTTaxTotal(dupRecordData.Ops, dupRecordData.Parts, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
687
687
  argRecordData.CustPartIGST = this.GetCustPartIGSTTaxTotal(dupRecordData.Ops, dupRecordData.Parts, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
688
688
  argRecordData.CustPartSGST = this.GetCustPartSGSTTaxTotal(dupRecordData.Ops, dupRecordData.Parts, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
689
+ argRecordData.CustPartCESS = this.GetCustPartCESSTaxTotal(dupRecordData.Ops, dupRecordData.Parts, tr_utils_1.TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
689
690
  argRecordData.CustLaborLDiscAmount = this.GetLaborLDiscAmount(argRecordData.CustLaborTotalAfterDisc, argRecordData.LDisc);
690
691
  argRecordData.CustPartsPDiscAmount = this.GetPartsPDiscAmount(argRecordData.CustPartsTotalAfterDisc, argRecordData.PDisc);
691
692
  argRecordData.CustLaborAfterLDisc = argRecordData.CustLaborTotalAfterDisc;
@@ -925,6 +926,50 @@ class ROTotalsService {
925
926
  }
926
927
  return TotalTaxAmt;
927
928
  }
929
+ static GetCustPartCESSTaxTotal(OpsList, PartsList, IsTaxable, isWorkOrder) {
930
+ let TotalTaxAmt = 0;
931
+ if (IsTaxable) {
932
+ PartsList.forEach((Part) => {
933
+ if (!tr_utils_1.TrUtils.IsNull(Part.CollId)) {
934
+ if (isWorkOrder) {
935
+ TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Part.CCESS);
936
+ }
937
+ else {
938
+ if (Part.Sts !== enums_1.LaborStatusEnum.New && Part.Sts !== enums_1.LaborStatusEnum.WtngForAppr) {
939
+ TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Part.CCESS);
940
+ }
941
+ else {
942
+ if (Part.PBy === enums_1.PayTypeEnum.Customer) {
943
+ TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Part.ECESS);
944
+ }
945
+ }
946
+ }
947
+ }
948
+ else {
949
+ if (isWorkOrder) {
950
+ TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Part.CCESS);
951
+ }
952
+ else {
953
+ let Index = OpsList.findIndex((labor) => {
954
+ return labor._id === Part.OpId;
955
+ });
956
+ if (Index !== -1) {
957
+ if (OpsList[Index].Sts !== enums_1.LaborStatusEnum.New && OpsList[Index].Sts !== enums_1.LaborStatusEnum.WtngForAppr) {
958
+ TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Part.CCESS);
959
+ }
960
+ else {
961
+ TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Part.ECESS);
962
+ }
963
+ }
964
+ else {
965
+ TotalTaxAmt = (0, math_operations_1.Add)(TotalTaxAmt, Part.CCESS);
966
+ }
967
+ }
968
+ }
969
+ });
970
+ }
971
+ return TotalTaxAmt;
972
+ }
928
973
  static GetInsLaborCGSTTaxTotal(opCodesList, IsTaxable, isWorkOrder) {
929
974
  let TotalTaxAmt = 0;
930
975
  if (IsTaxable) {
@@ -44,13 +44,16 @@ 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('invoicePrintData', invoicePrintData, 'options', options);
47
+ // console.log('invoicePrintData', invoicePrintData, 'options', options);
48
48
  if (options.PartInvoice && options.LaborInvoice) {
49
49
  invoicePrintData.Round = tr_utils_1.TrUtils.FixedTo(invoiceData.Round);
50
50
  invoicePrintData.Total = tr_utils_1.TrUtils.FixedTo(invoiceData.Total);
51
51
  invoicePrintData.SubToal = tr_utils_1.TrUtils.FixedTo(invoiceData.SubToal);
52
52
  invoicePrintData.TaxTotal = tr_utils_1.TrUtils.FixedTo(invoiceData.TaxTotal);
53
53
  }
54
+ else {
55
+ invoicePrintData.TaxTotal = tr_utils_1.TrUtils.FixedTo((0, math_operations_1.Add)(Number(invoiceData.CustPartITax), Number(invoiceData.CustLaborITax)));
56
+ }
54
57
  delete invoicePrintData.SIndTotal;
55
58
  invPrint = (0, invoice_pdf_service_1.CreateInvoicePDFService)(invoicePrintData, printConfigData, numberofCopies);
56
59
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.7.359",
3
+ "version": "1.7.361",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -713,9 +713,10 @@ export class ROTotalsService {
713
713
  argRecordData.CustLaborIGST = this.GetCustLaborIGSTTaxTotal(dupRecordData.Ops, TrUtils.isTaxable(dupRecordData.Settings.Tax), isWorkOrder);
714
714
 
715
715
  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);
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);
719
720
 
720
721
 
721
722
  argRecordData.CustLaborLDiscAmount = this.GetLaborLDiscAmount(argRecordData.CustLaborTotalAfterDisc, argRecordData.LDisc);
@@ -910,11 +911,11 @@ export class ROTotalsService {
910
911
  return TotalTaxAmt;
911
912
  }
912
913
 
913
- static GetCustPartSGSTTaxTotal(OpsList: any, PartsList: any, IsTaxable: boolean, isWorkOrder: boolean) {
914
- let TotalTaxAmt: any = 0;
915
- if (IsTaxable) {
916
- PartsList.forEach((Part: any) => {
917
- if (!TrUtils.IsNull(Part.CollId)) {
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)) {
918
919
  if (isWorkOrder) {
919
920
  TotalTaxAmt = Add(TotalTaxAmt, Part.CSGST);
920
921
  } else {
@@ -945,9 +946,48 @@ export class ROTotalsService {
945
946
  }
946
947
  }
947
948
  });
948
- }
949
- return TotalTaxAmt;
950
- }
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
+ }
951
991
 
952
992
  static GetInsLaborCGSTTaxTotal(opCodesList: any, IsTaxable: boolean, isWorkOrder: boolean) {
953
993
  let TotalTaxAmt: any = 0;
@@ -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('invoicePrintData', invoicePrintData, 'options', options);
44
- if(options.PartInvoice && options.LaborInvoice){
45
- invoicePrintData.Round = TrUtils.FixedTo(invoiceData.Round);
46
- invoicePrintData.Total = TrUtils.FixedTo(invoiceData.Total);
47
- invoicePrintData.SubToal = TrUtils.FixedTo(invoiceData.SubToal);
48
- invoicePrintData.TaxTotal = TrUtils.FixedTo(invoiceData.TaxTotal);
43
+ // console.log('invoicePrintData', invoicePrintData, 'options', options);
44
+ if (options.PartInvoice && options.LaborInvoice) {
45
+ invoicePrintData.Round = TrUtils.FixedTo(invoiceData.Round);
46
+ invoicePrintData.Total = TrUtils.FixedTo(invoiceData.Total);
47
+ invoicePrintData.SubToal = TrUtils.FixedTo(invoiceData.SubToal);
48
+ invoicePrintData.TaxTotal = TrUtils.FixedTo(invoiceData.TaxTotal);
49
+ } else {
50
+ invoicePrintData.TaxTotal = TrUtils.FixedTo(Add(Number(invoiceData.CustPartITax), Number(invoiceData.CustLaborITax)));
49
51
  }
50
52
  delete invoicePrintData.SIndTotal;
51
53
  invPrint = CreateInvoicePDFService(invoicePrintData, printConfigData, numberofCopies);
@@ -106,7 +108,7 @@ export function GetDeliveryChallanPDF(deliveryChallanData: any, entityData: any,
106
108
  let dcPrint: any;
107
109
  if (options.ConsolidateGST) {
108
110
  dcPrint = DeliveryChallanPdfService.GetDeliveryChallanPrint(deliveryChallanData, numberofCopies, false);
109
- } else {
111
+ } else {
110
112
  dcPrintData.Round = TrUtils.FixedTo(deliveryChallanData.Round);
111
113
  dcPrintData.Total = TrUtils.FixedTo(deliveryChallanData.Total);
112
114
  dcPrintData.SubToal = TrUtils.FixedTo(deliveryChallanData.SubToal);
@@ -166,7 +168,7 @@ export function GetDebitNotePDF(debitNoteData: any, entityData: any, headerConfi
166
168
  true, false, taxCodes, false, true);
167
169
  let dnPrint: any;
168
170
  if (options.ConsolidateGST) {
169
- dnPrint = DebitNotePrintService.GetDebitNotePrintInfo(debitNotePrintData,entityData, image,true, true, taxCodes, false, true);
171
+ dnPrint = DebitNotePrintService.GetDebitNotePrintInfo(debitNotePrintData, entityData, image, true, true, taxCodes, false, true);
170
172
  } else {
171
173
  debitNotePrintData.Round = TrUtils.FixedTo(debitNoteData.Round);
172
174
  debitNotePrintData.Total = TrUtils.FixedTo(debitNoteData.Total);