shareneus 1.2.2 → 1.2.4

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.
@@ -34,7 +34,7 @@ class InvoicePortraitPrintService {
34
34
  },
35
35
  layout: this.HeaderLayOut()
36
36
  },
37
- this.GetItemsTable(InvoicePDFData.Items, InvoicePDFData.ShowTaxColumn, InvoicePDFData.Settings.PoS.SType, printOptions, size),
37
+ this.GetItemsTable(InvoicePDFData.Ops, InvoicePDFData.Items, InvoicePDFData.ShowTaxColumn, InvoicePDFData.Settings.PoS.SType, printOptions, size),
38
38
  [this.TotalDetails(InvoicePDFData)],
39
39
  {
40
40
  style: 'tableExample',
@@ -315,7 +315,7 @@ class InvoicePortraitPrintService {
315
315
  text: ['Customer Signature'], marginLeft: 90
316
316
  };
317
317
  }
318
- static GetItemsTable(Items, ShowTaxColumn, SType, printOptions, size) {
318
+ static GetItemsTable(Services, Items, ShowTaxColumn, SType, printOptions, size) {
319
319
  return {
320
320
  style: 'tableExample',
321
321
  marginTop: 3,
@@ -323,7 +323,7 @@ class InvoicePortraitPrintService {
323
323
  table: {
324
324
  widths: this.GetWidths(ShowTaxColumn, printOptions),
325
325
  headerRows: 1,
326
- body: this.BuildTableBodyForLaborAndParts(Items, ShowTaxColumn, SType, printOptions, size)
326
+ body: this.BuildTableBodyForLaborAndParts(Services, Items, ShowTaxColumn, SType, printOptions, size)
327
327
  },
328
328
  layout: {
329
329
  hLineWidth: function (i, node) {
@@ -362,49 +362,120 @@ class InvoicePortraitPrintService {
362
362
  static GetAddress(Entity) {
363
363
  return Entity.Adrs1 + ', ' + Entity.Adrs2 + ', ' + Entity.City + '-' + Entity.PIN + ', Cell : ' + Entity.Phone;
364
364
  }
365
- static BuildTableBodyForLaborAndParts(Items, ShowTaxColumn, SType, printOptions, size) {
365
+ static BuildTableBodyForLaborAndParts(Services, Items, ShowTaxColumn, SType, printOptions, size) {
366
366
  let body = this.GetHeaderNames(ShowTaxColumn, SType, printOptions);
367
367
  let j = 1;
368
- Items.forEach((item, index) => {
369
- var _a, _b;
370
- let dataRow = [];
371
- dataRow.push({ text: index + 1, });
372
- dataRow.push({ text: item.Desc, });
373
- if (ShowTaxColumn) {
374
- dataRow.push({ text: item.HSN, alignment: 'center', style: ['headerstyle'], });
375
- }
376
- dataRow.push({ text: (_a = item.Batch) === null || _a === void 0 ? void 0 : _a.BN, alignment: 'center', style: ['headerstyle'], });
377
- dataRow.push({ text: my_date_1.MyDate.ConvertUTCDateToReadableExDate(item['Batch'].ExDt), alignment: 'center', style: ['headerstyle'], });
378
- dataRow.push({ text: item.QtyAndUoM, alignment: 'right', style: ['headerstyle'], });
379
- dataRow.push({ text: item.OfQty, alignment: 'right', style: ['headerstyle'], });
380
- dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.MRP), alignment: 'right', style: ['headerstyle'], });
381
- dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.UnPr), alignment: 'right', style: ['headerstyle'], });
382
- if (printOptions.Disc !== 'NO') {
383
- if (printOptions.Disc === 'PERC') {
384
- dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.DiscPerc), alignment: 'right', style: ['headerstyle'], });
368
+ if (!tr_utils_1.TrUtils.IsNull(Services) && Services.length !== 0) {
369
+ Services.forEach((item, index) => {
370
+ var _a;
371
+ let dataRow = [];
372
+ dataRow.push({ text: index + 1, });
373
+ dataRow.push({ text: item.Desc, });
374
+ if (ShowTaxColumn) {
375
+ dataRow.push({ text: item.SAC, alignment: 'center', style: ['headerstyle'], });
385
376
  }
386
- else {
387
- dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.Disc), alignment: 'right', style: ['headerstyle'], });
377
+ dataRow.push({ text: '', alignment: 'center', style: ['headerstyle'], });
378
+ dataRow.push({ text: '', alignment: 'center', style: ['headerstyle'], });
379
+ dataRow.push({ text: item.Qty, alignment: 'right', style: ['headerstyle'], });
380
+ dataRow.push({ text: '', alignment: 'right', style: ['headerstyle'], });
381
+ dataRow.push({ text: '', alignment: 'right', style: ['headerstyle'], });
382
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.Pr), alignment: 'right', style: ['headerstyle'], });
383
+ if (printOptions.Disc !== 'NO') {
384
+ if (printOptions.Disc === 'PERC') {
385
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.DiscPerc), alignment: 'right', style: ['headerstyle'], });
386
+ }
387
+ else {
388
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.Disc), alignment: 'right', style: ['headerstyle'], });
389
+ }
388
390
  }
389
- }
390
- if (ShowTaxColumn && printOptions.ShowTax !== 'NO') {
391
- let Tax = (_b = item.TaxName) === null || _b === void 0 ? void 0 : _b.split('%');
392
- dataRow.push({ text: tr_utils_1.TrUtils.IsNull(Tax) ? '' : Tax[0], alignment: 'right', style: ['headerstyle'], });
393
- }
394
- dataRow.push({ text: item.Ret ? '-' + tr_utils_1.TrUtils.FixPriceValue(item.LineTotal) : tr_utils_1.TrUtils.FixPriceValue(item.LineTotal), alignment: 'right', style: ['headerstyle'], });
395
- body.push(dataRow);
396
- if (index + 1 === j * 9) {
397
- j++;
398
- if (size === 'diff') {
399
- let dataRow1 = [{ text: '', pageBreak: 'after' }, '', '', '', '', ''];
400
- if (ShowTaxColumn) {
401
- dataRow1.push('');
402
- dataRow1.push('');
391
+ if (ShowTaxColumn && printOptions.ShowTax !== 'NO') {
392
+ let Tax = (_a = item.TaxName) === null || _a === void 0 ? void 0 : _a.split('%');
393
+ dataRow.push({ text: tr_utils_1.TrUtils.IsNull(Tax) ? '' : Tax[0], alignment: 'right', style: ['headerstyle'], });
394
+ }
395
+ dataRow.push({ text: item.Ret ? '-' + tr_utils_1.TrUtils.FixPriceValue(item.LineTotal) : tr_utils_1.TrUtils.FixPriceValue(item.LineTotal), alignment: 'right', style: ['headerstyle'], });
396
+ body.push(dataRow);
397
+ if (index + 1 === j * 9) {
398
+ j++;
399
+ if (size === 'diff') {
400
+ let dataRow1 = [{ text: '', pageBreak: 'after' }, '', '', '', '', ''];
401
+ if (ShowTaxColumn) {
402
+ dataRow1.push('');
403
+ dataRow1.push('');
404
+ }
405
+ body.push(dataRow1);
403
406
  }
404
- body.push(dataRow1);
405
407
  }
408
+ });
409
+ }
410
+ if (!tr_utils_1.TrUtils.IsNull(Items) && Items.length !== 0) {
411
+ if (!tr_utils_1.TrUtils.IsNull(Services) && Services.length !== 0) {
412
+ let dataRow = [];
413
+ dataRow.push({ text: '', });
414
+ dataRow.push({ text: '', });
415
+ if (ShowTaxColumn) {
416
+ dataRow.push({ text: '', alignment: 'center', style: ['headerstyle'], });
417
+ }
418
+ dataRow.push({ text: '', alignment: 'center', style: ['headerstyle'], });
419
+ dataRow.push({ text: '', alignment: 'center', style: ['headerstyle'], });
420
+ dataRow.push({ text: '', alignment: 'right', style: ['headerstyle'], });
421
+ dataRow.push({ text: '', alignment: 'right', style: ['headerstyle'], });
422
+ dataRow.push({ text: '', alignment: 'right', style: ['headerstyle'], });
423
+ dataRow.push({ text: '', alignment: 'right', style: ['headerstyle'], });
424
+ if (printOptions.Disc !== 'NO') {
425
+ if (printOptions.Disc === 'PERC') {
426
+ dataRow.push({ text: '', alignment: 'right', style: ['headerstyle'], });
427
+ }
428
+ else {
429
+ dataRow.push({ text: '', alignment: 'right', style: ['headerstyle'], });
430
+ }
431
+ }
432
+ if (ShowTaxColumn && printOptions.ShowTax !== 'NO') {
433
+ dataRow.push({ text: '', alignment: 'right', style: ['headerstyle'], });
434
+ }
435
+ dataRow.push({ text: '', alignment: 'right', style: ['headerstyle'], });
436
+ body.push(dataRow);
406
437
  }
407
- });
438
+ Items.forEach((item, index) => {
439
+ var _a, _b;
440
+ let dataRow = [];
441
+ dataRow.push({ text: index + 1, });
442
+ dataRow.push({ text: item.Desc, });
443
+ if (ShowTaxColumn) {
444
+ dataRow.push({ text: item.HSN, alignment: 'center', style: ['headerstyle'], });
445
+ }
446
+ 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'], });
448
+ dataRow.push({ text: item.QtyAndUoM, alignment: 'right', style: ['headerstyle'], });
449
+ dataRow.push({ text: item.OfQty, alignment: 'right', style: ['headerstyle'], });
450
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.MRP), alignment: 'right', style: ['headerstyle'], });
451
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.UnPr), alignment: 'right', style: ['headerstyle'], });
452
+ if (printOptions.Disc !== 'NO') {
453
+ if (printOptions.Disc === 'PERC') {
454
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.DiscPerc), alignment: 'right', style: ['headerstyle'], });
455
+ }
456
+ else {
457
+ dataRow.push({ text: tr_utils_1.TrUtils.FixPriceValue(item.Disc), alignment: 'right', style: ['headerstyle'], });
458
+ }
459
+ }
460
+ if (ShowTaxColumn && printOptions.ShowTax !== 'NO') {
461
+ let Tax = (_b = item.TaxName) === null || _b === void 0 ? void 0 : _b.split('%');
462
+ dataRow.push({ text: tr_utils_1.TrUtils.IsNull(Tax) ? '' : Tax[0], alignment: 'right', style: ['headerstyle'], });
463
+ }
464
+ dataRow.push({ text: item.Ret ? '-' + tr_utils_1.TrUtils.FixPriceValue(item.LineTotal) : tr_utils_1.TrUtils.FixPriceValue(item.LineTotal), alignment: 'right', style: ['headerstyle'], });
465
+ body.push(dataRow);
466
+ if (index + 1 === j * 9) {
467
+ j++;
468
+ if (size === 'diff') {
469
+ let dataRow1 = [{ text: '', pageBreak: 'after' }, '', '', '', '', ''];
470
+ if (ShowTaxColumn) {
471
+ dataRow1.push('');
472
+ dataRow1.push('');
473
+ }
474
+ body.push(dataRow1);
475
+ }
476
+ }
477
+ });
478
+ }
408
479
  return body;
409
480
  }
410
481
  static GetHeaderNames(ShowTaxColumn, SType, printOptions) {
@@ -412,7 +483,7 @@ class InvoicePortraitPrintService {
412
483
  if (ShowTaxColumn) {
413
484
  HeadingNames = [[{ text: 'S.No', style: 'tableheader1', Field: 'SNo', alignment: 'left', fontSize: 7 },
414
485
  { text: 'Item Name', style: 'tableheader1', Field: 'Desc', alignment: 'left', line: true },
415
- { text: 'HSN', style: 'tableheader1', Field: 'HSN' },
486
+ { text: 'HSN/SAC', style: 'tableheader1', Field: 'HSN' },
416
487
  { text: 'Batch No.', style: 'tableheader1', Field: 'Batches' },
417
488
  { text: 'Ex.Dt', style: 'tableheader1', Field: 'ExDate' },
418
489
  { text: 'Qty', style: 'tableheader1', Field: 'Qty', alignment: 'right' },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",