shareneus 1.4.58 → 1.4.60
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,12 @@
|
|
|
1
1
|
export declare class PosReceiptPrintService {
|
|
2
2
|
static GetPrint(InvoicePDFData: any, size: string): any;
|
|
3
|
+
static CustomerInfo(InvoicePDFData: any): any;
|
|
4
|
+
static GetBarCode(code: string, PrCustBar: boolean): {
|
|
5
|
+
svg: any;
|
|
6
|
+
} | {
|
|
7
|
+
svg?: undefined;
|
|
8
|
+
};
|
|
9
|
+
static textToSvgBarcode(text: string): any;
|
|
3
10
|
static HeaderLayOut(): {
|
|
4
11
|
hLineWidth: (i: any, node: any) => 0 | 1;
|
|
5
12
|
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,34 @@ 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: '
|
|
69
|
-
|
|
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: this.CustomerInfo(InvoicePDFData)
|
|
78
|
+
}, layout: 'noBorders'
|
|
79
|
+
}, this.GetBarCode(InvoicePDFData.Customer.Code, InvoicePDFData.Entity.PrCustBar),
|
|
80
|
+
{
|
|
71
81
|
// marginTop: 4,
|
|
72
82
|
marginRight: 5,
|
|
73
|
-
marginLeft:
|
|
83
|
+
marginLeft: 70,
|
|
74
84
|
// alignment: 'right',
|
|
75
|
-
stack: [{ text: 'Bill No : ' + InvoicePDFData._id, style: ['headerstyle'] },
|
|
76
|
-
|
|
85
|
+
// stack: [{ text: 'Bill No : ' + InvoicePDFData._id, style: ['headerstyle'] },
|
|
86
|
+
// { text: 'Date : ' + InvoicePDFData.CrDate, style: ['headerstyle'] }]
|
|
87
|
+
table: {
|
|
88
|
+
lineHeight: 0.5,
|
|
89
|
+
body: [
|
|
90
|
+
[{ text: 'Bill No', style: ['headerstyle'] }, { text: ':', style: ['headerstyle'] }, { text: InvoicePDFData._id, style: ['headerstyle'] }],
|
|
91
|
+
[{ text: 'Date', style: ['headerstyle'] }, { text: ':', style: ['headerstyle'] }, { text: InvoicePDFData.CrDate, style: ['headerstyle'] }],
|
|
92
|
+
// [{text:'Doctor', style: ['headerstyle']}, {text:':', style: ['headerstyle']}, {text: InvoicePDFData.Name, style: ['headerstyle']}]
|
|
93
|
+
]
|
|
94
|
+
}, layout: 'noBorders'
|
|
77
95
|
}]
|
|
78
96
|
]
|
|
79
97
|
},
|
|
@@ -131,6 +149,32 @@ class PosReceiptPrintService {
|
|
|
131
149
|
};
|
|
132
150
|
return dd;
|
|
133
151
|
}
|
|
152
|
+
static CustomerInfo(InvoicePDFData) {
|
|
153
|
+
let CustomerTable = [
|
|
154
|
+
[{ text: 'Name', style: ['headerstyle'] }, { text: ':', style: ['headerstyle'] }, { text: InvoicePDFData.Customer.Name, style: ['headerstyle'] }],
|
|
155
|
+
[{ text: 'Doctor', style: ['headerstyle'] }, { text: ':', style: ['headerstyle'] }, { text: InvoicePDFData.Name, style: ['headerstyle'] }]
|
|
156
|
+
];
|
|
157
|
+
if (InvoicePDFData.Customer.Code) {
|
|
158
|
+
CustomerTable.unshift([{ text: 'UHID', style: ['headerstyle'] }, { text: ':', style: ['headerstyle'] }, { text: InvoicePDFData.Customer.Code, style: ['headerstyle'] }]);
|
|
159
|
+
}
|
|
160
|
+
return CustomerTable;
|
|
161
|
+
}
|
|
162
|
+
static GetBarCode(code, PrCustBar) {
|
|
163
|
+
if (PrCustBar) {
|
|
164
|
+
return { svg: this.textToSvgBarcode(code).svg };
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
return {};
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
static textToSvgBarcode(text) {
|
|
171
|
+
const svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
172
|
+
(0, jsbarcode_1.default)(svgElement, text, {
|
|
173
|
+
format: "CODE128", width: 1.25, height: 25, margin: 0, marginTop: 8,
|
|
174
|
+
displayValue: true, fontSize: 7, textMargin: 0, fontOptions: 'bold'
|
|
175
|
+
});
|
|
176
|
+
return { svg: svgElement.outerHTML };
|
|
177
|
+
}
|
|
134
178
|
static HeaderLayOut() {
|
|
135
179
|
return {
|
|
136
180
|
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
|
}
|