shareneus 1.6.1 → 1.6.3
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.
|
@@ -4,9 +4,7 @@ export declare function buildInvoicePartyDetailsSection(PDFInvoiceData: any, cus
|
|
|
4
4
|
}[] | {
|
|
5
5
|
columns: {
|
|
6
6
|
width: string;
|
|
7
|
-
stack: any[]
|
|
8
|
-
svg: any;
|
|
9
|
-
};
|
|
7
|
+
stack: any[];
|
|
10
8
|
}[];
|
|
11
9
|
columnGap: number;
|
|
12
10
|
margin: number[];
|
|
@@ -17,9 +15,7 @@ export declare function buildSalesPartyDetailsSection(PDFInvoiceData: any, custo
|
|
|
17
15
|
}[] | {
|
|
18
16
|
columns: {
|
|
19
17
|
width: string;
|
|
20
|
-
stack: any[]
|
|
21
|
-
svg: any;
|
|
22
|
-
};
|
|
18
|
+
stack: any[];
|
|
23
19
|
}[];
|
|
24
20
|
columnGap: number;
|
|
25
21
|
margin: number[];
|
|
@@ -30,9 +26,7 @@ export declare function buildPurchasePartyDetailsSection(PDFInvoiceData: any, cu
|
|
|
30
26
|
}[] | {
|
|
31
27
|
columns: {
|
|
32
28
|
width: string;
|
|
33
|
-
stack: any[]
|
|
34
|
-
svg: any;
|
|
35
|
-
};
|
|
29
|
+
stack: any[];
|
|
36
30
|
}[];
|
|
37
31
|
columnGap: number;
|
|
38
32
|
margin: number[];
|
|
@@ -60,7 +60,7 @@ function buildPartyDetailsSectionLayout(config) {
|
|
|
60
60
|
: [{ text: '' }];
|
|
61
61
|
const secondaryStack = ((_b = config === null || config === void 0 ? void 0 : config.secondaryParty) === null || _b === void 0 ? void 0 : _b.hasData)
|
|
62
62
|
? buildPartyStack(config.secondaryTitle, config.secondaryParty, config.customerLayout)
|
|
63
|
-
: ((config === null || config === void 0 ? void 0 : config.shouldShowSecondaryBarcode) ?
|
|
63
|
+
: ((config === null || config === void 0 ? void 0 : config.shouldShowSecondaryBarcode) ? buildBarcodeStack(config === null || config === void 0 ? void 0 : config.secondaryBarcodeCode) : [{ text: '' }]);
|
|
64
64
|
const otherDetailsStack = ((_c = config === null || config === void 0 ? void 0 : config.otherDetails) === null || _c === void 0 ? void 0 : _c.hasData) ? buildOtherDetailsStack(config.otherDetails) : [{ text: '' }];
|
|
65
65
|
const hasAnyData = ((_d = config === null || config === void 0 ? void 0 : config.primaryParty) === null || _d === void 0 ? void 0 : _d.hasData)
|
|
66
66
|
|| ((_e = config === null || config === void 0 ? void 0 : config.secondaryParty) === null || _e === void 0 ? void 0 : _e.hasData)
|
|
@@ -312,21 +312,6 @@ function buildOtherDetailsStack(otherDetails) {
|
|
|
312
312
|
}
|
|
313
313
|
return stack;
|
|
314
314
|
}
|
|
315
|
-
function GetBarCode(code) {
|
|
316
|
-
// if (!TrUtils.IsNull(code)) {
|
|
317
|
-
return { svg: textToSvgBarcode(code).svg };
|
|
318
|
-
// } else {
|
|
319
|
-
// return {};
|
|
320
|
-
// }
|
|
321
|
-
}
|
|
322
|
-
function textToSvgBarcode(text) {
|
|
323
|
-
const svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
324
|
-
(0, jsbarcode_1.default)(svgElement, text, {
|
|
325
|
-
format: "CODE128", width: 1.25, height: 20, margin: 0, marginTop: 8,
|
|
326
|
-
displayValue: true, fontSize: 7, textMargin: 0, fontOptions: 'bold'
|
|
327
|
-
});
|
|
328
|
-
return { svg: svgElement.outerHTML };
|
|
329
|
-
}
|
|
330
315
|
function buildBarcodeStack(code) {
|
|
331
316
|
const svg = textToSvgBarcode(code);
|
|
332
317
|
if (!svg) {
|
|
@@ -335,8 +320,7 @@ function buildBarcodeStack(code) {
|
|
|
335
320
|
return [
|
|
336
321
|
{
|
|
337
322
|
svg,
|
|
338
|
-
width:
|
|
339
|
-
fontSize: 8,
|
|
323
|
+
width: 72,
|
|
340
324
|
alignment: 'center',
|
|
341
325
|
margin: [0, 0, 0, 0]
|
|
342
326
|
}
|
|
@@ -456,24 +440,24 @@ function isTruthy(value) {
|
|
|
456
440
|
}
|
|
457
441
|
return false;
|
|
458
442
|
}
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
443
|
+
function textToSvgBarcode(text) {
|
|
444
|
+
if (!text || typeof document === 'undefined') {
|
|
445
|
+
return '';
|
|
446
|
+
}
|
|
447
|
+
const svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
448
|
+
(0, jsbarcode_1.default)(svgElement, text, {
|
|
449
|
+
format: "CODE128",
|
|
450
|
+
width: 0.6,
|
|
451
|
+
height: 12,
|
|
452
|
+
margin: 0,
|
|
453
|
+
marginTop: 0,
|
|
454
|
+
displayValue: true,
|
|
455
|
+
fontSize: 5,
|
|
456
|
+
textMargin: 0,
|
|
457
|
+
fontOptions: 'bold'
|
|
458
|
+
});
|
|
459
|
+
return svgElement.outerHTML;
|
|
460
|
+
}
|
|
477
461
|
function resolvePhoneFromContacts(contacts) {
|
|
478
462
|
if (!Array.isArray(contacts)) {
|
|
479
463
|
return { type: '', number: '' };
|