shareneus 1.5.60 → 1.5.62
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.
- package/dist/accounting/invoice/invoice-pdf/invoice-pdf.service.js +1 -1
- package/dist/accounting/invoice/unified-invoice-pdf.service.js +16 -17
- package/dist/shared/header-footer-section/pdf-header-footer.section.js +12 -6
- package/dist/shared/table-section/pdf-table.header.js +36 -17
- package/dist/shared/table-section/pdf-table.row.js +18 -3
- package/dist/shared/table-section/pdf-table.section.js +1 -1
- package/package.json +1 -1
|
@@ -126,7 +126,7 @@ function normalizeCopyLabels(printCopies = []) {
|
|
|
126
126
|
function normalizePrintConfig(PDFInvoiceData, PrintConfigData) {
|
|
127
127
|
var _a, _b;
|
|
128
128
|
const config = PrintConfigData || {};
|
|
129
|
-
const itemsHeader = Array.isArray(config === null || config === void 0 ? void 0 : config.
|
|
129
|
+
const itemsHeader = Array.isArray(config === null || config === void 0 ? void 0 : config.TableConfig) ? config.TableConfig : [];
|
|
130
130
|
const headerData = (config === null || config === void 0 ? void 0 : config.headerData) ? config.headerData : (0, pdf_header_footer_section_1.deriveHeaderDataFromInvoice)(PDFInvoiceData);
|
|
131
131
|
const pageMargins = (0, pdf_header_footer_section_1.resolvePageMargins)((_a = config === null || config === void 0 ? void 0 : config.pageMargins) !== null && _a !== void 0 ? _a : PAGE_MARGINS);
|
|
132
132
|
const watermarkText = (0, pdf_shared_utils_1.toStr)(config === null || config === void 0 ? void 0 : config.watermarkText);
|
|
@@ -315,7 +315,6 @@ function addLaborHeaderAndTotalRows(Labor, laborLabel, laborTotalLabel, ShowTaxC
|
|
|
315
315
|
Labor.unshift(dummypartadding1);
|
|
316
316
|
}
|
|
317
317
|
function buildItemRow(item, columns, column, itemLabel) {
|
|
318
|
-
var _a, _b, _c, _d, _e;
|
|
319
318
|
const hasValue = !tr_utils_1.TrUtils.IsFixedZero(item[column.Field]) && !tr_utils_1.TrUtils.IsNull(item[column.Field]) || (column.text === 'Line Total');
|
|
320
319
|
if (hasValue) {
|
|
321
320
|
if (item[column.Field] === itemLabel) {
|
|
@@ -384,22 +383,22 @@ function buildItemRow(item, columns, column, itemLabel) {
|
|
|
384
383
|
DescData.push({ text: item['EDesc'].toString(), color: 'grey' });
|
|
385
384
|
}
|
|
386
385
|
// DescData.push({ text: item['MPN'] ? 'MPN: ' + item['MPN'] : '', color: 'grey', italics: true, marginTop: 2 });
|
|
387
|
-
const isItemRow = itemLabel === 'Items';
|
|
388
|
-
const hasBatchOrMrp = !
|
|
389
|
-
if (isItemRow && hasBatchOrMrp) {
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
}
|
|
386
|
+
// const isItemRow = itemLabel === 'Items';
|
|
387
|
+
// const hasBatchOrMrp = !TrUtils.IsNull(item['Batch']?.BN) || !TrUtils.IsNull(item['Batch']?.ExDt) || !TrUtils.IsNull(item['MRP']);
|
|
388
|
+
// if (isItemRow && hasBatchOrMrp) {
|
|
389
|
+
// const exDate = !TrUtils.IsNull(item['Batch']?.ExDt) ? MyDate.ConvertUTCDateToReadableExDate(item['Batch']?.ExDt) : '';
|
|
390
|
+
// DescData.push({
|
|
391
|
+
// marginTop: 5,
|
|
392
|
+
// text: [
|
|
393
|
+
// { text: 'B.No: ', bold: true },
|
|
394
|
+
// { text: (item['Batch']?.BN || '') + '' },
|
|
395
|
+
// { text: ' | Ex.Dt: ', bold: true },
|
|
396
|
+
// { text: exDate + '' },
|
|
397
|
+
// { text: ' | MRP: ', bold: true },
|
|
398
|
+
// { text: (TrUtils.IsNull(item['MRP']) ? '' : item['MRP']) + '' }
|
|
399
|
+
// ]
|
|
400
|
+
// });
|
|
401
|
+
// }
|
|
403
402
|
return { stack: DescData };
|
|
404
403
|
}
|
|
405
404
|
else {
|
|
@@ -71,11 +71,12 @@ function normalizeHeaderData(headerData) {
|
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
73
|
function normalizeHeaderStyle(headerStyles) {
|
|
74
|
+
var _a, _b, _c, _d;
|
|
74
75
|
return {
|
|
75
|
-
orgNameFontSize: (0, pdf_shared_utils_1.readPositiveNumber)(headerStyles === null || headerStyles === void 0 ? void 0 : headerStyles.orgNameFontSize, DEFAULT_ORG_NAME_FONT_SIZE),
|
|
76
|
-
orgNameFontColor: (0, pdf_shared_utils_1.normalizeColor)(headerStyles === null || headerStyles === void 0 ? void 0 : headerStyles.orgNameFontColor, DEFAULT_ORG_NAME_FONT_COLOR),
|
|
77
|
-
orgAddressFontSize: (0, pdf_shared_utils_1.readPositiveNumber)(headerStyles === null || headerStyles === void 0 ? void 0 : headerStyles.orgAddressFontSize, DEFAULT_ORG_ADDRESS_FONT_SIZE),
|
|
78
|
-
orgAddressFontColor: (0, pdf_shared_utils_1.normalizeColor)(headerStyles === null || headerStyles === void 0 ? void 0 : headerStyles.orgAddressFontColor, DEFAULT_ORG_ADDRESS_FONT_COLOR)
|
|
76
|
+
orgNameFontSize: (0, pdf_shared_utils_1.readPositiveNumber)((_a = headerStyles === null || headerStyles === void 0 ? void 0 : headerStyles.orgNameFontSize) !== null && _a !== void 0 ? _a : headerStyles === null || headerStyles === void 0 ? void 0 : headerStyles.OrgNameFsize, DEFAULT_ORG_NAME_FONT_SIZE),
|
|
77
|
+
orgNameFontColor: (0, pdf_shared_utils_1.normalizeColor)((_b = headerStyles === null || headerStyles === void 0 ? void 0 : headerStyles.orgNameFontColor) !== null && _b !== void 0 ? _b : headerStyles === null || headerStyles === void 0 ? void 0 : headerStyles.OrgNameClr, DEFAULT_ORG_NAME_FONT_COLOR),
|
|
78
|
+
orgAddressFontSize: (0, pdf_shared_utils_1.readPositiveNumber)((_c = headerStyles === null || headerStyles === void 0 ? void 0 : headerStyles.orgAddressFontSize) !== null && _c !== void 0 ? _c : headerStyles === null || headerStyles === void 0 ? void 0 : headerStyles.AdrsFsize, DEFAULT_ORG_ADDRESS_FONT_SIZE),
|
|
79
|
+
orgAddressFontColor: (0, pdf_shared_utils_1.normalizeColor)((_d = headerStyles === null || headerStyles === void 0 ? void 0 : headerStyles.orgAddressFontColor) !== null && _d !== void 0 ? _d : headerStyles === null || headerStyles === void 0 ? void 0 : headerStyles.AdrsClr, DEFAULT_ORG_ADDRESS_FONT_COLOR)
|
|
79
80
|
};
|
|
80
81
|
}
|
|
81
82
|
function resolvePageMargins(value) {
|
|
@@ -103,8 +104,13 @@ function buildDocumentHeaderSection(PrintConfig, DocumentData = {}) {
|
|
|
103
104
|
const documentLogoDataUrl = resolveDocumentLogoDataUrl(DocumentData);
|
|
104
105
|
const headerData = normalizeHeaderData((_b = PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.headerData) !== null && _b !== void 0 ? _b : {});
|
|
105
106
|
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), city: (0, pdf_shared_utils_1.firstValue)(entity === null || entity === void 0 ? void 0 : entity.City, (_k = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _k === void 0 ? void 0 : _k.city), state: (0, pdf_shared_utils_1.firstValue)(entity === null || entity === void 0 ? void 0 : entity.State, (_l = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _l === void 0 ? void 0 : _l.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, (_m = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _m === void 0 ? void 0 : _m.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, (_o = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _o === void 0 ? void 0 : _o.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, (_p = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _p === void 0 ? void 0 : _p.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, (_q = headerData === null || headerData === void 0 ? void 0 : headerData.organization) === null || _q === void 0 ? void 0 : _q.phone2) }) }));
|
|
106
|
-
const headerStyles = normalizeHeaderStyle((_r = PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.headerStyles) !== null && _r !== void 0 ? _r : {
|
|
107
|
-
|
|
107
|
+
const headerStyles = normalizeHeaderStyle((_r = PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.headerStyles) !== null && _r !== void 0 ? _r : {
|
|
108
|
+
OrgNameFsize: PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.OrgNameFsize,
|
|
109
|
+
OrgNameClr: PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.OrgNameClr,
|
|
110
|
+
AdrsFsize: PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.AdrsFsize,
|
|
111
|
+
AdrsClr: PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.AdrsClr
|
|
112
|
+
});
|
|
113
|
+
const headerSettings = normalizeHeaderSettings((_t = (_s = PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.header) !== null && _s !== void 0 ? _s : PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.Header) !== null && _t !== void 0 ? _t : {});
|
|
108
114
|
if (!headerSettings.show) {
|
|
109
115
|
return [];
|
|
110
116
|
}
|
|
@@ -7,31 +7,47 @@ const pdf_table_config_1 = require("./pdf-table.config");
|
|
|
7
7
|
function GetTableHeader(itemsHeader) {
|
|
8
8
|
const orderedHeaders = getHeadersBySequence(itemsHeader);
|
|
9
9
|
const toHeaderObject = (item) => {
|
|
10
|
-
var _a, _b, _c, _d, _e, _f;
|
|
10
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
11
|
+
const itemTitle = (_c = (_b = (_a = item === null || item === void 0 ? void 0 : item.title) !== null && _a !== void 0 ? _a : item === null || item === void 0 ? void 0 : item.CustTitle) !== null && _b !== void 0 ? _b : item === null || item === void 0 ? void 0 : item.Tital) !== null && _c !== void 0 ? _c : '';
|
|
12
|
+
const itemWidth = (_d = item === null || item === void 0 ? void 0 : item.width) !== null && _d !== void 0 ? _d : item === null || item === void 0 ? void 0 : item.Width;
|
|
13
|
+
const itemDbFields = (_f = (_e = item === null || item === void 0 ? void 0 : item.dbFields) !== null && _e !== void 0 ? _e : item === null || item === void 0 ? void 0 : item.DBFields) !== null && _f !== void 0 ? _f : [];
|
|
14
|
+
const stackSource = (_g = item === null || item === void 0 ? void 0 : item.stackFields) !== null && _g !== void 0 ? _g : item === null || item === void 0 ? void 0 : item.Stacked;
|
|
15
|
+
const stackTitle = (_j = (_h = stackSource === null || stackSource === void 0 ? void 0 : stackSource.title) !== null && _h !== void 0 ? _h : stackSource === null || stackSource === void 0 ? void 0 : stackSource.Tital) !== null && _j !== void 0 ? _j : null;
|
|
16
|
+
const stackSeq = (_k = stackSource === null || stackSource === void 0 ? void 0 : stackSource.seq) !== null && _k !== void 0 ? _k : stackSource === null || stackSource === void 0 ? void 0 : stackSource.Seq;
|
|
11
17
|
return {
|
|
12
|
-
text:
|
|
13
|
-
width:
|
|
14
|
-
bold: (
|
|
15
|
-
dbFields:
|
|
16
|
-
stackParent:
|
|
17
|
-
stackSeq: typeof
|
|
18
|
+
text: itemTitle,
|
|
19
|
+
width: itemWidth,
|
|
20
|
+
bold: (_l = item.bold) !== null && _l !== void 0 ? _l : true,
|
|
21
|
+
dbFields: itemDbFields,
|
|
22
|
+
stackParent: stackTitle,
|
|
23
|
+
stackSeq: typeof stackSeq === 'number' ? stackSeq : Number.MAX_SAFE_INTEGER
|
|
18
24
|
};
|
|
19
25
|
};
|
|
20
|
-
const visibleHeaders = orderedHeaders.filter((item) => item.show !== false);
|
|
26
|
+
const visibleHeaders = orderedHeaders.filter((item) => { var _a; return ((_a = item === null || item === void 0 ? void 0 : item.show) !== null && _a !== void 0 ? _a : item === null || item === void 0 ? void 0 : item.Show) !== false; });
|
|
21
27
|
const headerRow = visibleHeaders
|
|
22
|
-
.filter((item) => !item.stackFields)
|
|
28
|
+
.filter((item) => { var _a; return !((_a = item === null || item === void 0 ? void 0 : item.stackFields) !== null && _a !== void 0 ? _a : item === null || item === void 0 ? void 0 : item.Stacked); })
|
|
23
29
|
.map((item) => {
|
|
30
|
+
var _a, _b;
|
|
31
|
+
const parentTitle = (_b = (_a = item === null || item === void 0 ? void 0 : item.title) !== null && _a !== void 0 ? _a : item === null || item === void 0 ? void 0 : item.CustTitle) !== null && _b !== void 0 ? _b : item === null || item === void 0 ? void 0 : item.Tital;
|
|
24
32
|
const stackFields = visibleHeaders
|
|
25
|
-
.filter((stackedItem) => {
|
|
33
|
+
.filter((stackedItem) => {
|
|
34
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
35
|
+
const stackedParent = (_f = (_d = (_b = (_a = stackedItem === null || stackedItem === void 0 ? void 0 : stackedItem.stackFields) === null || _a === void 0 ? void 0 : _a.title) !== null && _b !== void 0 ? _b : (_c = stackedItem === null || stackedItem === void 0 ? void 0 : stackedItem.stackFields) === null || _c === void 0 ? void 0 : _c.Tital) !== null && _d !== void 0 ? _d : (_e = stackedItem === null || stackedItem === void 0 ? void 0 : stackedItem.Stacked) === null || _e === void 0 ? void 0 : _e.title) !== null && _f !== void 0 ? _f : (_g = stackedItem === null || stackedItem === void 0 ? void 0 : stackedItem.Stacked) === null || _g === void 0 ? void 0 : _g.Tital;
|
|
36
|
+
return stackedParent === parentTitle;
|
|
37
|
+
})
|
|
26
38
|
.sort((a, b) => {
|
|
27
|
-
var _a, _b;
|
|
28
|
-
const
|
|
29
|
-
const
|
|
39
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
40
|
+
const aSeqRaw = (_f = (_d = (_b = (_a = a === null || a === void 0 ? void 0 : a.stackFields) === null || _a === void 0 ? void 0 : _a.seq) !== null && _b !== void 0 ? _b : (_c = a === null || a === void 0 ? void 0 : a.stackFields) === null || _c === void 0 ? void 0 : _c.Seq) !== null && _d !== void 0 ? _d : (_e = a === null || a === void 0 ? void 0 : a.Stacked) === null || _e === void 0 ? void 0 : _e.seq) !== null && _f !== void 0 ? _f : (_g = a === null || a === void 0 ? void 0 : a.Stacked) === null || _g === void 0 ? void 0 : _g.Seq;
|
|
41
|
+
const bSeqRaw = (_o = (_l = (_j = (_h = b === null || b === void 0 ? void 0 : b.stackFields) === null || _h === void 0 ? void 0 : _h.seq) !== null && _j !== void 0 ? _j : (_k = b === null || b === void 0 ? void 0 : b.stackFields) === null || _k === void 0 ? void 0 : _k.Seq) !== null && _l !== void 0 ? _l : (_m = b === null || b === void 0 ? void 0 : b.Stacked) === null || _m === void 0 ? void 0 : _m.seq) !== null && _o !== void 0 ? _o : (_p = b === null || b === void 0 ? void 0 : b.Stacked) === null || _p === void 0 ? void 0 : _p.Seq;
|
|
42
|
+
const aSeq = typeof aSeqRaw === 'number' ? aSeqRaw : Number.MAX_SAFE_INTEGER;
|
|
43
|
+
const bSeq = typeof bSeqRaw === 'number' ? bSeqRaw : Number.MAX_SAFE_INTEGER;
|
|
30
44
|
if (aSeq !== bSeq) {
|
|
31
45
|
return aSeq - bSeq;
|
|
32
46
|
}
|
|
33
|
-
const
|
|
34
|
-
const
|
|
47
|
+
const aHeaderSeqRaw = (_q = a === null || a === void 0 ? void 0 : a.seq) !== null && _q !== void 0 ? _q : a === null || a === void 0 ? void 0 : a.Seq;
|
|
48
|
+
const bHeaderSeqRaw = (_r = b === null || b === void 0 ? void 0 : b.seq) !== null && _r !== void 0 ? _r : b === null || b === void 0 ? void 0 : b.Seq;
|
|
49
|
+
const aHeaderSeq = typeof aHeaderSeqRaw === 'number' ? aHeaderSeqRaw : Number.MAX_SAFE_INTEGER;
|
|
50
|
+
const bHeaderSeq = typeof bHeaderSeqRaw === 'number' ? bHeaderSeqRaw : Number.MAX_SAFE_INTEGER;
|
|
35
51
|
return aHeaderSeq - bHeaderSeq;
|
|
36
52
|
})
|
|
37
53
|
.map((stackedItem) => toHeaderObject(stackedItem));
|
|
@@ -44,8 +60,11 @@ function getHeadersBySequence(headers) {
|
|
|
44
60
|
return headers
|
|
45
61
|
.map((header, index) => ({ header, index }))
|
|
46
62
|
.sort((a, b) => {
|
|
47
|
-
|
|
48
|
-
const
|
|
63
|
+
var _a, _b, _c, _d, _e, _f;
|
|
64
|
+
const aSeqRaw = (_b = (_a = a === null || a === void 0 ? void 0 : a.header) === null || _a === void 0 ? void 0 : _a.seq) !== null && _b !== void 0 ? _b : (_c = a === null || a === void 0 ? void 0 : a.header) === null || _c === void 0 ? void 0 : _c.Seq;
|
|
65
|
+
const bSeqRaw = (_e = (_d = b === null || b === void 0 ? void 0 : b.header) === null || _d === void 0 ? void 0 : _d.seq) !== null && _e !== void 0 ? _e : (_f = b === null || b === void 0 ? void 0 : b.header) === null || _f === void 0 ? void 0 : _f.Seq;
|
|
66
|
+
const aSeq = typeof aSeqRaw === 'number' ? aSeqRaw : Number.MAX_SAFE_INTEGER;
|
|
67
|
+
const bSeq = typeof bSeqRaw === 'number' ? bSeqRaw : Number.MAX_SAFE_INTEGER;
|
|
49
68
|
if (aSeq !== bSeq) {
|
|
50
69
|
return aSeq - bSeq;
|
|
51
70
|
}
|
|
@@ -18,10 +18,10 @@ function buildDataRow(item, index, headerConfig, fixedTo = 2) {
|
|
|
18
18
|
const serial = String(index + 1);
|
|
19
19
|
return { text: serial, fontSize: pdf_table_config_1.pdfTableStyleConfig.bodyFontSize, alignment: getNumericAlignment(serial) };
|
|
20
20
|
}
|
|
21
|
-
const mainValue = formatNumericLikeValue(getFirstFieldValue(item, header.dbFields), fixedTo);
|
|
21
|
+
const mainValue = formatNumericLikeValue(getFirstFieldValue(item, header.dbFields), fixedTo, shouldSkipFixedTo(header));
|
|
22
22
|
const stackedLines = ((_a = header.stackFields) !== null && _a !== void 0 ? _a : [])
|
|
23
23
|
.map((stackField) => {
|
|
24
|
-
const stackValue = formatNumericLikeValue(getFirstFieldValue(item, stackField.dbFields), fixedTo);
|
|
24
|
+
const stackValue = formatNumericLikeValue(getFirstFieldValue(item, stackField.dbFields), fixedTo, shouldSkipFixedTo(stackField));
|
|
25
25
|
if (!stackValue) {
|
|
26
26
|
return null;
|
|
27
27
|
}
|
|
@@ -113,7 +113,10 @@ function isNumericLike(value) {
|
|
|
113
113
|
function isLeftAlignedHeader(headerText) {
|
|
114
114
|
return headerText === 'Qty' || headerText === 'Offer Qty';
|
|
115
115
|
}
|
|
116
|
-
function formatNumericLikeValue(value, fixedTo) {
|
|
116
|
+
function formatNumericLikeValue(value, fixedTo, skipFixedTo = false) {
|
|
117
|
+
if (skipFixedTo) {
|
|
118
|
+
return value;
|
|
119
|
+
}
|
|
117
120
|
if (!isNumericLike(value)) {
|
|
118
121
|
return value;
|
|
119
122
|
}
|
|
@@ -123,3 +126,15 @@ function formatNumericLikeValue(value, fixedTo) {
|
|
|
123
126
|
}
|
|
124
127
|
return normalized.toFixed(fixedTo);
|
|
125
128
|
}
|
|
129
|
+
function shouldSkipFixedTo(header) {
|
|
130
|
+
var _a;
|
|
131
|
+
const text = String((_a = header === null || header === void 0 ? void 0 : header.text) !== null && _a !== void 0 ? _a : '').trim().toUpperCase();
|
|
132
|
+
if (text === 'HSN/SAC' || text === 'BN' || text === 'BNO') {
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
const dbFields = Array.isArray(header === null || header === void 0 ? void 0 : header.dbFields) ? header.dbFields : [];
|
|
136
|
+
return dbFields.some((field) => {
|
|
137
|
+
const normalized = String(field !== null && field !== void 0 ? field : '').trim().toUpperCase();
|
|
138
|
+
return normalized === 'BN' || normalized === 'BNO' || normalized.endsWith('.BN');
|
|
139
|
+
});
|
|
140
|
+
}
|
|
@@ -14,7 +14,7 @@ const BORDER_WIDTH = 0.5;
|
|
|
14
14
|
function buildInvoiceTableData(PDFInvoiceData, PrintConfig, availableWidth) {
|
|
15
15
|
const items = Array.isArray(PDFInvoiceData === null || PDFInvoiceData === void 0 ? void 0 : PDFInvoiceData.Items) ? PDFInvoiceData.Items : [];
|
|
16
16
|
const services = Array.isArray(PDFInvoiceData === null || PDFInvoiceData === void 0 ? void 0 : PDFInvoiceData.Ops) ? PDFInvoiceData.Ops : [];
|
|
17
|
-
const headerConfig = (0, pdf_table_header_1.GetTableHeader)(PrintConfig.
|
|
17
|
+
const headerConfig = (0, pdf_table_header_1.GetTableHeader)(PrintConfig.TableConfig)[0];
|
|
18
18
|
const renderColumns = (0, pdf_table_header_1.getRenderableColumns)(headerConfig);
|
|
19
19
|
const headerRows = (0, pdf_table_header_1.buildHeaderRows)(headerConfig);
|
|
20
20
|
const fixedTo = resolveFixedTo(PrintConfig === null || PrintConfig === void 0 ? void 0 : PrintConfig.fixedTo);
|