shareneus 1.7.346 → 1.7.347

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.
@@ -66,6 +66,15 @@ class CNPrintService {
66
66
  }
67
67
  static GetItemsPrintInfo(Items, Consolidate, TaxCodes, LineTotal, DecimalsNumber) {
68
68
  Items.forEach((Item) => {
69
+ const LinkCodes = Array.isArray(Item === null || Item === void 0 ? void 0 : Item.Link)
70
+ ? Item.Link
71
+ .map((Link) => Link === null || Link === void 0 ? void 0 : Link.Code)
72
+ .filter((Code) => !tr_utils_1.TrUtils.IsEmpty(Code))
73
+ .join(', ')
74
+ : '';
75
+ if (!tr_utils_1.TrUtils.IsEmpty(LinkCodes)) {
76
+ Item.Desc = Item.Desc + ' (' + LinkCodes + ')';
77
+ }
69
78
  Item.TCode = this.GetTCodeFromTaxes(Item);
70
79
  const cgstAmount = this.GetTaxAmountFromTaxes(Item, 'CGST', Item.CGST);
71
80
  const sgstAmount = this.GetTaxAmountFromTaxes(Item, 'SGST', Item.SGST);
@@ -165,6 +165,15 @@ class DebitNotePrintService {
165
165
  }
166
166
  static GetItemsPrintInfo(Items, Consolidate, TaxCodes, LineTotal, DecimalsNumber) {
167
167
  Items.forEach((Item) => {
168
+ const LinkCodes = Array.isArray(Item === null || Item === void 0 ? void 0 : Item.Link)
169
+ ? Item.Link
170
+ .map((Link) => Link === null || Link === void 0 ? void 0 : Link.Code)
171
+ .filter((Code) => !tr_utils_1.TrUtils.IsEmpty(Code))
172
+ .join(', ')
173
+ : '';
174
+ if (!tr_utils_1.TrUtils.IsEmpty(LinkCodes)) {
175
+ Item.Desc = Item.Desc + ' (' + LinkCodes + ')';
176
+ }
168
177
  if (Consolidate) {
169
178
  let AfterDiscForEach = (0, math_operations_1.Divide)(Item.AfterPartDisc, Item.Qty);
170
179
  let CTaxAmtPerItem = (0, math_operations_1.Divide)(this.GetTaxAmountFromTaxes(Item, 'CGST'), Item.Qty);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.7.346",
3
+ "version": "1.7.347",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -11,7 +11,7 @@ export class CNPrintService {
11
11
 
12
12
  static GetCreditNotePrintInfo(OriginalInvoiceData: any, OriginalEntityData: any, image: any,
13
13
  IncludeGST: boolean, ConsolidateGST: boolean, TaxCodes: any, IsProforma: boolean) {
14
-
14
+
15
15
  let ForInsurance: boolean = !TrUtils.IsNull(OriginalInvoiceData.BillTo.InsId);
16
16
  let InvoicePrintData: any = {};
17
17
  let argInvoiceData = TrUtils.Stringify(OriginalInvoiceData);
@@ -38,7 +38,7 @@ export class CNPrintService {
38
38
  }
39
39
  InvoicePrintData = TrUtils.ConcatObjects(InvoicePrintData, finalTotalsData);
40
40
  InvoicePrintData.Items = this.GetItemsPrintInfo(InvoicePrintData.Items, ConsolidateGST, TaxCodes,
41
- OriginalEntityData.Entity.Settings?.Acc?.LTot, InvoicePrintData.Entity.DecimalsNumber);
41
+ OriginalEntityData.Entity.Settings?.Acc?.LTot, InvoicePrintData.Entity.DecimalsNumber);
42
42
  argInvoiceData = this.ReverseItemsForInvoicePrint(argInvoiceData);
43
43
  InvoicePrintData.PrintInfo = this.PrepareFormatForInvoicePrint(InvoicePrintData, ROTypeEnum.Invoice, argInvoiceData.Sts);
44
44
  InvoicePrintData = this.GetFormattedProductDataForPrint(argInvoiceData, InvoicePrintData);
@@ -79,6 +79,15 @@ export class CNPrintService {
79
79
 
80
80
  static GetItemsPrintInfo(Items: any, Consolidate: boolean, TaxCodes: any, LineTotal: string, DecimalsNumber: number) {
81
81
  Items.forEach((Item: any) => {
82
+ const LinkCodes = Array.isArray(Item?.Link)
83
+ ? Item.Link
84
+ .map((Link: any) => Link?.Code)
85
+ .filter((Code: any) => !TrUtils.IsEmpty(Code))
86
+ .join(', ')
87
+ : '';
88
+ if (!TrUtils.IsEmpty(LinkCodes)) {
89
+ Item.Desc = Item.Desc + ' (' + LinkCodes + ')';
90
+ }
82
91
  Item.TCode = this.GetTCodeFromTaxes(Item);
83
92
  const cgstAmount = this.GetTaxAmountFromTaxes(Item, 'CGST', Item.CGST);
84
93
  const sgstAmount = this.GetTaxAmountFromTaxes(Item, 'SGST', Item.SGST);
@@ -90,7 +99,7 @@ export class CNPrintService {
90
99
  let STaxAmtPerItem = Divide(sgstAmount, Item.Qty);
91
100
  let ITaxAmtPerItem = Divide(igstAmount, Item.Qty);
92
101
  Item.UnPr = TrUtils.FixedTo(Add(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
93
- }else{
102
+ } else {
94
103
  Item.UnPr = TrUtils.FixPriceValue(Item.UnPr, DecimalsNumber);
95
104
  }
96
105
  Item.CGSTAmt = TrUtils.FixPriceValue(cgstAmount, DecimalsNumber);
@@ -200,12 +200,21 @@ export class DebitNotePrintService {
200
200
  return InvoicePrintData;
201
201
  }
202
202
 
203
- static GetItemsPrintInfo(Items: any, Consolidate: boolean, TaxCodes: any, LineTotal: string, DecimalsNumber: number) {
204
- Items.forEach((Item: any) => {
205
- if (Consolidate) {
206
- let AfterDiscForEach = Divide(Item.AfterPartDisc, Item.Qty);
207
- let CTaxAmtPerItem = Divide(this.GetTaxAmountFromTaxes(Item, 'CGST'), Item.Qty);
208
- let STaxAmtPerItem = Divide(this.GetTaxAmountFromTaxes(Item, 'SGST'), Item.Qty);
203
+ static GetItemsPrintInfo(Items: any, Consolidate: boolean, TaxCodes: any, LineTotal: string, DecimalsNumber: number) {
204
+ Items.forEach((Item: any) => {
205
+ const LinkCodes = Array.isArray(Item?.Link)
206
+ ? Item.Link
207
+ .map((Link: any) => Link?.Code)
208
+ .filter((Code: any) => !TrUtils.IsEmpty(Code))
209
+ .join(', ')
210
+ : '';
211
+ if (!TrUtils.IsEmpty(LinkCodes)) {
212
+ Item.Desc = Item.Desc + ' (' + LinkCodes + ')';
213
+ }
214
+ if (Consolidate) {
215
+ let AfterDiscForEach = Divide(Item.AfterPartDisc, Item.Qty);
216
+ let CTaxAmtPerItem = Divide(this.GetTaxAmountFromTaxes(Item, 'CGST'), Item.Qty);
217
+ let STaxAmtPerItem = Divide(this.GetTaxAmountFromTaxes(Item, 'SGST'), Item.Qty);
209
218
  let ITaxAmtPerItem = Divide(this.GetTaxAmountFromTaxes(Item, 'IGST'), Item.Qty);
210
219
  Item.UnPr = TrUtils.FixedTo(Add(AfterDiscForEach, CTaxAmtPerItem, STaxAmtPerItem, ITaxAmtPerItem), DecimalsNumber);
211
220
  } else {