shareneus 1.6.83 → 1.6.85

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.
@@ -96,7 +96,7 @@ function GetPartyDetails(Entity, InvoicePDFData) {
96
96
  var _a;
97
97
  return {
98
98
  style: 'tableExample',
99
- marginBottom: 10,
99
+ marginBottom: 7,
100
100
  table: {
101
101
  widths: ['*', 'auto', '*'],
102
102
  body: [
@@ -206,6 +206,11 @@ function GetBillofSupplyName(Settings) {
206
206
  // SharedPDFService.HeaderAfterLine()
207
207
  // ]
208
208
  // }
209
+ function resolveDocumentLogoDataUrl(DocumentData) {
210
+ var _a;
211
+ const entity = (_a = DocumentData === null || DocumentData === void 0 ? void 0 : DocumentData.Entity) !== null && _a !== void 0 ? _a : {};
212
+ return (0, pdf_shared_utils_1.firstValue)((0, pdf_shared_utils_1.asDataUrl)(DocumentData === null || DocumentData === void 0 ? void 0 : DocumentData.logoDataUrl), (0, pdf_shared_utils_1.asDataUrl)(DocumentData === null || DocumentData === void 0 ? void 0 : DocumentData.LogoDataUrl), (0, pdf_shared_utils_1.asDataUrl)(DocumentData === null || DocumentData === void 0 ? void 0 : DocumentData.Image), (0, pdf_shared_utils_1.asDataUrl)(DocumentData === null || DocumentData === void 0 ? void 0 : DocumentData.Logo), (0, pdf_shared_utils_1.asDataUrl)(entity === null || entity === void 0 ? void 0 : entity.Image), (0, pdf_shared_utils_1.asDataUrl)(entity === null || entity === void 0 ? void 0 : entity.Logo), (0, pdf_shared_utils_1.asDataUrl)(entity === null || entity === void 0 ? void 0 : entity.CLogo), (0, pdf_shared_utils_1.asDataUrl)(entity === null || entity === void 0 ? void 0 : entity.LogoDataUrl));
213
+ }
209
214
  function buildPdfDocDefinition(PDFInvoiceData = {}, PrintConfigData = {}, printCopies = []) {
210
215
  var _a;
211
216
  const PrintConfig = normalizePrintConfig(PDFInvoiceData, PrintConfigData);
@@ -233,7 +238,7 @@ function buildPdfDocDefinition(PDFInvoiceData = {}, PrintConfigData = {}, printC
233
238
  let invoicePartyDetailsContent;
234
239
  let invoiceContentSections;
235
240
  if (PrintConfigData.IsPoSPrint) {
236
- 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)];
241
+ invoiceHeaderContent = [GetMainHeaderInfo(PDFInvoiceData === null || PDFInvoiceData === void 0 ? void 0 : PDFInvoiceData.Entity, resolveDocumentLogoDataUrl(PDFInvoiceData), (_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)];
237
242
  invoicePartyDetailsContent = [GetPartyDetails(PDFInvoiceData === null || PDFInvoiceData === void 0 ? void 0 : PDFInvoiceData.Entity, PDFInvoiceData)];
238
243
  }
239
244
  else {
@@ -12,6 +12,7 @@ function buildInvoiceTotalsAndNotesSection(invoiceData, availableWidth, PrintCon
12
12
  const normalizedInvoice = invoiceData || {};
13
13
  const sType = (0, pdf_shared_utils_1.firstValue)(normalizedInvoice === null || normalizedInvoice === void 0 ? void 0 : normalizedInvoice.SType);
14
14
  const hideTopSection = isTruthy((_a = normalizedInvoice === null || normalizedInvoice === void 0 ? void 0 : normalizedInvoice.Settings) === null || _a === void 0 ? void 0 : _a.NoPr);
15
+ const isPoSPrint = isTruthy(PrintConfigData === null || PrintConfigData === void 0 ? void 0 : PrintConfigData.IsPoSPrint);
15
16
  const shouldShowTaxSummary = resolveShowTaxSummary(normalizedInvoice, PrintConfigData);
16
17
  const taxSummary = resolveTaxSummary(normalizedInvoice, shouldShowTaxSummary);
17
18
  const showBankDetails = resolveShowBankDetails(normalizedInvoice, PrintConfigData);
@@ -47,7 +48,8 @@ function buildInvoiceTotalsAndNotesSection(invoiceData, availableWidth, PrintCon
47
48
  dueAmount: dueInfo.due,
48
49
  qrPayload,
49
50
  upiPhone: resolveUpiPhone(normalizedInvoice),
50
- showDueSection
51
+ showDueSection,
52
+ isPoSPrint
51
53
  });
52
54
  if (hasTopSection && hasBottomSection) {
53
55
  return [dividerLine, topColumns, bottomColumns];
@@ -109,6 +111,18 @@ function buildPostTotalsInfoSection(data) {
109
111
  margin: [0, 0, 0, 6]
110
112
  });
111
113
  }
114
+ if (data.isPoSPrint) {
115
+ leftStack.push({
116
+ stack: [
117
+ '* Goods once sold will not be taken back or exchanged',
118
+ '* PLEASE GET YOUR MEDICINES CHECKED BY YOUR DOCTOR BEFORE USE *'
119
+ ],
120
+ fontSize: 6,
121
+ margin: [5, 0, 0, 6],
122
+ lineHeight: 1.1,
123
+ color: '#111827'
124
+ });
125
+ }
112
126
  if (termsText) {
113
127
  leftStack.push({
114
128
  text: `\u2022 ${termsText}`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.6.83",
3
+ "version": "1.6.85",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",