shareneus 1.5.51 → 1.5.53

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.
@@ -226,7 +226,7 @@ export declare class InvoiceLetterheadPdfService {
226
226
  } | {
227
227
  text: any;
228
228
  alignment: string;
229
- width?: undefined;
229
+ width: string;
230
230
  })[];
231
231
  style: string;
232
232
  } | {
@@ -55,7 +55,7 @@ export declare class SharedPDFService {
55
55
  } | {
56
56
  text: any;
57
57
  alignment: string;
58
- width?: undefined;
58
+ width: string;
59
59
  })[];
60
60
  style: string;
61
61
  };
@@ -192,42 +192,38 @@ class SharedPDFService {
192
192
  return Details;
193
193
  }
194
194
  static GetAddresDetailsAndLogo(Entity, Image, AColor, HColor, text, orientation = 'portrait') {
195
- const headerWidth = orientation === 'landscape' ? 400 : 300;
196
- const emptyWidth = orientation === 'landscape' ? 200 : 150;
197
- const noImageEmptyWidth = orientation === 'landscape' ? 170 : 130;
198
- let Details = [
195
+ const logoWidth = 120;
196
+ const logoHeight = 80;
197
+ const headerStyle = this.GetMainHeaderStyleForLeftAlignHeader(Entity.CName || '');
198
+ const extras = [];
199
+ if (!tr_utils_1.TrUtils.IsNull(Entity.PageCount)) {
200
+ extras.push({ text: 'Page: ' + Entity.PageCount, color: 'grey', alignment: 'center', fontSize: this.TermsandCond, margin: [0, 1, 0, 0] });
201
+ }
202
+ if (!tr_utils_1.TrUtils.IsEmpty(Entity.Extra1)) {
203
+ extras.push({ text: Entity.Extra1, color: 'grey', alignment: 'center', fontSize: this.TermsandCond, margin: [0, 1, 0, 0] });
204
+ }
205
+ if (!tr_utils_1.TrUtils.IsEmpty(Entity.Extra2)) {
206
+ extras.push({ text: Entity.Extra2, color: 'grey', alignment: 'center', fontSize: this.TermsandCond, margin: [0, 1, 0, 0] });
207
+ }
208
+ const centerStack = [
209
+ { text: '' + (Entity.CName || '') + '', color: HColor, fontSize: headerStyle.fontSize, bold: true, alignment: 'center' },
199
210
  {
200
- stack: [
201
- { columns: [this.MainHeading(Entity.CName, Entity, Image, HColor, text)] },
202
- {
203
- columns: [{
204
- width: headerWidth,
205
- margin: [0, 0, 0, 5],
206
- stack: this.GetHeader(Entity, HColor),
207
- color: AColor,
208
- style: 'header'
209
- },
210
- this.emptyObject()]
211
- }
212
- ]
211
+ stack: this.GetHeader(Entity, HColor),
212
+ color: AColor,
213
+ style: 'header',
214
+ alignment: 'center',
215
+ margin: [0, 0, 0, 2]
213
216
  }
214
217
  ];
215
- if (!tr_utils_1.TrUtils.IsNull(Image) && Entity.PrLogo) {
216
- // Details.unshift({ text: '', width: 120 });
217
- if (Entity.CName.length < 28) {
218
- Details[0].stack[0].columns.push({ text: '', width: emptyWidth });
219
- }
220
- if (!tr_utils_1.TrUtils.IsNull(text)) {
221
- Details[0].stack.unshift({ text: text, color: 'grey', alignment: 'right', width: 100, marginBottom: -15, fontSize: 7 });
222
- }
223
- Details.unshift({ image: Image, width: 120, height: 80 });
224
- }
225
- else {
226
- Details[0].stack[1].columns.unshift({ text: '', width: noImageEmptyWidth });
227
- if (!tr_utils_1.TrUtils.IsNull(text)) {
228
- Details[0].stack.unshift({ text: text, color: 'grey', alignment: 'right', width: 100, marginBottom: -15, fontSize: 7 });
229
- }
218
+ if (!tr_utils_1.TrUtils.IsNull(text)) {
219
+ centerStack.push({ text: text, color: 'grey', alignment: 'center', fontSize: 7, margin: [0, 0, 0, 1] });
230
220
  }
221
+ extras.forEach((row) => centerStack.push(row));
222
+ let Details = [
223
+ !tr_utils_1.TrUtils.IsNull(Image) && Entity.PrLogo ? { image: Image, width: logoWidth, height: logoHeight } : { text: '', width: logoWidth },
224
+ { width: '*', stack: centerStack },
225
+ { text: '', width: logoWidth }
226
+ ];
231
227
  return Details;
232
228
  }
233
229
  static GetHeader(Entity, HColor) {
@@ -399,9 +395,10 @@ class SharedPDFService {
399
395
  }
400
396
  static GetPrintType(type) {
401
397
  return {
402
- // marginLeft: 10,
403
- columns: [{ text: '', width: 120 },
404
- { text: type, alignment: 'center' }, { text: '', width: 140 }
398
+ columns: [
399
+ { text: '', width: 120 },
400
+ { text: type, alignment: 'center', width: '*' },
401
+ { text: '', width: 120 }
405
402
  ],
406
403
  style: 'Receiptheader1'
407
404
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.5.51",
3
+ "version": "1.5.53",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",