shareneus 1.7.20 → 1.7.22

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.
@@ -447,7 +447,7 @@ function buildHeaderContentWithLogo(logoDataUrl, hasLogo, organizationStack, log
447
447
  logoBlock,
448
448
  {
449
449
  width: '*',
450
- marginLeft: -25,
450
+ marginLeft: -75,
451
451
  stack: safeOrganizationStack
452
452
  }
453
453
  ],
@@ -208,7 +208,8 @@ function formatExpiryDateValue(value) {
208
208
  function shouldSkipFixedTo(header) {
209
209
  var _a;
210
210
  const text = String((_a = header === null || header === void 0 ? void 0 : header.text) !== null && _a !== void 0 ? _a : '').trim().toUpperCase();
211
- if (text === 'HSN/SAC' || text === 'BN' || text === 'BNO' || text.includes('%')) {
211
+ const normalizedText = text.replace(/\s+/g, '');
212
+ if (text === 'HSN/SAC' || text === 'BN' || text === 'BNO' || text.includes('%') || normalizedText === 'QTY' || normalizedText === 'OFFERQTY' || normalizedText === 'MPN') {
212
213
  return true;
213
214
  }
214
215
  const dbFields = Array.isArray(header === null || header === void 0 ? void 0 : header.dbFields) ? header.dbFields : [];
@@ -216,7 +217,11 @@ function shouldSkipFixedTo(header) {
216
217
  const normalized = String(field !== null && field !== void 0 ? field : '').trim().toUpperCase();
217
218
  return normalized === 'BN'
218
219
  || normalized === 'BNO'
220
+ || normalized === 'QTY'
221
+ || normalized === 'MPN'
219
222
  || normalized.endsWith('.BN')
223
+ || normalized.endsWith('.QTY')
224
+ || normalized.endsWith('.MPN')
220
225
  || normalized.endsWith('PERC')
221
226
  || normalized.endsWith('.PERC');
222
227
  });
@@ -20,8 +20,6 @@ function buildInvoiceTableData(PDFInvoiceData, PrintConfig, availableWidth) {
20
20
  const taxMode = resolveInvoiceTaxMode(PDFInvoiceData);
21
21
  const showSectionSummaryRows = !resolveIsPoSPrint(PrintConfig);
22
22
  const tableConfig = normalizeTableConfig(PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.TableConfig, PDFInvoiceData);
23
- console.log('tableConfig:', tableConfig);
24
- console.log('ShowDiscountColumn:', PDFInvoiceData === null || PDFInvoiceData === void 0 ? void 0 : PDFInvoiceData.ShowDiscountColumn);
25
23
  const headerConfig = (0, pdf_table_header_1.GetTableHeader)(tableConfig, taxMode)[0];
26
24
  const renderColumns = (0, pdf_table_header_1.getRenderableColumns)(headerConfig, sType);
27
25
  const headerRows = (0, pdf_table_header_1.buildHeaderRows)(headerConfig, sType);
@@ -362,15 +360,14 @@ function normalizeTableConfig(tableConfig, pdfInvoiceData) {
362
360
  if (!Array.isArray(tableConfig) || tableConfig.length === 0) {
363
361
  return Array.isArray(tableConfig) ? tableConfig : [];
364
362
  }
365
- console.log('Original Table Config:', pdfInvoiceData === null || pdfInvoiceData === void 0 ? void 0 : pdfInvoiceData.ShowDiscountColumn);
366
- if (!(pdfInvoiceData === null || pdfInvoiceData === void 0 ? void 0 : pdfInvoiceData.ShowDiscountColumn)) {
363
+ if (pdfInvoiceData === null || pdfInvoiceData === void 0 ? void 0 : pdfInvoiceData.ShowDiscountColumn) {
367
364
  return tableConfig;
368
365
  }
369
366
  return tableConfig.map((column) => {
370
367
  if (!isDiscountColumnConfig(column)) {
371
368
  return column;
372
369
  }
373
- return Object.assign(Object.assign({}, column), { show: true, Show: true });
370
+ return Object.assign(Object.assign({}, column), { show: false, Show: false });
374
371
  });
375
372
  }
376
373
  function isDiscountColumnConfig(column) {
@@ -402,7 +399,8 @@ function shouldNegateFallbackHeaderValue(item, headerText) {
402
399
  function shouldSkipFixedTo(header) {
403
400
  var _a;
404
401
  const text = String((_a = header === null || header === void 0 ? void 0 : header.text) !== null && _a !== void 0 ? _a : '').trim().toUpperCase();
405
- if (text === 'HSN/SAC' || text === 'BN' || text === 'BNO' || text.includes('%')) {
402
+ const normalizedText = text.replace(/\s+/g, '');
403
+ if (text === 'HSN/SAC' || text === 'BN' || text === 'BNO' || text.includes('%') || normalizedText === 'QTY' || normalizedText === 'OFFERQTY' || normalizedText === 'MPN') {
406
404
  return true;
407
405
  }
408
406
  const dbFields = Array.isArray(header === null || header === void 0 ? void 0 : header.dbFields) ? header.dbFields : [];
@@ -410,7 +408,11 @@ function shouldSkipFixedTo(header) {
410
408
  const normalized = String(field !== null && field !== void 0 ? field : '').trim().toUpperCase();
411
409
  return normalized === 'BN'
412
410
  || normalized === 'BNO'
411
+ || normalized === 'QTY'
412
+ || normalized === 'MPN'
413
413
  || normalized.endsWith('.BN')
414
+ || normalized.endsWith('.QTY')
415
+ || normalized.endsWith('.MPN')
414
416
  || normalized.endsWith('PERC')
415
417
  || normalized.endsWith('.PERC');
416
418
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.7.20",
3
+ "version": "1.7.22",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -511,7 +511,7 @@ function buildHeaderContentWithLogo(
511
511
  logoBlock,
512
512
  {
513
513
  width: '*',
514
- marginLeft: -25,
514
+ marginLeft: -75,
515
515
  stack: safeOrganizationStack
516
516
  }
517
517
  ],
@@ -236,7 +236,8 @@ function formatExpiryDateValue(value: string) {
236
236
 
237
237
  function shouldSkipFixedTo(header: any) {
238
238
  const text = String(header?.text ?? '').trim().toUpperCase();
239
- if (text === 'HSN/SAC' || text === 'BN' || text === 'BNO' || text.includes('%')) {
239
+ const normalizedText = text.replace(/\s+/g, '');
240
+ if (text === 'HSN/SAC' || text === 'BN' || text === 'BNO' || text.includes('%') || normalizedText === 'QTY' || normalizedText === 'OFFERQTY' || normalizedText === 'MPN') {
240
241
  return true;
241
242
  }
242
243
 
@@ -245,7 +246,11 @@ function shouldSkipFixedTo(header: any) {
245
246
  const normalized = String(field ?? '').trim().toUpperCase();
246
247
  return normalized === 'BN'
247
248
  || normalized === 'BNO'
249
+ || normalized === 'QTY'
250
+ || normalized === 'MPN'
248
251
  || normalized.endsWith('.BN')
252
+ || normalized.endsWith('.QTY')
253
+ || normalized.endsWith('.MPN')
249
254
  || normalized.endsWith('PERC')
250
255
  || normalized.endsWith('.PERC');
251
256
  });
@@ -14,8 +14,6 @@ export function buildInvoiceTableData(PDFInvoiceData: any, PrintConfig: any, ava
14
14
  const taxMode = resolveInvoiceTaxMode(PDFInvoiceData);
15
15
  const showSectionSummaryRows = !resolveIsPoSPrint(PrintConfig);
16
16
  const tableConfig = normalizeTableConfig(PrintConfig?.TableConfig, PDFInvoiceData);
17
- console.log('tableConfig:', tableConfig);
18
- console.log('ShowDiscountColumn:', PDFInvoiceData?.ShowDiscountColumn);
19
17
  const headerConfig = GetTableHeader(tableConfig, taxMode)[0];
20
18
  const renderColumns = getRenderableColumns(headerConfig, sType);
21
19
  const headerRows = buildHeaderRows(headerConfig, sType);
@@ -388,9 +386,7 @@ function normalizeTableConfig(tableConfig: any[], pdfInvoiceData: any) {
388
386
  return Array.isArray(tableConfig) ? tableConfig : [];
389
387
  }
390
388
 
391
- console.log('Original Table Config:', pdfInvoiceData?.ShowDiscountColumn);
392
-
393
- if (!pdfInvoiceData?.ShowDiscountColumn) {
389
+ if (pdfInvoiceData?.ShowDiscountColumn) {
394
390
  return tableConfig;
395
391
  }
396
392
 
@@ -401,8 +397,8 @@ function normalizeTableConfig(tableConfig: any[], pdfInvoiceData: any) {
401
397
 
402
398
  return {
403
399
  ...column,
404
- show: true,
405
- Show: true
400
+ show: false,
401
+ Show: false
406
402
  };
407
403
  });
408
404
  }
@@ -455,7 +451,8 @@ function shouldNegateFallbackHeaderValue(item: any, headerText: string) {
455
451
 
456
452
  function shouldSkipFixedTo(header: any) {
457
453
  const text = String(header?.text ?? '').trim().toUpperCase();
458
- if (text === 'HSN/SAC' || text === 'BN' || text === 'BNO' || text.includes('%')) {
454
+ const normalizedText = text.replace(/\s+/g, '');
455
+ if (text === 'HSN/SAC' || text === 'BN' || text === 'BNO' || text.includes('%') || normalizedText === 'QTY' || normalizedText === 'OFFERQTY' || normalizedText === 'MPN') {
459
456
  return true;
460
457
  }
461
458
 
@@ -464,7 +461,11 @@ function shouldSkipFixedTo(header: any) {
464
461
  const normalized = String(field ?? '').trim().toUpperCase();
465
462
  return normalized === 'BN'
466
463
  || normalized === 'BNO'
464
+ || normalized === 'QTY'
465
+ || normalized === 'MPN'
467
466
  || normalized.endsWith('.BN')
467
+ || normalized.endsWith('.QTY')
468
+ || normalized.endsWith('.MPN')
468
469
  || normalized.endsWith('PERC')
469
470
  || normalized.endsWith('.PERC');
470
471
  });