shareneus 1.6.74 → 1.6.76

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.
@@ -8,6 +8,7 @@ const pdf_table_section_1 = require("../../../shared/table-section/pdf-table.sec
8
8
  const pdf_totals_section_1 = require("../../../shared/totals-section/pdf-totals.section");
9
9
  const pdf_shared_utils_1 = require("../../../shared/header-footer-section/pdf-shared.utils");
10
10
  const pdf_header_footer_section_1 = require("../../../shared/header-footer-section/pdf-header-footer.section");
11
+ const tr_utils_1 = require("../../../utils/tr-utils");
11
12
  const PAGE_MARGINS = [20, 20, 20, 20];
12
13
  const CELL_PADDING_LEFT = 4;
13
14
  const CELL_PADDING_RIGHT = 4;
@@ -61,6 +62,60 @@ function GetInvoicePdfDataUrl(PDFInvoiceData = {}, PrintConfigData = {}, printCo
61
62
  // }
62
63
  // });
63
64
  }
65
+ function GetMainHeaderInfo(Entity, Image, AColor, HColor, InvoicePDFData) {
66
+ if (!tr_utils_1.TrUtils.IsNull(Image)) {
67
+ return {
68
+ columns: [{ image: Image, width: 60, height: 60, marginBottom: 5 },
69
+ {
70
+ stack: [
71
+ { text: Entity.CName, style: ['headerstyle'], color: HColor, alignment: 'left', fontSize: 15 },
72
+ { text: GetAddress(Entity), alignment: 'left', style: ['headerstyle'], color: AColor },
73
+ {
74
+ columns: GetHeaderInfo(InvoicePDFData, 0)
75
+ },
76
+ { text: InvoicePDFData.HeaderName, alignment: 'center', style: ['Receiptheader1'], marginTop: 5 }
77
+ ]
78
+ }
79
+ ], columnGap: 10
80
+ };
81
+ }
82
+ else {
83
+ return {
84
+ stack: [
85
+ { text: InvoicePDFData.Entity.CName, style: ['headerstyle'], alignment: 'center', fontSize: 15 },
86
+ { text: GetAddress(InvoicePDFData.Entity), alignment: 'center', style: ['headerstyle'] },
87
+ {
88
+ columns: GetHeaderInfo(InvoicePDFData.Entity, 5, InvoicePDFData)
89
+ },
90
+ { text: InvoicePDFData.HeaderName, alignment: 'center', style: ['Receiptheader1'] }
91
+ ]
92
+ };
93
+ }
94
+ }
95
+ function GetAddress(Entity) {
96
+ return Entity.Adrs1 + ', ' + Entity.Adrs2 + ', ' + Entity.City + '-' + Entity.PIN + ', Cell : ' + Entity.Phone;
97
+ }
98
+ function GetHeaderInfo(Entity, marginleft, InvoicePDFData = {}) {
99
+ let TaxInfo = [];
100
+ if (!tr_utils_1.TrUtils.IsEmpty(Entity.GSTIN)) {
101
+ TaxInfo.push({ text: 'GSTIN : ' + Entity.GSTIN, marginTop: 2, marginLeft: marginleft, alignment: 'left', fontSize: 9, width: 'auto' });
102
+ }
103
+ if (!tr_utils_1.TrUtils.IsEmpty(Entity.DLNo)) {
104
+ TaxInfo.push({ text: 'D.L.NO : ' + Entity.DLNo, marginTop: 2, marginLeft: 5, alignment: 'left', fontSize: 9, width: '*' });
105
+ }
106
+ TaxInfo.push(GetBillofSupplyName(InvoicePDFData.Settings));
107
+ return TaxInfo;
108
+ }
109
+ function GetBillofSupplyName(Settings) {
110
+ return { text: Settings.Tax === 'BS' ? ' Bill of Supply' : null, alignment: 'center', marginLeft: 15, marginTop: 2, marginBottom: 3, fontSize: 9, width: 'auto' };
111
+ }
112
+ // function SalesReceiptHeaderData(Entity: any, Image: any, AColor: any, HColor: any, text: any) {
113
+ // return [
114
+ // SharedPDFService.GetMainHeader(Entity, Image, AColor, HColor, text),
115
+ // SharedPDFService.GetPrintType('Sales Receipt'),
116
+ // SharedPDFService.HeaderAfterLine()
117
+ // ]
118
+ // }
64
119
  function buildPdfDocDefinition(PDFInvoiceData = {}, PrintConfigData = {}, printCopies = []) {
65
120
  var _a;
66
121
  const PrintConfig = normalizePrintConfig(PDFInvoiceData, PrintConfigData);
@@ -83,7 +138,9 @@ function buildPdfDocDefinition(PDFInvoiceData = {}, PrintConfigData = {}, printC
83
138
  const availableWidth = (0, pdf_table_section_1.getAvailablePageWidth)(pageSize, requestedPageOrientation, pageMargins);
84
139
  const content = [];
85
140
  copyLabels.forEach((copyLabel, index) => {
86
- const invoiceHeaderContent = (0, pdf_header_footer_section_1.buildDocumentHeaderSection)(PrintConfig, PDFInvoiceData);
141
+ var _a, _b;
142
+ // const invoiceHeaderContent = buildDocumentHeaderSection(PrintConfig, PDFInvoiceData);
143
+ const invoiceHeaderContent = [GetMainHeaderInfo(PDFInvoiceData === null || PDFInvoiceData === void 0 ? void 0 : PDFInvoiceData.Entity, PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.Image, (_a = PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.headerStyles) === null || _a === void 0 ? void 0 : _a.OrgNameClr, (_b = PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.headerStyles) === null || _b === void 0 ? void 0 : _b.AdrsClr, PDFInvoiceData)];
87
144
  const invoiceHeadingContent = (0, pdf_header_footer_section_1.buildDocumentHeadingSection)(PDFInvoiceData, PrintConfig, availableWidth);
88
145
  const invoicePartyDetailsContent = (0, pdf_party_details_section_1.buildInvoicePartyDetailsSection)(PDFInvoiceData, PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.Customer, PrintConfig);
89
146
  const invoiceTotalsAndNotesContent = (0, pdf_totals_section_1.buildInvoiceTotalsAndNotesSection)(PDFInvoiceData, availableWidth, PrintConfigData);
@@ -289,7 +289,7 @@ class SharedPDFService {
289
289
  }
290
290
  static GetEntityDetails(Entity) {
291
291
  let SetData = [];
292
- if (Entity.PrUPI && !Entity.IsProforma) {
292
+ if (Entity.PrUPI && !Entity.IsProforma && !tr_utils_1.TrUtils.IsEmpty(Entity.UPI)) {
293
293
  SetData.push({ qr: Entity.UPI, fit: '125', marginLeft: 150 });
294
294
  SetData.push({ text: 'Scan To Pay', fontSize: this.TermsandCond, marginLeft: 151, bold: true, marginTop: 2 });
295
295
  // SetData.push({ text: 'UPI Number: ' + Entity.UPIPhone, fontSize: 9, marginLeft: 151, bold: true, marginTop: 5 });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.6.74",
3
+ "version": "1.6.76",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",