shareneus 1.2.5 → 1.2.6

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.
@@ -206,6 +206,14 @@ class InvPrintService {
206
206
  else {
207
207
  Labor.UnPr = tr_utils_1.TrUtils.FixPriceValue(Labor.Pr);
208
208
  }
209
+ Labor.TaxName = this.getTaxName(Labor.TCode, TaxCodes);
210
+ if (!tr_utils_1.TrUtils.IsEmpty(Labor.Perc)) {
211
+ Labor.DiscPerc = Labor.Perc;
212
+ }
213
+ else {
214
+ Labor.DiscPerc = Labor.Perc;
215
+ Labor.DiscPerc = (0, aggregation_1.division)((0, aggregation_1.multiply)(100, Labor.Disc), Labor.UnPr);
216
+ }
209
217
  Labor.CGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor.CGST);
210
218
  Labor.SGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor.SGST);
211
219
  Labor.IGSTAmt = tr_utils_1.TrUtils.FixPriceValue(Labor.IGST);
@@ -15,17 +15,16 @@ class InvoicePortraitPrintService {
15
15
  info: {
16
16
  title: 'TAX INVOICE',
17
17
  },
18
+ background: function (currentPage, pageSize) {
19
+ return shared_pdf_service_1.SharedPDFService.GetWatermarkImage(InvoicePDFData.Image, pageSize, InvoicePDFData.Entity.Wmark);
20
+ },
18
21
  header: function (currentPage, pageCount, pageSize) {
19
22
  return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', marginRight: 25, fontSize: 8, marginTop: 2 };
20
23
  },
21
24
  pageMargins: this.GetMarginsBasedOnPaperSize(size),
22
25
  pageSize: 'A4',
23
26
  content: [
24
- { text: InvoicePDFData.Entity.CName, style: ['headerstyle'], alignment: 'center', fontSize: 15 },
25
- { text: this.GetAddress(InvoicePDFData.Entity), alignment: 'center', style: ['headerstyle'] },
26
- {
27
- columns: this.GetHeaderInfo(InvoicePDFData)
28
- },
27
+ this.GetMainHeaderInfo(InvoicePDFData),
29
28
  {
30
29
  style: 'tableExample',
31
30
  table: {
@@ -88,6 +87,34 @@ class InvoicePortraitPrintService {
88
87
  };
89
88
  return dd;
90
89
  }
90
+ static GetMainHeaderInfo(InvoicePDFData) {
91
+ if (!tr_utils_1.TrUtils.IsNull(InvoicePDFData.Image)) {
92
+ return {
93
+ columns: [{ image: InvoicePDFData.Image, width: 60, height: 60, marginBottom: 5 },
94
+ {
95
+ stack: [
96
+ { text: InvoicePDFData.Entity.CName, style: ['headerstyle'], alignment: 'left', fontSize: 15 },
97
+ { text: this.GetAddress(InvoicePDFData.Entity), alignment: 'left', style: ['headerstyle'] },
98
+ {
99
+ columns: this.GetHeaderInfo(InvoicePDFData, 0)
100
+ },
101
+ ]
102
+ }
103
+ ], columnGap: 10
104
+ };
105
+ }
106
+ else {
107
+ return {
108
+ stack: [
109
+ { text: InvoicePDFData.Entity.CName, style: ['headerstyle'], alignment: 'center', fontSize: 15 },
110
+ { text: this.GetAddress(InvoicePDFData.Entity), alignment: 'center', style: ['headerstyle'] },
111
+ {
112
+ columns: this.GetHeaderInfo(InvoicePDFData, 5)
113
+ },
114
+ ]
115
+ };
116
+ }
117
+ }
91
118
  static GetCustomerAndBankDetails(InvoicePDFData) {
92
119
  let CustDetails = [];
93
120
  CustDetails.push([{
@@ -217,10 +244,10 @@ class InvoicePortraitPrintService {
217
244
  },
218
245
  };
219
246
  }
220
- static GetHeaderInfo(InvoicePDFData) {
247
+ static GetHeaderInfo(InvoicePDFData, marginleft) {
221
248
  let TaxInfo = [];
222
249
  if (!tr_utils_1.TrUtils.IsEmpty(InvoicePDFData.Entity.GSTIN)) {
223
- TaxInfo.push({ text: 'GSTIN : ' + InvoicePDFData.Entity.GSTIN, marginTop: 2, marginLeft: 5, alignment: 'left', fontSize: 9, width: 'auto' });
250
+ TaxInfo.push({ text: 'GSTIN : ' + InvoicePDFData.Entity.GSTIN, marginTop: 2, marginLeft: marginleft, alignment: 'left', fontSize: 9, width: 'auto' });
224
251
  }
225
252
  if (!tr_utils_1.TrUtils.IsEmpty(InvoicePDFData.Entity.DLNo)) {
226
253
  TaxInfo.push({ text: 'D.L.NO : ' + InvoicePDFData.Entity.DLNo, marginTop: 2, marginLeft: 5, alignment: 'left', fontSize: 9, width: '*' });
@@ -436,7 +463,7 @@ class InvoicePortraitPrintService {
436
463
  body.push(dataRow);
437
464
  }
438
465
  Items.forEach((item, index) => {
439
- var _a, _b;
466
+ var _a, _b, _c;
440
467
  let dataRow = [];
441
468
  dataRow.push({ text: index + 1, });
442
469
  dataRow.push({ text: item.Desc, });
@@ -444,7 +471,7 @@ class InvoicePortraitPrintService {
444
471
  dataRow.push({ text: item.HSN, alignment: 'center', style: ['headerstyle'], });
445
472
  }
446
473
  dataRow.push({ text: (_a = item.Batch) === null || _a === void 0 ? void 0 : _a.BN, alignment: 'center', style: ['headerstyle'], });
447
- dataRow.push({ text: my_date_1.MyDate.ConvertUTCDateToReadableExDate(item['Batch'].ExDt), alignment: 'center', style: ['headerstyle'], });
474
+ dataRow.push({ text: my_date_1.MyDate.ConvertUTCDateToReadableExDate((_b = item['Batch']) === null || _b === void 0 ? void 0 : _b.ExDt), alignment: 'center', style: ['headerstyle'], });
448
475
  dataRow.push({ text: item.QtyAndUoM, alignment: 'right', style: ['headerstyle'], });
449
476
  dataRow.push({ text: item.OfQty, alignment: 'right', style: ['headerstyle'], });
450
477
  dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.MRP), alignment: 'right', style: ['headerstyle'], });
@@ -458,7 +485,7 @@ class InvoicePortraitPrintService {
458
485
  }
459
486
  }
460
487
  if (ShowTaxColumn && printOptions.ShowTax !== 'NO') {
461
- let Tax = (_b = item.TaxName) === null || _b === void 0 ? void 0 : _b.split('%');
488
+ let Tax = (_c = item.TaxName) === null || _c === void 0 ? void 0 : _c.split('%');
462
489
  dataRow.push({ text: tr_utils_1.TrUtils.IsNull(Tax) ? '' : Tax[0], alignment: 'right', style: ['headerstyle'], });
463
490
  }
464
491
  dataRow.push({ text: item.Ret ? '-' + tr_utils_1.TrUtils.FixPriceValue(item.LineTotal) : tr_utils_1.TrUtils.FixPriceValue(item.LineTotal), alignment: 'right', style: ['headerstyle'], });
@@ -131,6 +131,7 @@ class SharedPDFService {
131
131
  return Details;
132
132
  }
133
133
  static GetWatermarkImage(Image, pageSize, Wmark) {
134
+ console.log(Image, Wmark);
134
135
  if (!tr_utils_1.TrUtils.IsNull(Image) && Wmark) {
135
136
  return {
136
137
  margun: [10, 15, 10, 15],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.2.5",
3
+ "version": "1.2.6",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",