shareneus 1.6.75 → 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,7 +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 shared_pdf_service_1 = require("../../../shared/shared-pdf.service");
11
+ const tr_utils_1 = require("../../../utils/tr-utils");
12
12
  const PAGE_MARGINS = [20, 20, 20, 20];
13
13
  const CELL_PADDING_LEFT = 4;
14
14
  const CELL_PADDING_RIGHT = 4;
@@ -62,13 +62,60 @@ function GetInvoicePdfDataUrl(PDFInvoiceData = {}, PrintConfigData = {}, printCo
62
62
  // }
63
63
  // });
64
64
  }
65
- function SalesReceiptHeaderData(Entity, Image, AColor, HColor, text) {
66
- return [
67
- shared_pdf_service_1.SharedPDFService.GetMainHeader(Entity, Image, AColor, HColor, text),
68
- shared_pdf_service_1.SharedPDFService.GetPrintType('Sales Receipt'),
69
- shared_pdf_service_1.SharedPDFService.HeaderAfterLine()
70
- ];
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' };
71
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
+ // }
72
119
  function buildPdfDocDefinition(PDFInvoiceData = {}, PrintConfigData = {}, printCopies = []) {
73
120
  var _a;
74
121
  const PrintConfig = normalizePrintConfig(PDFInvoiceData, PrintConfigData);
@@ -91,9 +138,9 @@ function buildPdfDocDefinition(PDFInvoiceData = {}, PrintConfigData = {}, printC
91
138
  const availableWidth = (0, pdf_table_section_1.getAvailablePageWidth)(pageSize, requestedPageOrientation, pageMargins);
92
139
  const content = [];
93
140
  copyLabels.forEach((copyLabel, index) => {
94
- var _a, _b, _c;
141
+ var _a, _b;
95
142
  // const invoiceHeaderContent = buildDocumentHeaderSection(PrintConfig, PDFInvoiceData);
96
- const invoiceHeaderContent = SalesReceiptHeaderData(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, (_c = PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.headerData) === null || _c === void 0 ? void 0 : _c.OrgName);
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)];
97
144
  const invoiceHeadingContent = (0, pdf_header_footer_section_1.buildDocumentHeadingSection)(PDFInvoiceData, PrintConfig, availableWidth);
98
145
  const invoicePartyDetailsContent = (0, pdf_party_details_section_1.buildInvoicePartyDetailsSection)(PDFInvoiceData, PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.Customer, PrintConfig);
99
146
  const invoiceTotalsAndNotesContent = (0, pdf_totals_section_1.buildInvoiceTotalsAndNotesSection)(PDFInvoiceData, availableWidth, PrintConfigData);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.6.75",
3
+ "version": "1.6.76",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",