shareneus 1.4.86 → 1.4.87

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.
@@ -262,6 +262,12 @@ class InvoiceTotalsService {
262
262
  return finalTotalsData;
263
263
  }
264
264
  static groupTaxData(items, ops) {
265
+ if (tr_utils_1.TrUtils.IsNull(items)) {
266
+ items = [];
267
+ }
268
+ if (tr_utils_1.TrUtils.IsNull(ops)) {
269
+ ops = [];
270
+ }
265
271
  const combined = [...items, ...ops];
266
272
  const groupedMap = new Map();
267
273
  combined.forEach(item => {
@@ -25,5 +25,5 @@ export declare class PurchaseOrderTotalsService {
25
25
  static GetTaxGroupingForPartsByHSN(Items: any, TaxCodes: any, DecimalsNumber: number): any[];
26
26
  static GetCombinedTaxPercentage(Items: any, TaxCodes: any): any;
27
27
  static ComparePartsByHSN(Items: any, TaxCodes: any): any[];
28
- static GetTaxGroupingInfoByHSN(FinalMatchedParts: any, TaxCodes: any, DecimalsNumber: number): any[];
28
+ static GetTaxGroupingInfoByHSN(FinalMatchedParts: any, TaxCodes: any, DecimalsNumber: any): any[];
29
29
  }
@@ -260,6 +260,12 @@ class PurchaseOrderTotalsService {
260
260
  return finalTotalsData;
261
261
  }
262
262
  static groupTaxData(items, ops) {
263
+ if (tr_utils_1.TrUtils.IsNull(items)) {
264
+ items = [];
265
+ }
266
+ if (tr_utils_1.TrUtils.IsNull(ops)) {
267
+ ops = [];
268
+ }
263
269
  const combined = [...items, ...ops];
264
270
  const groupedMap = new Map();
265
271
  combined.forEach(item => {
@@ -474,21 +480,31 @@ class PurchaseOrderTotalsService {
474
480
  let TaxInfo = {};
475
481
  let TaxOnAmount = 0;
476
482
  let TaxAmount = 0;
483
+ let CGSTAmt = 0;
484
+ let SGSTAmt = 0;
485
+ let IGSTAmt = 0;
477
486
  let HSN = MatchedPart[0].HSN;
478
487
  TaxInfo.CombinedTaxPercentage = MatchedPart[0].CombinedTaxPercentage;
479
488
  MatchedPart.forEach((argMatchedGSTPart) => {
480
- TaxOnAmount = (0, aggregation_1.addition)(TaxOnAmount, argMatchedGSTPart.AfterDiscountPrice);
481
- TaxAmount = (0, aggregation_1.addition)(TaxAmount, argMatchedGSTPart.CGST);
482
- TaxAmount = (0, aggregation_1.addition)(TaxAmount, argMatchedGSTPart.IGST);
483
- TaxAmount = (0, aggregation_1.addition)(TaxAmount, argMatchedGSTPart.SGST);
489
+ TaxOnAmount = (0, aggregation_1.addition)(TaxOnAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.AfterDiscountPrice, DecimalsNumber));
490
+ TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CGST, DecimalsNumber));
491
+ TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.IGST, DecimalsNumber));
492
+ TaxAmount = (0, aggregation_1.addition)(TaxAmount, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.SGST, DecimalsNumber));
493
+ CGSTAmt = (0, aggregation_1.addition)(CGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.CGST, DecimalsNumber));
494
+ SGSTAmt = (0, aggregation_1.addition)(SGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.SGST, DecimalsNumber));
495
+ IGSTAmt = (0, aggregation_1.addition)(IGSTAmt, tr_utils_1.TrUtils.FixedTo(argMatchedGSTPart.IGST, DecimalsNumber));
484
496
  });
485
497
  TaxInfo.HSN = HSN;
498
+ TaxInfo.CGSTAmt = CGSTAmt;
499
+ TaxInfo.SGSTAmt = SGSTAmt;
500
+ TaxInfo.IGSTAmt = IGSTAmt;
486
501
  TaxInfo.TotalTaxableAmount = tr_utils_1.TrUtils.FixPriceValue(TaxOnAmount, DecimalsNumber);
487
502
  TaxInfo.TotalTaxAmount = tr_utils_1.TrUtils.FixPriceValue(TaxAmount, DecimalsNumber);
488
- TaxInfo.PartsCount = MatchedPart.length;
489
- // let CGST = this.GetCGSTValueBasedOnTaxCode(MatchedPart[0].TCode, TaxCodes);
490
- // let SGST = this.GetSGSTValueBasedOnTaxCode(MatchedPart[0].TCode, TaxCodes);
491
- // let IGST = this.GetIGSTValueBasedOnTaxCode(MatchedPart[0].TCode, TaxCodes);
503
+ TaxInfo.ItemsCount = MatchedPart.length;
504
+ // let GSTValues: any[] = this.GetGSTValueBasedOnTaxCode(MatchedPart[0].TCode, TaxCodes);
505
+ // TaxInfo.CGST = GSTValues[0];
506
+ // TaxInfo.SGST = GSTValues[1];
507
+ // TaxInfo.IGST = GSTValues[2];
492
508
  TaxInfo.CGST = MatchedPart[0].CGSTAmt;
493
509
  TaxInfo.IGST = MatchedPart[0].IGSTAmt;
494
510
  TaxInfo.SGST = MatchedPart[0].SGSTAmt;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.4.86",
3
+ "version": "1.4.87",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",