shareneus 1.7.21 → 1.7.23

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.
@@ -7,6 +7,7 @@ export declare function deriveHeaderDataFromInvoice(PDFInvoiceData: any): {
7
7
  invoiceHeading: string;
8
8
  organization: {
9
9
  cName: any;
10
+ tLine: any;
10
11
  address1: any;
11
12
  address2: any;
12
13
  city: any;
@@ -28,6 +29,7 @@ export declare function normalizeHeaderData(headerData: any): {
28
29
  invoiceHeading: string;
29
30
  organization: {
30
31
  cName: string;
32
+ tLine: string;
31
33
  address1: string;
32
34
  address2: string;
33
35
  city: string;
@@ -48,6 +48,7 @@ function deriveHeaderDataFromInvoice(PDFInvoiceData) {
48
48
  invoiceHeading: (PDFInvoiceData === null || PDFInvoiceData === void 0 ? void 0 : PDFInvoiceData.Type) ? `${PDFInvoiceData.Type} Invoice` : 'INVOICE',
49
49
  organization: {
50
50
  cName: (entity === null || entity === void 0 ? void 0 : entity.CName) || '',
51
+ tLine: (entity === null || entity === void 0 ? void 0 : entity.TLine) || '',
51
52
  address1: (entity === null || entity === void 0 ? void 0 : entity.Adrs1) || (entity === null || entity === void 0 ? void 0 : entity.Addr1) || '',
52
53
  address2: (entity === null || entity === void 0 ? void 0 : entity.Adrs2) || (entity === null || entity === void 0 ? void 0 : entity.Addr2) || '',
53
54
  city: (entity === null || entity === void 0 ? void 0 : entity.City) || '',
@@ -73,6 +74,7 @@ function normalizeHeaderData(headerData) {
73
74
  invoiceHeading: (headerData === null || headerData === void 0 ? void 0 : headerData.invoiceHeading) ? String(headerData.invoiceHeading) : 'INVOICE',
74
75
  organization: {
75
76
  cName: (0, pdf_shared_utils_1.toStr)(organization === null || organization === void 0 ? void 0 : organization.cName),
77
+ tLine: (0, pdf_shared_utils_1.toStr)(organization === null || organization === void 0 ? void 0 : organization.tLine),
76
78
  address1: (0, pdf_shared_utils_1.toStr)(organization === null || organization === void 0 ? void 0 : organization.address1),
77
79
  address2: (0, pdf_shared_utils_1.toStr)(organization === null || organization === void 0 ? void 0 : organization.address2),
78
80
  city: (0, pdf_shared_utils_1.toStr)(organization === null || organization === void 0 ? void 0 : organization.city),
@@ -120,27 +122,27 @@ function resolvePageMargins(value) {
120
122
  return DEFAULT_PAGE_MARGINS;
121
123
  }
122
124
  function buildDocumentHeaderSection(PrintConfig, DocumentData = {}) {
123
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8;
125
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9;
124
126
  const entity = (_a = DocumentData === null || DocumentData === void 0 ? void 0 : DocumentData.Entity) !== null && _a !== void 0 ? _a : {};
125
127
  const documentLogoDataUrl = resolveDocumentLogoDataUrl(DocumentData);
126
128
  const headerData = normalizeHeaderData((_b = PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.headerData) !== null && _b !== void 0 ? _b : {});
127
- const mergedHeaderData = normalizeHeaderData(Object.assign(Object.assign({}, headerData), { logoDataUrl: (0, pdf_shared_utils_1.firstValue)(documentLogoDataUrl, headerData === null || headerData === void 0 ? void 0 : headerData.logoDataUrl), organization: Object.assign(Object.assign({}, ((_c = headerData === null || headerData === void 0 ? void 0 : headerData.organization) !== null && _c !== void 0 ? _c : {})), { cName: (0, pdf_shared_utils_1.firstValue)(entity === null || entity === void 0 ? void 0 : entity.CName, (_d = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _d === void 0 ? void 0 : _d.cName), address1: (0, pdf_shared_utils_1.firstValue)(entity === null || entity === void 0 ? void 0 : entity.Adrs1, (_e = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _e === void 0 ? void 0 : _e.address1), address2: (0, pdf_shared_utils_1.firstValue)(entity === null || entity === void 0 ? void 0 : entity.Adrs2, (_f = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _f === void 0 ? void 0 : _f.address2), dlNo: (0, pdf_shared_utils_1.firstValue)(entity === null || entity === void 0 ? void 0 : entity.DLNo, entity === null || entity === void 0 ? void 0 : entity.DLNO, (_g = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _g === void 0 ? void 0 : _g.dlNo), gstin: (0, pdf_shared_utils_1.firstValue)(entity === null || entity === void 0 ? void 0 : entity.GSTIN, (_h = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _h === void 0 ? void 0 : _h.gstin), pan: (0, pdf_shared_utils_1.firstValue)(entity === null || entity === void 0 ? void 0 : entity.PAN, (_j = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _j === void 0 ? void 0 : _j.pan), taxIds: Array.isArray(entity === null || entity === void 0 ? void 0 : entity.TaxIds) ? entity.TaxIds : (_k = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _k === void 0 ? void 0 : _k.taxIds, city: (0, pdf_shared_utils_1.firstValue)(entity === null || entity === void 0 ? void 0 : entity.City, (_l = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _l === void 0 ? void 0 : _l.city), state: (0, pdf_shared_utils_1.firstValue)(entity === null || entity === void 0 ? void 0 : entity.State, (_m = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _m === void 0 ? void 0 : _m.state), pin: (0, pdf_shared_utils_1.firstValue)(entity === null || entity === void 0 ? void 0 : entity.PIN, entity === null || entity === void 0 ? void 0 : entity.Pin, (_o = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _o === void 0 ? void 0 : _o.pin), email: (0, pdf_shared_utils_1.firstValue)(entity === null || entity === void 0 ? void 0 : entity.Email, entity === null || entity === void 0 ? void 0 : entity.EMail, (_p = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _p === void 0 ? void 0 : _p.email), phone: (0, pdf_shared_utils_1.firstValue)(entity === null || entity === void 0 ? void 0 : entity.Phone, entity === null || entity === void 0 ? void 0 : entity.Ph, (_q = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _q === void 0 ? void 0 : _q.phone), phone2: (0, pdf_shared_utils_1.firstValue)(entity === null || entity === void 0 ? void 0 : entity.Phone2, entity === null || entity === void 0 ? void 0 : entity.Ph2, (_r = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _r === void 0 ? void 0 : _r.phone2) }) }));
128
- const headerStyles = normalizeHeaderStyle((_s = PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.headerStyles) !== null && _s !== void 0 ? _s : {
129
+ const mergedHeaderData = normalizeHeaderData(Object.assign(Object.assign({}, headerData), { logoDataUrl: (0, pdf_shared_utils_1.firstValue)(documentLogoDataUrl, headerData === null || headerData === void 0 ? void 0 : headerData.logoDataUrl), organization: Object.assign(Object.assign({}, ((_c = headerData === null || headerData === void 0 ? void 0 : headerData.organization) !== null && _c !== void 0 ? _c : {})), { cName: (0, pdf_shared_utils_1.firstValue)(entity === null || entity === void 0 ? void 0 : entity.CName, (_d = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _d === void 0 ? void 0 : _d.cName), tLine: (0, pdf_shared_utils_1.firstValue)(entity === null || entity === void 0 ? void 0 : entity.TLine, (_e = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _e === void 0 ? void 0 : _e.tLine), address1: (0, pdf_shared_utils_1.firstValue)(entity === null || entity === void 0 ? void 0 : entity.Adrs1, (_f = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _f === void 0 ? void 0 : _f.address1), address2: (0, pdf_shared_utils_1.firstValue)(entity === null || entity === void 0 ? void 0 : entity.Adrs2, (_g = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _g === void 0 ? void 0 : _g.address2), dlNo: (0, pdf_shared_utils_1.firstValue)(entity === null || entity === void 0 ? void 0 : entity.DLNo, entity === null || entity === void 0 ? void 0 : entity.DLNO, (_h = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _h === void 0 ? void 0 : _h.dlNo), gstin: (0, pdf_shared_utils_1.firstValue)(entity === null || entity === void 0 ? void 0 : entity.GSTIN, (_j = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _j === void 0 ? void 0 : _j.gstin), pan: (0, pdf_shared_utils_1.firstValue)(entity === null || entity === void 0 ? void 0 : entity.PAN, (_k = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _k === void 0 ? void 0 : _k.pan), taxIds: Array.isArray(entity === null || entity === void 0 ? void 0 : entity.TaxIds) ? entity.TaxIds : (_l = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _l === void 0 ? void 0 : _l.taxIds, city: (0, pdf_shared_utils_1.firstValue)(entity === null || entity === void 0 ? void 0 : entity.City, (_m = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _m === void 0 ? void 0 : _m.city), state: (0, pdf_shared_utils_1.firstValue)(entity === null || entity === void 0 ? void 0 : entity.State, (_o = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _o === void 0 ? void 0 : _o.state), pin: (0, pdf_shared_utils_1.firstValue)(entity === null || entity === void 0 ? void 0 : entity.PIN, entity === null || entity === void 0 ? void 0 : entity.Pin, (_p = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _p === void 0 ? void 0 : _p.pin), email: (0, pdf_shared_utils_1.firstValue)(entity === null || entity === void 0 ? void 0 : entity.Email, entity === null || entity === void 0 ? void 0 : entity.EMail, (_q = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _q === void 0 ? void 0 : _q.email), phone: (0, pdf_shared_utils_1.firstValue)(entity === null || entity === void 0 ? void 0 : entity.Phone, entity === null || entity === void 0 ? void 0 : entity.Ph, (_r = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _r === void 0 ? void 0 : _r.phone), phone2: (0, pdf_shared_utils_1.firstValue)(entity === null || entity === void 0 ? void 0 : entity.Phone2, entity === null || entity === void 0 ? void 0 : entity.Ph2, (_s = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _s === void 0 ? void 0 : _s.phone2) }) }));
130
+ const headerStyles = normalizeHeaderStyle((_t = PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.headerStyles) !== null && _t !== void 0 ? _t : {
129
131
  OrgNameFsize: PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.OrgNameFsize,
130
132
  OrgNameClr: PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.OrgNameClr,
131
133
  AdrsFsize: PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.AdrsFsize,
132
134
  AdrsClr: PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.AdrsClr
133
135
  });
134
- const headerSettings = normalizeHeaderSettings((_u = (_t = PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.Header) !== null && _t !== void 0 ? _t : PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.Header) !== null && _u !== void 0 ? _u : {});
136
+ const headerSettings = normalizeHeaderSettings((_v = (_u = PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.Header) !== null && _u !== void 0 ? _u : PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.Header) !== null && _v !== void 0 ? _v : {});
135
137
  if (!headerSettings.Show) {
136
138
  return [];
137
139
  }
138
- const hasPrintedTaxIds = !!buildPrintedTaxIdsText((_v = mergedHeaderData.organization) === null || _v === void 0 ? void 0 : _v.taxIds);
139
- const hasOrganizationData = !!(((_w = mergedHeaderData.organization) === null || _w === void 0 ? void 0 : _w.cName) || ((_x = mergedHeaderData.organization) === null || _x === void 0 ? void 0 : _x.address1)
140
- || ((_y = mergedHeaderData.organization) === null || _y === void 0 ? void 0 : _y.address2) || ((_z = mergedHeaderData.organization) === null || _z === void 0 ? void 0 : _z.city) || ((_0 = mergedHeaderData.organization) === null || _0 === void 0 ? void 0 : _0.state)
141
- || ((_1 = mergedHeaderData.organization) === null || _1 === void 0 ? void 0 : _1.pin) || ((_2 = mergedHeaderData.organization) === null || _2 === void 0 ? void 0 : _2.gstin) || ((_3 = mergedHeaderData.organization) === null || _3 === void 0 ? void 0 : _3.email)
142
- || ((_4 = mergedHeaderData.organization) === null || _4 === void 0 ? void 0 : _4.phone) || ((_5 = mergedHeaderData.organization) === null || _5 === void 0 ? void 0 : _5.phone2) || ((_6 = mergedHeaderData.organization) === null || _6 === void 0 ? void 0 : _6.dlNo)
143
- || ((_7 = mergedHeaderData.organization) === null || _7 === void 0 ? void 0 : _7.cin) || ((_8 = mergedHeaderData.organization) === null || _8 === void 0 ? void 0 : _8.pan) || hasPrintedTaxIds);
140
+ const hasPrintedTaxIds = !!buildPrintedTaxIdsText((_w = mergedHeaderData.organization) === null || _w === void 0 ? void 0 : _w.taxIds);
141
+ const hasOrganizationData = !!(((_x = mergedHeaderData.organization) === null || _x === void 0 ? void 0 : _x.cName) || ((_y = mergedHeaderData.organization) === null || _y === void 0 ? void 0 : _y.address1)
142
+ || ((_z = mergedHeaderData.organization) === null || _z === void 0 ? void 0 : _z.address2) || ((_0 = mergedHeaderData.organization) === null || _0 === void 0 ? void 0 : _0.city) || ((_1 = mergedHeaderData.organization) === null || _1 === void 0 ? void 0 : _1.state)
143
+ || ((_2 = mergedHeaderData.organization) === null || _2 === void 0 ? void 0 : _2.pin) || ((_3 = mergedHeaderData.organization) === null || _3 === void 0 ? void 0 : _3.gstin) || ((_4 = mergedHeaderData.organization) === null || _4 === void 0 ? void 0 : _4.email)
144
+ || ((_5 = mergedHeaderData.organization) === null || _5 === void 0 ? void 0 : _5.phone) || ((_6 = mergedHeaderData.organization) === null || _6 === void 0 ? void 0 : _6.phone2) || ((_7 = mergedHeaderData.organization) === null || _7 === void 0 ? void 0 : _7.dlNo)
145
+ || ((_8 = mergedHeaderData.organization) === null || _8 === void 0 ? void 0 : _8.cin) || ((_9 = mergedHeaderData.organization) === null || _9 === void 0 ? void 0 : _9.pan) || hasPrintedTaxIds);
144
146
  const hasLogo = !!mergedHeaderData.logoDataUrl && headerSettings.ShowLogo;
145
147
  if (!hasOrganizationData && !hasLogo) {
146
148
  return [];
@@ -270,6 +272,9 @@ function buildOrganizationStack(organization, headerStyles, alignment) {
270
272
  if (organization === null || organization === void 0 ? void 0 : organization.cName) {
271
273
  stack.push({ text: organization.cName, bold: true, fontSize: orgNameFontSize, color: orgNameFontColor, lineHeight: 1.1, alignment });
272
274
  }
275
+ if (organization === null || organization === void 0 ? void 0 : organization.tLine) {
276
+ stack.push({ text: organization.tLine, bold: true, fontSize: 10, color: orgNameFontColor, lineHeight: 1.1, alignment });
277
+ }
273
278
  if (organization === null || organization === void 0 ? void 0 : organization.address1) {
274
279
  stack.push({ text: organization.address1, fontSize: orgAddressFontSize, color: orgAddressFontColor, lineHeight: 1.05, alignment });
275
280
  }
@@ -447,7 +452,7 @@ function buildHeaderContentWithLogo(logoDataUrl, hasLogo, organizationStack, log
447
452
  logoBlock,
448
453
  {
449
454
  width: '*',
450
- marginLeft: -50,
455
+ marginLeft: -90,
451
456
  stack: safeOrganizationStack
452
457
  }
453
458
  ],
@@ -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,7 +360,6 @@ 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
363
  if (pdfInvoiceData === null || pdfInvoiceData === void 0 ? void 0 : pdfInvoiceData.ShowDiscountColumn) {
367
364
  return tableConfig;
368
365
  }
@@ -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.21",
3
+ "version": "1.7.23",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -41,6 +41,7 @@ export function deriveHeaderDataFromInvoice(PDFInvoiceData: any) {
41
41
  invoiceHeading: PDFInvoiceData?.Type ? `${PDFInvoiceData.Type} Invoice` : 'INVOICE',
42
42
  organization: {
43
43
  cName: entity?.CName || '',
44
+ tLine: entity?.TLine || '',
44
45
  address1: entity?.Adrs1 || entity?.Addr1 || '',
45
46
  address2: entity?.Adrs2 || entity?.Addr2 || '',
46
47
  city: entity?.City || '',
@@ -66,6 +67,7 @@ export function normalizeHeaderData(headerData: any) {
66
67
  invoiceHeading: headerData?.invoiceHeading ? String(headerData.invoiceHeading) : 'INVOICE',
67
68
  organization: {
68
69
  cName: toStr(organization?.cName),
70
+ tLine: toStr(organization?.tLine),
69
71
  address1: toStr(organization?.address1),
70
72
  address2: toStr(organization?.address2),
71
73
  city: toStr(organization?.city),
@@ -125,6 +127,7 @@ export function buildDocumentHeaderSection(PrintConfig: any, DocumentData: any =
125
127
  organization: {
126
128
  ...(headerData?.organization ?? {}),
127
129
  cName: firstValue(entity?.CName, headerData?.organization?.cName),
130
+ tLine: firstValue(entity?.TLine, headerData?.organization?.tLine),
128
131
  address1: firstValue(entity?.Adrs1, headerData?.organization?.address1),
129
132
  address2: firstValue(entity?.Adrs2, headerData?.organization?.address2),
130
133
  dlNo: firstValue(entity?.DLNo, entity?.DLNO, headerData?.organization?.dlNo),
@@ -145,7 +148,7 @@ export function buildDocumentHeaderSection(PrintConfig: any, DocumentData: any =
145
148
  AdrsFsize: PrintConfig?.AdrsFsize,
146
149
  AdrsClr: PrintConfig?.AdrsClr
147
150
  });
148
- const headerSettings:any = normalizeHeaderSettings(PrintConfig?.Header ?? PrintConfig?.Header ?? {});
151
+ const headerSettings: any = normalizeHeaderSettings(PrintConfig?.Header ?? PrintConfig?.Header ?? {});
149
152
 
150
153
  if (!headerSettings.Show) {
151
154
  return [];
@@ -312,6 +315,10 @@ function buildOrganizationStack(organization: any, headerStyles: any, alignment:
312
315
  if (organization?.cName) {
313
316
  stack.push({ text: organization.cName, bold: true, fontSize: orgNameFontSize, color: orgNameFontColor, lineHeight: 1.1, alignment });
314
317
  }
318
+
319
+ if (organization?.tLine) {
320
+ stack.push({ text: organization.tLine, bold: true, fontSize: 10, color: orgNameFontColor, lineHeight: 1.1, alignment });
321
+ }
315
322
  if (organization?.address1) {
316
323
  stack.push({ text: organization.address1, fontSize: orgAddressFontSize, color: orgAddressFontColor, lineHeight: 1.05, alignment });
317
324
  }
@@ -511,7 +518,7 @@ function buildHeaderContentWithLogo(
511
518
  logoBlock,
512
519
  {
513
520
  width: '*',
514
- marginLeft: -50,
521
+ marginLeft: -90,
515
522
  stack: safeOrganizationStack
516
523
  }
517
524
  ],
@@ -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,8 +386,6 @@ 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
389
  if (pdfInvoiceData?.ShowDiscountColumn) {
394
390
  return tableConfig;
395
391
  }
@@ -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
  });
package/tsconfig.json CHANGED
@@ -2,6 +2,7 @@
2
2
  "compilerOptions": {
3
3
  "declaration": true,
4
4
  "outDir": "./dist",
5
+ "rootDir": "./src",
5
6
  /* Visit https://aka.ms/tsconfig to read more about this file */
6
7
 
7
8
  /* Projects */