shareneus 1.4.59 → 1.4.61

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,6 @@
1
1
  export declare class PosReceiptPrintService {
2
2
  static GetPrint(InvoicePDFData: any, size: string): any;
3
+ static CustomerInfo(InvoicePDFData: any): any;
3
4
  static GetBarCode(code: string, PrCustBar: boolean): {
4
5
  svg: any;
5
6
  } | {
@@ -74,11 +74,7 @@ class PosReceiptPrintService {
74
74
  // { text: 'Doctor : ' + InvoicePDFData.Name, style: ['headerstyle'] }],
75
75
  table: {
76
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
- ]
77
+ body: this.CustomerInfo(InvoicePDFData)
82
78
  }, layout: 'noBorders'
83
79
  }, this.GetBarCode(InvoicePDFData.Customer.Code, InvoicePDFData.Entity.PrCustBar),
84
80
  {
@@ -153,6 +149,16 @@ class PosReceiptPrintService {
153
149
  };
154
150
  return dd;
155
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
+ }
156
162
  static GetBarCode(code, PrCustBar) {
157
163
  if (PrCustBar) {
158
164
  return { svg: this.textToSvgBarcode(code).svg };
@@ -334,9 +334,11 @@ class InvPrintService {
334
334
  return InvoicePrintData;
335
335
  }
336
336
  static GetBillNameForInvoicePrint(argInvoiceData, InvoicePrintData) {
337
+ var _a;
337
338
  let Customer = {};
338
339
  if (!tr_utils_1.TrUtils.IsNull(argInvoiceData.BillTo)) {
339
340
  Customer.Name = argInvoiceData.BillTo.Name;
341
+ Customer.Code = (_a = argInvoiceData.Cust) === null || _a === void 0 ? void 0 : _a.Code;
340
342
  Customer.Adrs = [];
341
343
  Customer.Cons = [];
342
344
  if (!tr_utils_1.TrUtils.IsNull(argInvoiceData.BillTo.Adrs)) {
@@ -368,6 +370,7 @@ class InvPrintService {
368
370
  }
369
371
  else if (!tr_utils_1.TrUtils.IsNull(argInvoiceData.Cust)) {
370
372
  Customer.Name = argInvoiceData.Cust.Name;
373
+ Customer.Code = argInvoiceData.Cust.Code;
371
374
  Customer.Adrs = [];
372
375
  Customer.Cons = [];
373
376
  InvoicePrintData.Customer = Customer;
@@ -163,7 +163,7 @@ export declare class SharedPDFService {
163
163
  layout: string;
164
164
  };
165
165
  static GetDataTable(data: any, istotal: boolean): any;
166
- static GetCustomerAndVehicleDetails(Id: any, CrDate: any, PrDate: any, MOut: any, MIn: any, Vehicle: any, PrintType: any, For: any, SurName: any, SurPhone: any, Type: any, SurEmail: any, InsComp: any, PolNo: any, PolType: any, Customer: any, IsProforma: boolean, Settings: any, Location: any, isOtherIndustry: boolean, BL: any, ROCode: any, TypeName: any, AdmNo: any, DoS: any): {
166
+ static GetCustomerAndVehicleDetails(Id: any, CrDate: any, PrDate: any, MOut: any, MIn: any, Vehicle: any, PrintType: any, For: any, SurName: any, SurPhone: any, Type: any, SurEmail: any, InsComp: any, PolNo: any, PolType: any, Customer: any, IsProforma: boolean, Settings: any, Location: any, isOtherIndustry: boolean, BL: any, ROCode: any, TypeName: any, AdmNo: any, DoS: any, PrCustBar?: boolean): {
167
167
  style: string;
168
168
  marginLeft: number;
169
169
  columns: ({
@@ -262,7 +262,7 @@ export declare class SharedPDFService {
262
262
  width: number;
263
263
  marginLeft: number;
264
264
  };
265
- static GetInsurence(For: any, SurName: any, SurPhone: any, Type: any, SurEmail: any, InsComp: any, PolNo: any, PolType: any, Location: any, isOtherIndustry: boolean): {
265
+ static GetInsurence(For: any, SurName: any, SurPhone: any, Type: any, SurEmail: any, InsComp: any, PolNo: any, PolType: any, Location: any, isOtherIndustry: boolean, Code?: any, PrCustBar?: boolean): {
266
266
  stack: any[];
267
267
  width: number;
268
268
  marginRight: number;
@@ -273,6 +273,12 @@ export declare class SharedPDFService {
273
273
  stack?: undefined;
274
274
  marginRight?: undefined;
275
275
  };
276
+ static GetBarCode(code: string, PrCustBar: boolean): {
277
+ svg: any;
278
+ } | {
279
+ svg?: undefined;
280
+ };
281
+ static textToSvgBarcode(text: string): any;
276
282
  static GetVehicle(Type: any, Id: any, CrDate: any, PrDate: any, MOut: any, MIn: any, Vehicle: any, PrintType: any, For: any, IsProforma: boolean, Settings: any, isOtherIndustry: boolean, BL: any, ROCode: any, TypeName: any, AdmNo: any, DoS: any): {
277
283
  stack: {
278
284
  lineHeight: number;
@@ -1,6 +1,10 @@
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.SharedPDFService = void 0;
7
+ const jsbarcode_1 = __importDefault(require("jsbarcode"));
4
8
  const aggregation_1 = require("../aggregation/aggregation");
5
9
  const enums_1 = require("../enums/enums");
6
10
  const my_date_1 = require("../utils/my-date");
@@ -733,13 +737,13 @@ class SharedPDFService {
733
737
  });
734
738
  return body;
735
739
  }
736
- static GetCustomerAndVehicleDetails(Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, For, SurName, SurPhone, Type, SurEmail, InsComp, PolNo, PolType, Customer, IsProforma, Settings, Location, isOtherIndustry, BL, ROCode, TypeName, AdmNo, DoS) {
740
+ static GetCustomerAndVehicleDetails(Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, For, SurName, SurPhone, Type, SurEmail, InsComp, PolNo, PolType, Customer, IsProforma, Settings, Location, isOtherIndustry, BL, ROCode, TypeName, AdmNo, DoS, PrCustBar = false) {
737
741
  return {
738
742
  style: 'textcust',
739
743
  marginLeft: 5,
740
744
  columns: [
741
745
  this.GetCustomer(Customer, Type, For, Vehicle, Settings, 'Bill To', isOtherIndustry),
742
- this.GetInsurence(For, SurName, SurPhone, Type, SurEmail, InsComp, PolNo, PolType, Location, isOtherIndustry),
746
+ this.GetInsurence(For, SurName, SurPhone, Type, SurEmail, InsComp, PolNo, PolType, Location, isOtherIndustry, Customer.Code, PrCustBar),
743
747
  this.GetVehicle(Type, Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, For, IsProforma, Settings, isOtherIndustry, BL, ROCode, TypeName, AdmNo, DoS)
744
748
  ],
745
749
  };
@@ -822,14 +826,33 @@ class SharedPDFService {
822
826
  return { stack: [this.GetCustomerDetails(Customer, Type, Vehicle, Settings, Headding)], width: 230, marginLeft: 4 };
823
827
  }
824
828
  }
825
- static GetInsurence(For, SurName, SurPhone, Type, SurEmail, InsComp, PolNo, PolType, Location, isOtherIndustry) {
829
+ static GetInsurence(For, SurName, SurPhone, Type, SurEmail, InsComp, PolNo, PolType, Location, isOtherIndustry, Code = null, PrCustBar = false) {
826
830
  if (isOtherIndustry || ((For === enums_1.PayTypeEnum.Insurance) && Type !== 'Invoice')) {
827
831
  return { stack: [this.GetInsurenceDetails(For, SurName, SurPhone, SurEmail, InsComp, PolNo, PolType, Type, Location, isOtherIndustry)], width: 210, marginRight: 2 };
828
832
  }
833
+ else if (!tr_utils_1.TrUtils.IsNull(Code)) {
834
+ return { stack: [this.GetBarCode(Code, PrCustBar)], width: 210, marginRight: 2 };
835
+ }
829
836
  else {
830
837
  return { text: '', width: 70 };
831
838
  }
832
839
  }
840
+ static GetBarCode(code, PrCustBar) {
841
+ if (PrCustBar) {
842
+ return { svg: this.textToSvgBarcode(code).svg };
843
+ }
844
+ else {
845
+ return {};
846
+ }
847
+ }
848
+ static textToSvgBarcode(text) {
849
+ const svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
850
+ (0, jsbarcode_1.default)(svgElement, text, {
851
+ format: "CODE128", width: 1.25, height: 25, margin: 0, marginTop: 8,
852
+ displayValue: true, fontSize: 7, textMargin: 0, fontOptions: 'bold'
853
+ });
854
+ return { svg: svgElement.outerHTML };
855
+ }
833
856
  static GetVehicle(Type, Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, For, IsProforma, Settings, isOtherIndustry, BL, ROCode, TypeName, AdmNo, DoS) {
834
857
  if (For === enums_1.PayTypeEnum.Insurance) {
835
858
  return { stack: [this.GetVehicleDetails(Type, Id, CrDate, PrDate, MOut, MIn, Vehicle, PrintType, IsProforma, Settings, isOtherIndustry, BL, ROCode, TypeName, AdmNo, DoS)], width: 200 };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.4.59",
3
+ "version": "1.4.61",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",