shareneus 1.1.8 → 1.2.0

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.
@@ -676,7 +676,7 @@ class InvoiceprintService {
676
676
  return headersNames;
677
677
  }
678
678
  static CommonTotalDetails(ROPrintData, index, numberofCopies, withPass, isAuto) {
679
- console.log('ROPrintData', ROPrintData);
679
+ // console.log('ROPrintData', ROPrintData);
680
680
  let CommonDetails = [
681
681
  // SharedPDFService.GetFinalTotalDetails(ROPrintData.CustLaborTotalAfterDisc, ROPrintData.CustLaborDiscTotal, ROPrintData.CustLaborCGST,
682
682
  // ROPrintData.CustLaborSGST, ROPrintData.CustLaborIGST, ROPrintData.CustPartIGST, ROPrintData.ShowIGST, ROPrintData.ShowTaxColumn,
@@ -53,9 +53,7 @@ class InvPrintService {
53
53
  }
54
54
  InvoicePrintData.Consolidate = ConsolidateGST;
55
55
  InvoicePrintData.ShowDiscountColumn = false;
56
- console.log(ForInsurance, ConsolidateGST);
57
56
  if (!ForInsurance && !ConsolidateGST) {
58
- console.log(shared_print_service_1.PrintSharedService.CheckItemIndexWithDisc(InvoicePrintData));
59
57
  if (shared_print_service_1.PrintSharedService.CheckItemIndexWithDisc(InvoicePrintData) !== -1) {
60
58
  // InvoicePrintData.ShowDiscountColumn = (InvoicePrintData.Settings.DiscLvl === 'ITM' || InvoicePrintData.Settings.DiscLvl === 'RECITM') ? true : false;
61
59
  InvoicePrintData.ShowDiscountColumn = true;
@@ -156,7 +156,7 @@ class InvoiceLandscapePdfService {
156
156
  ];
157
157
  }
158
158
  static PreparesparePartsTable(ROPrintData) {
159
- console.log('ROPrintData', ROPrintData);
159
+ // console.log('ROPrintData', ROPrintData);
160
160
  let List = [];
161
161
  if (ROPrintData.Entity.Body === 1) {
162
162
  for (let i = 0; i < ROPrintData.PrintInfo.length; i++) {
@@ -4,6 +4,7 @@ exports.InvoicePortraitPrintService = void 0;
4
4
  const enums_1 = require("../enums/enums");
5
5
  const my_date_1 = require("../utils/my-date");
6
6
  const tr_utils_1 = require("../utils/tr-utils");
7
+ const shared_pdf_service_1 = require("./shared-pdf.service");
7
8
  class InvoicePortraitPrintService {
8
9
  static GetPrint(InvoicePDFData, size, printOptions) {
9
10
  // console.log('InvoicePDFData', InvoicePDFData);
@@ -35,7 +36,7 @@ class InvoicePortraitPrintService {
35
36
  },
36
37
  this.GetItemsTable(InvoicePDFData.Items, InvoicePDFData.ShowTaxColumn, InvoicePDFData.Settings.PoS.SType, printOptions, size),
37
38
  [this.TotalDetails(InvoicePDFData)],
38
- this.GetSignatures(InvoicePDFData.Entity.CName, InvoicePDFData.Type, InvoicePDFData.For),
39
+ this.GetSignatures(InvoicePDFData.Entity.CName, InvoicePDFData.CustRoundedTotal),
39
40
  ],
40
41
  styles: {
41
42
  headerstyle: {
@@ -276,11 +277,11 @@ class InvoicePortraitPrintService {
276
277
  ]
277
278
  };
278
279
  }
279
- static GetSignatures(CName, For, Type) {
280
+ static GetSignatures(CName, Total) {
280
281
  return {
281
282
  columns: [{
282
283
  stack: [
283
- { columns: ['', '', this.CompanyName(CName)] }
284
+ { columns: [this.GetNumberInWords(Total), '', this.CompanyName(CName)] }
284
285
  ]
285
286
  }],
286
287
  };
@@ -330,7 +331,7 @@ class InvoicePortraitPrintService {
330
331
  };
331
332
  }
332
333
  static GetWidths(ShowTaxColumn, printOptions) {
333
- if (ShowTaxColumn && printOptions.Tax !== 'NO') {
334
+ if (ShowTaxColumn && printOptions.ShowTax !== 'NO') {
334
335
  if (printOptions.Disc === 'NO') {
335
336
  return [16, '*', 40, 45, 25, 20, 20, 45, 45, 30, 50];
336
337
  }
@@ -375,7 +376,7 @@ class InvoicePortraitPrintService {
375
376
  dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.Disc), alignment: 'right', style: ['headerstyle'], });
376
377
  }
377
378
  }
378
- if (ShowTaxColumn && printOptions.Tax !== 'NO') {
379
+ if (ShowTaxColumn && printOptions.ShowTax !== 'NO') {
379
380
  let Tax = (_b = item.TaxName) === null || _b === void 0 ? void 0 : _b.split('%');
380
381
  dataRow.push({ text: tr_utils_1.TrUtils.IsNull(Tax) ? '' : Tax[0], alignment: 'right', style: ['headerstyle'], });
381
382
  }
@@ -411,7 +412,7 @@ class InvoicePortraitPrintService {
411
412
  if (printOptions.Disc !== 'NO') {
412
413
  HeadingNames[0].splice(9, 0, { text: (printOptions.Disc === 'PERC') ? 'Disc(%)' : 'Disc(Rs)', style: 'tableheader1', Field: 'Disc' });
413
414
  }
414
- if (printOptions.Tax !== 'NO') {
415
+ if (printOptions.ShowTax !== 'NO') {
415
416
  HeadingNames[0].splice(10, 0, { text: (SType === 'Intra') ? 'GST(%)' : 'IGST(%)', style: 'tableheader1', Field: 'TaxAmount', alignment: 'right' });
416
417
  }
417
418
  }
@@ -607,6 +608,11 @@ class InvoicePortraitPrintService {
607
608
  return [{}];
608
609
  }
609
610
  }
611
+ static GetNumberInWords(TotalAmount) {
612
+ var rupee = shared_pdf_service_1.SharedPDFService.convertNumberToWords(TotalAmount);
613
+ // console.log('rupee', rupee);
614
+ return { columns: [{ text: 'In Words :', fontSize: 8, width: 45 }, { text: rupee, bold: true, fontSize: 8, width: '*' }] };
615
+ }
610
616
  static HeaderLineStyle() {
611
617
  return {
612
618
  hLineWidth: function (i, node) {
@@ -370,6 +370,11 @@ class PrintSharedService {
370
370
  }
371
371
  });
372
372
  }
373
+ else if (!tr_utils_1.TrUtils.IsNull(PrintInfo.Items)) {
374
+ PartDiscItem = PrintInfo.Items.findIndex((Item) => {
375
+ return !tr_utils_1.TrUtils.IsZero(Item.Disc);
376
+ });
377
+ }
373
378
  if (LaborDiscItem !== -1 || PartDiscItem !== -1) {
374
379
  return PrintInfo;
375
380
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.1.8",
3
+ "version": "1.2.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",