shareneus 1.2.9 → 1.3.1

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.
@@ -12,9 +12,7 @@ class InvoiceLetterheadPdfService {
12
12
  static GetInvoiceLetterheadPrint(ROPrintData, numberofCopies, isotherIndustry, withPass, isAuto, LetterHead) {
13
13
  var contents = [];
14
14
  if (tr_utils_1.TrUtils.IsNull(numberofCopies) || numberofCopies.length === 0) {
15
- contents.push(
16
- // this.CommonHeaderDetails(ROPrintData, null, isotherIndustry),
17
- this.PreparesparePartsTable(ROPrintData, isAuto), this.CommonTotalDetails(ROPrintData, null, numberofCopies, withPass, isAuto));
15
+ contents.push(this.CommonHeaderDetails(ROPrintData, null, isotherIndustry), this.PreparesparePartsTable(ROPrintData, isAuto), this.CommonTotalDetails(ROPrintData, null, numberofCopies, withPass, isAuto));
18
16
  }
19
17
  else {
20
18
  numberofCopies.forEach((text, index) => {
@@ -58,7 +56,7 @@ class InvoiceLetterheadPdfService {
58
56
  }
59
57
  static CommonHeaderDetails(ROPrintData, text, isotherIndustry) {
60
58
  return [
61
- // this.GetMainHeaderDetails(ROPrintData.Entity, ROPrintData.HeaderName, ROPrintData.Image, ROPrintData.HColor, ROPrintData.AColor, text),
59
+ this.GetMainHeaderDetails(ROPrintData.Entity, ROPrintData.HeaderName, ROPrintData.Image, ROPrintData.HColor, ROPrintData.AColor, text),
62
60
  shared_pdf_service_1.SharedPDFService.GetCustomerAndVehicleDetails(ROPrintData._id, ROPrintData.CrDate, ROPrintData.PrDate, ROPrintData.MOut, ROPrintData.MIn, ROPrintData.Product, ROPrintData.PrintType, ROPrintData.For, ROPrintData.SurName, ROPrintData.SurPhone, ROPrintData.Type, ROPrintData.SurEmail, ROPrintData.InsComp, ROPrintData.PolNo, ROPrintData.PolType, ROPrintData.Customer, ROPrintData.IsProforma, ROPrintData.Settings, ROPrintData.Location, isotherIndustry, ROPrintData.BL, ROPrintData.ROCode, ROPrintData.TypeName, ROPrintData.AdmNo),
63
61
  shared_pdf_service_1.SharedPDFService.GetOwnerDetails(ROPrintData.Cust, ROPrintData.Type, ROPrintData.For),
64
62
  shared_pdf_service_1.SharedPDFService.CustomerAndVehicleDetailsAfterLine(),
@@ -68,7 +66,7 @@ class InvoiceLetterheadPdfService {
68
66
  static GetMainHeaderDetails(Entity, HeaderName, Image, HColor, AColor, text) {
69
67
  return [
70
68
  // SharedPDFService.MainHeading(Entity.CName, Entity.Header, Image, HColor, text),
71
- shared_pdf_service_1.SharedPDFService.GetMainHeader(Entity, Image, AColor, HColor, text),
69
+ // SharedPDFService.GetMainHeader(Entity, Image, AColor, HColor, text),
72
70
  shared_pdf_service_1.SharedPDFService.GetPrintType(HeaderName),
73
71
  shared_pdf_service_1.SharedPDFService.HeaderAfterLine()
74
72
  ];
@@ -16,6 +16,9 @@ class InvoicePortraitPrintService {
16
16
  title: 'TAX INVOICE',
17
17
  },
18
18
  background: function (currentPage, pageSize) {
19
+ if (size !== 'full') {
20
+ pageSize.height = pageSize.height - 435.945;
21
+ }
19
22
  return shared_pdf_service_1.SharedPDFService.GetWatermarkImage(InvoicePDFData.Image, pageSize, InvoicePDFData.Entity.Wmark);
20
23
  },
21
24
  header: function (currentPage, pageCount, pageSize) {
@@ -93,12 +96,13 @@ class InvoicePortraitPrintService {
93
96
  columns: [{ image: InvoicePDFData.Image, width: 60, height: 60, marginBottom: 5 },
94
97
  {
95
98
  stack: [
96
- { text: InvoicePDFData.Entity.CName, style: ['headerstyle'], alignment: 'left', fontSize: 15 },
97
- { text: this.GetAddress(InvoicePDFData.Entity), alignment: 'left', style: ['headerstyle'] },
99
+ { text: InvoicePDFData.Entity.CName, style: ['headerstyle'], alignment: 'center', fontSize: 15 },
100
+ { text: this.GetAddress(InvoicePDFData.Entity), alignment: 'center', style: ['headerstyle'] },
98
101
  {
99
102
  columns: this.GetHeaderInfo(InvoicePDFData, 0)
100
103
  },
101
- ]
104
+ { text: InvoicePDFData.HeaderName, alignment: 'center', style: ['Receiptheader1'], marginTop: 5 }
105
+ ], marginLeft: -80
102
106
  }
103
107
  ], columnGap: 10
104
108
  };
@@ -111,6 +115,7 @@ class InvoicePortraitPrintService {
111
115
  {
112
116
  columns: this.GetHeaderInfo(InvoicePDFData, 5)
113
117
  },
118
+ { text: InvoicePDFData.HeaderName, alignment: 'center', style: ['Receiptheader1'] }
114
119
  ]
115
120
  };
116
121
  }
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PosReceiptPrintService = void 0;
4
4
  const tr_utils_1 = require("../utils/tr-utils");
5
+ const shared_pdf_service_1 = require("./shared-pdf.service");
5
6
  class PosReceiptPrintService {
6
7
  static GetPrint(InvoicePDFData, size) {
7
8
  // console.log('InvoicePDFData', InvoicePDFData);
@@ -15,6 +16,12 @@ class PosReceiptPrintService {
15
16
  info: {
16
17
  title: 'CounterSale',
17
18
  },
19
+ background: function (currentPage, pageSize) {
20
+ if (size !== 'full') {
21
+ pageSize.height = pageSize.height - 435.945;
22
+ }
23
+ return shared_pdf_service_1.SharedPDFService.GetWatermarkImage(InvoicePDFData.Image, pageSize, InvoicePDFData.Entity.Wmark);
24
+ },
18
25
  header: function (currentPage, pageCount, pageSize) {
19
26
  return { text: currentPage.toString() + ' of ' + pageCount, alignment: 'right', marginRight: 25, fontSize: 8, marginTop: 2 };
20
27
  },
@@ -26,11 +33,12 @@ class PosReceiptPrintService {
26
33
  // },
27
34
  // pageOrientation: 'portrait',
28
35
  content: [
29
- { text: InvoicePDFData.Entity.CName, style: ['headerstyle'], alignment: 'center', fontSize: 20 },
30
- { text: this.GetAddress(InvoicePDFData.Entity), alignment: 'center', style: ['headerstyle'] },
31
- {
32
- columns: this.GetHeaderInfo(InvoicePDFData)
33
- },
36
+ this.GetMainHeaderInfo(InvoicePDFData),
37
+ // { text: InvoicePDFData.Entity.CName, style: ['headerstyle'], alignment: 'center', fontSize: 20 },
38
+ // { text: this.GetAddress(InvoicePDFData.Entity), alignment: 'center', style: ['headerstyle'] },
39
+ // {
40
+ // columns: this.GetHeaderInfo(InvoicePDFData)
41
+ // },
34
42
  // this.CustomerAndVehicleDetailsAfterLine(size),
35
43
  // {
36
44
  // columns: [{
@@ -142,21 +150,64 @@ class PosReceiptPrintService {
142
150
  },
143
151
  };
144
152
  }
145
- static GetHeaderInfo(InvoicePDFData) {
153
+ static GetMainHeaderInfo(InvoicePDFData) {
154
+ if (!tr_utils_1.TrUtils.IsNull(InvoicePDFData.Image)) {
155
+ return {
156
+ columns: [{ image: InvoicePDFData.Image, width: 60, height: 60, marginBottom: 5 },
157
+ {
158
+ stack: [
159
+ { text: InvoicePDFData.Entity.CName, style: ['headerstyle'], alignment: 'center', fontSize: 15 },
160
+ { text: this.GetAddress(InvoicePDFData.Entity), alignment: 'center', style: ['headerstyle'] },
161
+ {
162
+ columns: this.GetHeaderInfo(InvoicePDFData, 0)
163
+ },
164
+ { text: InvoicePDFData.HeaderName, alignment: 'center', style: ['Receiptheader1'], marginTop: 5 }
165
+ ], marginLeft: -80
166
+ }
167
+ ], columnGap: 10
168
+ };
169
+ }
170
+ else {
171
+ return {
172
+ stack: [
173
+ { text: InvoicePDFData.Entity.CName, style: ['headerstyle'], alignment: 'center', fontSize: 15 },
174
+ { text: this.GetAddress(InvoicePDFData.Entity), alignment: 'center', style: ['headerstyle'] },
175
+ {
176
+ columns: this.GetHeaderInfo(InvoicePDFData, 5)
177
+ },
178
+ { text: InvoicePDFData.HeaderName, alignment: 'center', style: ['Receiptheader1'] }
179
+ ]
180
+ };
181
+ }
182
+ }
183
+ static GetHeaderInfo(InvoicePDFData, marginleft) {
146
184
  let TaxInfo = [];
147
185
  if (!tr_utils_1.TrUtils.IsEmpty(InvoicePDFData.Entity.GSTIN)) {
148
- TaxInfo.push({ text: 'GSTIN : ' + InvoicePDFData.Entity.GSTIN, marginTop: 2, marginLeft: 5, alignment: 'left', fontSize: 9, width: 'auto' });
186
+ TaxInfo.push({ text: 'GSTIN : ' + InvoicePDFData.Entity.GSTIN, marginTop: 2, marginLeft: marginleft, alignment: 'left', fontSize: 9, width: 'auto' });
149
187
  }
150
- // if (!TrUtils.IsEmpty(InvoicePDFData.Entity.PAN)) {
151
- // TaxInfo.push({ text: 'PAN : ' + InvoicePDFData.Entity.PAN, marginTop: 2, marginLeft: 5, alignment: 'left', fontSize: 9, width: 'auto' },
152
- // );
153
- // }
154
188
  if (!tr_utils_1.TrUtils.IsEmpty(InvoicePDFData.Entity.DLNo)) {
155
189
  TaxInfo.push({ text: 'D.L.NO : ' + InvoicePDFData.Entity.DLNo, marginTop: 2, marginLeft: 5, alignment: 'left', fontSize: 9, width: '*' });
156
190
  }
157
191
  TaxInfo.push(this.GetBillofSupplyName(InvoicePDFData.Settings));
158
192
  return TaxInfo;
159
193
  }
194
+ // static GetHeaderInfo(InvoicePDFData: any) {
195
+ // let TaxInfo: any = [];
196
+ // if (!TrUtils.IsEmpty(InvoicePDFData.Entity.GSTIN)) {
197
+ // TaxInfo.push({ text: 'GSTIN : ' + InvoicePDFData.Entity.GSTIN, marginTop: 2, marginLeft: 5, alignment: 'left', fontSize: 9, width: 'auto' },
198
+ // );
199
+ // }
200
+ // // if (!TrUtils.IsEmpty(InvoicePDFData.Entity.PAN)) {
201
+ // // TaxInfo.push({ text: 'PAN : ' + InvoicePDFData.Entity.PAN, marginTop: 2, marginLeft: 5, alignment: 'left', fontSize: 9, width: 'auto' },
202
+ // // );
203
+ // // }
204
+ // if (!TrUtils.IsEmpty(InvoicePDFData.Entity.DLNo)) {
205
+ // TaxInfo.push({ text: 'D.L.NO : ' + InvoicePDFData.Entity.DLNo, marginTop: 2, marginLeft: 5, alignment: 'left', fontSize: 9, width: '*' },
206
+ // );
207
+ // }
208
+ // TaxInfo.push(this.GetBillofSupplyName(InvoicePDFData.Settings));
209
+ // return TaxInfo;
210
+ // }
160
211
  static finalReturnTotal(InvoicePDFData) {
161
212
  // if (!TrUtils.IsFixedZero(InvoicePDFData.CustRetRoundedTotal)) {
162
213
  // return 'Returns Total : ' + InvoicePDFData.CustRetRoundedTotal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.2.9",
3
+ "version": "1.3.1",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",