shareneus 1.7.8 → 1.7.10

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.
@@ -60,7 +60,6 @@ class RoprintService {
60
60
  }
61
61
  // Customer Only Print Method
62
62
  static GetCustomerPrint(ROPrintData, numberofCopies, isOtherIndustry) {
63
- console.log(ROPrintData, numberofCopies, isOtherIndustry);
64
63
  var contents = [];
65
64
  if (tr_utils_1.TrUtils.IsNull(numberofCopies) || numberofCopies.length === 0) {
66
65
  contents.push(this.CommonHeaderDetails(ROPrintData, null, isOtherIndustry), this.CustomersparePartsTable(ROPrintData), this.CommonTotalDetails(ROPrintData, null, numberofCopies));
@@ -1087,35 +1087,43 @@ class ROTotalsService {
1087
1087
  let TaxInfo = {};
1088
1088
  let TaxOnAmount = 0;
1089
1089
  let TaxAmount = 0;
1090
+ let CGSTAmt = 0;
1091
+ let SGSTAmt = 0;
1092
+ let IGSTAmt = 0;
1090
1093
  let HSN = MatchedPart[0].HSN;
1091
1094
  TaxInfo.CombinedTaxPercentage = MatchedPart[0].CombinedTaxPercentage;
1092
1095
  MatchedPart.forEach((argMatchedGSTPart) => {
1093
1096
  TaxOnAmount = (0, math_operations_1.Add)(TaxOnAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CustAfterPartDisc, DecimalsNumber));
1094
1097
  if (isWorkOrder) {
1095
- TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CCGST, DecimalsNumber));
1096
- TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CIGST, DecimalsNumber));
1097
- TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CSGST, DecimalsNumber));
1098
+ CGSTAmt = (0, math_operations_1.Add)(CGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CCGST, DecimalsNumber));
1099
+ IGSTAmt = (0, math_operations_1.Add)(IGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CIGST, DecimalsNumber));
1100
+ SGSTAmt = (0, math_operations_1.Add)(SGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CSGST, DecimalsNumber));
1098
1101
  }
1099
1102
  else {
1100
1103
  if (argMatchedGSTPart.Sts !== enums_1.LaborStatusEnum.New && argMatchedGSTPart.Sts !== enums_1.LaborStatusEnum.WtngForAppr) {
1101
- TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CCGST, DecimalsNumber));
1102
- TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CIGST, DecimalsNumber));
1103
- TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CSGST, DecimalsNumber));
1104
+ CGSTAmt = (0, math_operations_1.Add)(CGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CCGST, DecimalsNumber));
1105
+ IGSTAmt = (0, math_operations_1.Add)(IGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CIGST, DecimalsNumber));
1106
+ SGSTAmt = (0, math_operations_1.Add)(SGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CSGST, DecimalsNumber));
1104
1107
  }
1105
1108
  else {
1106
1109
  if (argMatchedGSTPart.PBy === enums_1.PayTypeEnum.Customer) {
1107
- TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.ECGST, DecimalsNumber));
1108
- TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.EIGST, DecimalsNumber));
1109
- TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.ESGST, DecimalsNumber));
1110
+ CGSTAmt = (0, math_operations_1.Add)(CGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.ECGST, DecimalsNumber));
1111
+ IGSTAmt = (0, math_operations_1.Add)(IGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.EIGST, DecimalsNumber));
1112
+ SGSTAmt = (0, math_operations_1.Add)(SGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.ESGST, DecimalsNumber));
1110
1113
  }
1111
1114
  }
1112
1115
  }
1113
1116
  });
1117
+ TaxAmount = (0, math_operations_1.Add)(CGSTAmt, SGSTAmt, IGSTAmt);
1114
1118
  TaxInfo.HSN = HSN;
1115
1119
  TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount, DecimalsNumber);
1120
+ TaxInfo.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(CGSTAmt, DecimalsNumber);
1121
+ TaxInfo.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(SGSTAmt, DecimalsNumber);
1122
+ TaxInfo.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(IGSTAmt, DecimalsNumber);
1116
1123
  TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount, DecimalsNumber);
1117
1124
  TaxInfo.PartsCount = MatchedPart.length;
1118
1125
  let GSTValues = this.GetGSTValueBasedOnTaxCode(MatchedPart[0], TaxCodes);
1126
+ console.log("GSTValues: ", GSTValues);
1119
1127
  TaxInfo.CGST = GSTValues[0];
1120
1128
  TaxInfo.SGST = GSTValues[1];
1121
1129
  TaxInfo.IGST = GSTValues[2];
@@ -1147,25 +1155,32 @@ class ROTotalsService {
1147
1155
  let TaxInfo = {};
1148
1156
  let TaxOnAmount = 0;
1149
1157
  let TaxAmount = 0;
1158
+ let CGSTAmt = 0;
1159
+ let SGSTAmt = 0;
1160
+ let IGSTAmt = 0;
1150
1161
  let HSN = MatchedPart[0].HSN;
1151
1162
  TaxInfo.CombinedTaxPercentage = MatchedPart[0].CombinedTaxPercentage;
1152
1163
  MatchedPart.forEach((argMatchedGSTPart) => {
1153
1164
  TaxOnAmount = (0, math_operations_1.Add)(TaxOnAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.InsAfterPartDisc, DecimalsNumber));
1154
1165
  if (argMatchedGSTPart.PBy === enums_1.PayTypeEnum.Insurance || argMatchedGSTPart.PBy === enums_1.PayTypeEnum.Shared) {
1155
1166
  if (argMatchedGSTPart.Sts !== enums_1.LaborStatusEnum.New && argMatchedGSTPart.Sts !== enums_1.LaborStatusEnum.WtngForAppr) {
1156
- TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.ACGST, DecimalsNumber));
1157
- TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.AIGST, DecimalsNumber));
1158
- TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.ASGST, DecimalsNumber));
1167
+ CGSTAmt = (0, math_operations_1.Add)(CGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.ACGST, DecimalsNumber));
1168
+ IGSTAmt = (0, math_operations_1.Add)(IGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.AIGST, DecimalsNumber));
1169
+ SGSTAmt = (0, math_operations_1.Add)(SGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.ASGST, DecimalsNumber));
1159
1170
  }
1160
1171
  else {
1161
- TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.ECGST, DecimalsNumber));
1162
- TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.EIGST, DecimalsNumber));
1163
- TaxAmount = (0, math_operations_1.Add)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.ESGST, DecimalsNumber));
1172
+ CGSTAmt = (0, math_operations_1.Add)(CGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.ECGST, DecimalsNumber));
1173
+ IGSTAmt = (0, math_operations_1.Add)(IGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.EIGST, DecimalsNumber));
1174
+ SGSTAmt = (0, math_operations_1.Add)(SGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.ESGST, DecimalsNumber));
1164
1175
  }
1165
1176
  }
1166
1177
  });
1178
+ TaxAmount = (0, math_operations_1.Add)(CGSTAmt, SGSTAmt, IGSTAmt);
1167
1179
  TaxInfo.HSN = HSN;
1168
1180
  TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount, DecimalsNumber);
1181
+ TaxInfo.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(CGSTAmt, DecimalsNumber);
1182
+ TaxInfo.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(SGSTAmt, DecimalsNumber);
1183
+ TaxInfo.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(IGSTAmt, DecimalsNumber);
1169
1184
  TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount, DecimalsNumber);
1170
1185
  TaxInfo.PartsCount = MatchedPart.length;
1171
1186
  let GSTValues = this.GetGSTValueBasedOnTaxCode(MatchedPart[0], TaxCodes);
@@ -42,10 +42,12 @@ function GetInvoicePDF(invoiceData, entityData, headerConfig, printConfig, taxCo
42
42
  invPrint = (0, unified_invoice_pdf_service_1.GetInvoicePrint)(invoicePrintData, numberofCopies, withPass, options.Size, options.MoreDiscDetails, options.Orientation);
43
43
  }
44
44
  else {
45
- invoicePrintData.Round = tr_utils_1.TrUtils.FixedTo(invoiceData.Round);
46
- invoicePrintData.Total = tr_utils_1.TrUtils.FixedTo(invoiceData.Total);
47
- invoicePrintData.SubToal = tr_utils_1.TrUtils.FixedTo(invoiceData.SubToal);
48
- invoicePrintData.TaxTotal = tr_utils_1.TrUtils.FixedTo(invoiceData.TaxTotal);
45
+ if (options.PartInvoice && options.LaborInvoice) {
46
+ invoicePrintData.Round = tr_utils_1.TrUtils.FixedTo(invoiceData.Round);
47
+ invoicePrintData.Total = tr_utils_1.TrUtils.FixedTo(invoiceData.Total);
48
+ invoicePrintData.SubToal = tr_utils_1.TrUtils.FixedTo(invoiceData.SubToal);
49
+ invoicePrintData.TaxTotal = tr_utils_1.TrUtils.FixedTo(invoiceData.TaxTotal);
50
+ }
49
51
  delete invoicePrintData.SIndTotal;
50
52
  invPrint = (0, invoice_pdf_service_1.CreateInvoicePDFService)(invoicePrintData, printConfigData, numberofCopies);
51
53
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.7.08",
3
+ "version": "1.7.10",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -87,7 +87,6 @@ export class RoprintService {
87
87
 
88
88
  // Customer Only Print Method
89
89
  static GetCustomerPrint(ROPrintData: any, numberofCopies: any, isOtherIndustry: boolean) {
90
- console.log(ROPrintData,numberofCopies,isOtherIndustry);
91
90
  var contents = [];
92
91
  if (TrUtils.IsNull(numberofCopies) || numberofCopies.length === 0) {
93
92
  contents.push(
@@ -1115,33 +1115,41 @@ export class ROTotalsService {
1115
1115
  let TaxInfo: any = {};
1116
1116
  let TaxOnAmount: any = 0;
1117
1117
  let TaxAmount: any = 0;
1118
+ let CGSTAmt: any = 0;
1119
+ let SGSTAmt: any = 0;
1120
+ let IGSTAmt: any = 0;
1118
1121
  let HSN: any = MatchedPart[0].HSN;
1119
1122
  TaxInfo.CombinedTaxPercentage = MatchedPart[0].CombinedTaxPercentage;
1120
1123
  MatchedPart.forEach((argMatchedGSTPart: any) => {
1121
1124
  TaxOnAmount = Add(TaxOnAmount, TrUtils.FixedTo(argMatchedGSTPart.CustAfterPartDisc, DecimalsNumber));
1122
1125
  if (isWorkOrder) {
1123
- TaxAmount = Add(TaxAmount, TrUtils.FixedTo(argMatchedGSTPart.CCGST, DecimalsNumber));
1124
- TaxAmount = Add(TaxAmount, TrUtils.FixedTo(argMatchedGSTPart.CIGST, DecimalsNumber));
1125
- TaxAmount = Add(TaxAmount, TrUtils.FixedTo(argMatchedGSTPart.CSGST, DecimalsNumber));
1126
+ CGSTAmt = Add(CGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.CCGST, DecimalsNumber));
1127
+ IGSTAmt = Add(IGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.CIGST, DecimalsNumber));
1128
+ SGSTAmt = Add(SGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.CSGST, DecimalsNumber));
1126
1129
  } else {
1127
1130
  if (argMatchedGSTPart.Sts !== LaborStatusEnum.New && argMatchedGSTPart.Sts !== LaborStatusEnum.WtngForAppr) {
1128
- TaxAmount = Add(TaxAmount, TrUtils.FixedTo(argMatchedGSTPart.CCGST, DecimalsNumber));
1129
- TaxAmount = Add(TaxAmount, TrUtils.FixedTo(argMatchedGSTPart.CIGST, DecimalsNumber));
1130
- TaxAmount = Add(TaxAmount, TrUtils.FixedTo(argMatchedGSTPart.CSGST, DecimalsNumber));
1131
+ CGSTAmt = Add(CGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.CCGST, DecimalsNumber));
1132
+ IGSTAmt = Add(IGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.CIGST, DecimalsNumber));
1133
+ SGSTAmt = Add(SGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.CSGST, DecimalsNumber));
1131
1134
  } else {
1132
1135
  if (argMatchedGSTPart.PBy === PayTypeEnum.Customer) {
1133
- TaxAmount = Add(TaxAmount, TrUtils.FixedTo(argMatchedGSTPart.ECGST, DecimalsNumber));
1134
- TaxAmount = Add(TaxAmount, TrUtils.FixedTo(argMatchedGSTPart.EIGST, DecimalsNumber));
1135
- TaxAmount = Add(TaxAmount, TrUtils.FixedTo(argMatchedGSTPart.ESGST, DecimalsNumber));
1136
+ CGSTAmt = Add(CGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.ECGST, DecimalsNumber));
1137
+ IGSTAmt = Add(IGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.EIGST, DecimalsNumber));
1138
+ SGSTAmt = Add(SGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.ESGST, DecimalsNumber));
1136
1139
  }
1137
1140
  }
1138
1141
  }
1139
1142
  });
1143
+ TaxAmount = Add(CGSTAmt, SGSTAmt, IGSTAmt);
1140
1144
  TaxInfo.HSN = HSN;
1141
1145
  TaxInfo.TotalTaxableAmount = TrUtils.FixPriceValue(TaxOnAmount, DecimalsNumber);
1146
+ TaxInfo.CGSTAmt = TrUtils.FixPriceValue(CGSTAmt, DecimalsNumber);
1147
+ TaxInfo.SGSTAmt = TrUtils.FixPriceValue(SGSTAmt, DecimalsNumber);
1148
+ TaxInfo.IGSTAmt = TrUtils.FixPriceValue(IGSTAmt, DecimalsNumber);
1142
1149
  TaxInfo.TotalTaxAmount = TrUtils.FixPriceValue(TaxAmount, DecimalsNumber);
1143
1150
  TaxInfo.PartsCount = MatchedPart.length;
1144
1151
  let GSTValues: any[] = this.GetGSTValueBasedOnTaxCode(MatchedPart[0], TaxCodes);
1152
+ console.log("GSTValues: ", GSTValues);
1145
1153
  TaxInfo.CGST = GSTValues[0];
1146
1154
  TaxInfo.SGST = GSTValues[1];
1147
1155
  TaxInfo.IGST = GSTValues[2];
@@ -1179,24 +1187,31 @@ export class ROTotalsService {
1179
1187
  let TaxInfo: any = {};
1180
1188
  let TaxOnAmount: any = 0;
1181
1189
  let TaxAmount: any = 0;
1190
+ let CGSTAmt: any = 0;
1191
+ let SGSTAmt: any = 0;
1192
+ let IGSTAmt: any = 0;
1182
1193
  let HSN: any = MatchedPart[0].HSN;
1183
1194
  TaxInfo.CombinedTaxPercentage = MatchedPart[0].CombinedTaxPercentage;
1184
1195
  MatchedPart.forEach((argMatchedGSTPart: any) => {
1185
1196
  TaxOnAmount = Add(TaxOnAmount, TrUtils.FixedTo(argMatchedGSTPart.InsAfterPartDisc, DecimalsNumber));
1186
1197
  if (argMatchedGSTPart.PBy === PayTypeEnum.Insurance || argMatchedGSTPart.PBy === PayTypeEnum.Shared) {
1187
1198
  if (argMatchedGSTPart.Sts !== LaborStatusEnum.New && argMatchedGSTPart.Sts !== LaborStatusEnum.WtngForAppr) {
1188
- TaxAmount = Add(TaxAmount, TrUtils.FixedTo(argMatchedGSTPart.ACGST, DecimalsNumber));
1189
- TaxAmount = Add(TaxAmount, TrUtils.FixedTo(argMatchedGSTPart.AIGST, DecimalsNumber));
1190
- TaxAmount = Add(TaxAmount, TrUtils.FixedTo(argMatchedGSTPart.ASGST, DecimalsNumber));
1199
+ CGSTAmt = Add(CGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.ACGST, DecimalsNumber));
1200
+ IGSTAmt = Add(IGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.AIGST, DecimalsNumber));
1201
+ SGSTAmt = Add(SGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.ASGST, DecimalsNumber));
1191
1202
  } else {
1192
- TaxAmount = Add(TaxAmount, TrUtils.FixedTo(argMatchedGSTPart.ECGST, DecimalsNumber));
1193
- TaxAmount = Add(TaxAmount, TrUtils.FixedTo(argMatchedGSTPart.EIGST, DecimalsNumber));
1194
- TaxAmount = Add(TaxAmount, TrUtils.FixedTo(argMatchedGSTPart.ESGST, DecimalsNumber));
1203
+ CGSTAmt = Add(CGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.ECGST, DecimalsNumber));
1204
+ IGSTAmt = Add(IGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.EIGST, DecimalsNumber));
1205
+ SGSTAmt = Add(SGSTAmt, TrUtils.FixedTo(argMatchedGSTPart.ESGST, DecimalsNumber));
1195
1206
  }
1196
1207
  }
1197
1208
  });
1209
+ TaxAmount = Add(CGSTAmt, SGSTAmt, IGSTAmt);
1198
1210
  TaxInfo.HSN = HSN;
1199
1211
  TaxInfo.TotalTaxableAmount = TrUtils.FixPriceValue(TaxOnAmount, DecimalsNumber);
1212
+ TaxInfo.CGSTAmt = TrUtils.FixPriceValue(CGSTAmt, DecimalsNumber);
1213
+ TaxInfo.SGSTAmt = TrUtils.FixPriceValue(SGSTAmt, DecimalsNumber);
1214
+ TaxInfo.IGSTAmt = TrUtils.FixPriceValue(IGSTAmt, DecimalsNumber);
1200
1215
  TaxInfo.TotalTaxAmount = TrUtils.FixPriceValue(TaxAmount, DecimalsNumber);
1201
1216
  TaxInfo.PartsCount = MatchedPart.length;
1202
1217
  let GSTValues: any[] = this.GetGSTValueBasedOnTaxCode(MatchedPart[0], TaxCodes);
@@ -39,10 +39,12 @@ export function GetInvoicePDF(invoiceData: any, entityData: any, headerConfig: a
39
39
  if (options.ConsolidateGST) {
40
40
  invPrint = GetInvoicePrint(invoicePrintData, numberofCopies, withPass, options.Size, options.MoreDiscDetails, options.Orientation);
41
41
  } else {
42
+ if(options.PartInvoice && options.LaborInvoice){
42
43
  invoicePrintData.Round = TrUtils.FixedTo(invoiceData.Round);
43
44
  invoicePrintData.Total = TrUtils.FixedTo(invoiceData.Total);
44
45
  invoicePrintData.SubToal = TrUtils.FixedTo(invoiceData.SubToal);
45
46
  invoicePrintData.TaxTotal = TrUtils.FixedTo(invoiceData.TaxTotal);
47
+ }
46
48
  delete invoicePrintData.SIndTotal;
47
49
  invPrint = CreateInvoicePDFService(invoicePrintData, printConfigData, numberofCopies);
48
50
  }