shareneus 1.4.58 → 1.4.59

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.
@@ -1,5 +1,11 @@
1
1
  export declare class PosReceiptPrintService {
2
2
  static GetPrint(InvoicePDFData: any, size: string): any;
3
+ static GetBarCode(code: string, PrCustBar: boolean): {
4
+ svg: any;
5
+ } | {
6
+ svg?: undefined;
7
+ };
8
+ static textToSvgBarcode(text: string): any;
3
9
  static HeaderLayOut(): {
4
10
  hLineWidth: (i: any, node: any) => 0 | 1;
5
11
  vLineWidth: (i: any, node: any) => 0 | 1;
@@ -1,8 +1,12 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.PosReceiptPrintService = void 0;
4
- const shared_pdf_service_1 = require("../../shared/shared-pdf.service");
5
7
  const tr_utils_1 = require("../../utils/tr-utils");
8
+ const shared_pdf_service_1 = require("../../shared/shared-pdf.service");
9
+ const jsbarcode_1 = __importDefault(require("jsbarcode"));
6
10
  class PosReceiptPrintService {
7
11
  static GetPrint(InvoicePDFData, size) {
8
12
  // console.log('InvoicePDFData', InvoicePDFData);
@@ -60,20 +64,38 @@ class PosReceiptPrintService {
60
64
  {
61
65
  style: 'tableExample',
62
66
  table: {
63
- widths: ['*', '*'],
67
+ widths: ['*', 'auto', '*'],
64
68
  body: [
65
69
  [{
66
70
  // marginTop: 4,
67
71
  marginLeft: 5,
68
- stack: [{ text: 'Name : ' + InvoicePDFData.Customer.Name, style: ['headerstyle'] },
69
- { text: 'Doctor : ' + InvoicePDFData.Name, style: ['headerstyle'] }]
70
- }, {
72
+ // stack: [{ text: 'UHID : ' + InvoicePDFData.Customer.Code, style: ['headerstyle'] },
73
+ // { text: 'Name : ' + InvoicePDFData.Customer.Name, style: ['headerstyle'] },
74
+ // { text: 'Doctor : ' + InvoicePDFData.Name, style: ['headerstyle'] }],
75
+ table: {
76
+ lineHeight: 0.5,
77
+ body: [
78
+ [{ text: 'UHID', style: ['headerstyle'] }, { text: ':', style: ['headerstyle'] }, { text: InvoicePDFData.Customer.Code, style: ['headerstyle'] }],
79
+ [{ text: 'Name', style: ['headerstyle'] }, { text: ':', style: ['headerstyle'] }, { text: InvoicePDFData.Customer.Name, style: ['headerstyle'] }],
80
+ [{ text: 'Doctor', style: ['headerstyle'] }, { text: ':', style: ['headerstyle'] }, { text: InvoicePDFData.Name, style: ['headerstyle'] }]
81
+ ]
82
+ }, layout: 'noBorders'
83
+ }, this.GetBarCode(InvoicePDFData.Customer.Code, InvoicePDFData.Entity.PrCustBar),
84
+ {
71
85
  // marginTop: 4,
72
86
  marginRight: 5,
73
- marginLeft: 130,
87
+ marginLeft: 70,
74
88
  // alignment: 'right',
75
- stack: [{ text: 'Bill No : ' + InvoicePDFData._id, style: ['headerstyle'] },
76
- { text: 'Date : ' + InvoicePDFData.CrDate, style: ['headerstyle'] }]
89
+ // stack: [{ text: 'Bill No : ' + InvoicePDFData._id, style: ['headerstyle'] },
90
+ // { text: 'Date : ' + InvoicePDFData.CrDate, style: ['headerstyle'] }]
91
+ table: {
92
+ lineHeight: 0.5,
93
+ body: [
94
+ [{ text: 'Bill No', style: ['headerstyle'] }, { text: ':', style: ['headerstyle'] }, { text: InvoicePDFData._id, style: ['headerstyle'] }],
95
+ [{ text: 'Date', style: ['headerstyle'] }, { text: ':', style: ['headerstyle'] }, { text: InvoicePDFData.CrDate, style: ['headerstyle'] }],
96
+ // [{text:'Doctor', style: ['headerstyle']}, {text:':', style: ['headerstyle']}, {text: InvoicePDFData.Name, style: ['headerstyle']}]
97
+ ]
98
+ }, layout: 'noBorders'
77
99
  }]
78
100
  ]
79
101
  },
@@ -131,6 +153,22 @@ class PosReceiptPrintService {
131
153
  };
132
154
  return dd;
133
155
  }
156
+ static GetBarCode(code, PrCustBar) {
157
+ if (PrCustBar) {
158
+ return { svg: this.textToSvgBarcode(code).svg };
159
+ }
160
+ else {
161
+ return {};
162
+ }
163
+ }
164
+ static textToSvgBarcode(text) {
165
+ const svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
166
+ (0, jsbarcode_1.default)(svgElement, text, {
167
+ format: "CODE128", width: 1.25, height: 25, margin: 0, marginTop: 8,
168
+ displayValue: true, fontSize: 7, textMargin: 0, fontOptions: 'bold'
169
+ });
170
+ return { svg: svgElement.outerHTML };
171
+ }
134
172
  static HeaderLayOut() {
135
173
  return {
136
174
  hLineWidth: function (i, node) {
@@ -309,6 +309,7 @@ class SaleReceiptPrintService {
309
309
  let Customer = {};
310
310
  if (!tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.BillTo)) {
311
311
  Customer.Name = OriginalInvoiceData.BillTo.Name;
312
+ Customer.Code = OriginalInvoiceData.BillTo.Code;
312
313
  Customer.Doctor = tr_utils_1.TrUtils.IsNull(OriginalInvoiceData.Name) ? '' : OriginalInvoiceData.Name;
313
314
  Customer.Adrs = [];
314
315
  Customer.Cons = [];
@@ -39,6 +39,7 @@ class PrintSharedService {
39
39
  Entity.Bank = Bank[0];
40
40
  Entity.PrBank = tempEntity.Settings.Acc.PrBnk;
41
41
  Entity.PrUPI = tempEntity.Settings.Acc.PrUPI;
42
+ Entity.PrCustBar = tempEntity.Settings.Acc.PrCustBar;
42
43
  Entity.UPI = tempEntity.Settings.Acc.UPI;
43
44
  Entity.UPIPhone = tempEntity.Settings.Acc.UPIPhone;
44
45
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.4.58",
3
+ "version": "1.4.59",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",