shareneus 1.5.96 → 1.5.98
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.
|
@@ -18,7 +18,7 @@ function buildSalesPartyDetailsSection(PDFInvoiceData, customerLayout, printConf
|
|
|
18
18
|
const insurance = resolveInsuranceDetails(transactionData);
|
|
19
19
|
const useInsurance = !!insurance.name;
|
|
20
20
|
const secondaryParty = useInsurance ? insurance : shipTo;
|
|
21
|
-
const showBarCode = resolveShowBarCode(transactionData);
|
|
21
|
+
const showBarCode = resolveShowBarCode(transactionData, printConfig);
|
|
22
22
|
const billToCode = resolveBillToCode(transactionData);
|
|
23
23
|
const otherDetails = resolveOtherDetails(transactionData, printConfig);
|
|
24
24
|
const shouldShowSecondaryBarcode = !secondaryParty.hasData && showBarCode && !!billToCode;
|
|
@@ -38,7 +38,7 @@ function buildPurchasePartyDetailsSection(PDFInvoiceData, customerLayout, printC
|
|
|
38
38
|
const transactionData = PDFInvoiceData || {};
|
|
39
39
|
const billTo = resolvePurchaseBFromDetails(transactionData);
|
|
40
40
|
const shipFrom = resolvePurchaseShipFromDetails(transactionData);
|
|
41
|
-
const showBarCode = resolveShowBarCode(transactionData);
|
|
41
|
+
const showBarCode = resolveShowBarCode(transactionData, printConfig);
|
|
42
42
|
const billToCode = resolvePurchaseBillToCode(transactionData);
|
|
43
43
|
const otherDetails = resolvePurchaseOtherDetails(transactionData, printConfig);
|
|
44
44
|
const shouldShowSecondaryBarcode = !shipFrom.hasData && showBarCode && !!billToCode;
|
|
@@ -320,8 +320,8 @@ function buildBarcodeStack(code) {
|
|
|
320
320
|
return [
|
|
321
321
|
{
|
|
322
322
|
svg,
|
|
323
|
-
width:
|
|
324
|
-
margin: [0,
|
|
323
|
+
width: 110,
|
|
324
|
+
margin: [0, 0, 0, 0]
|
|
325
325
|
}
|
|
326
326
|
];
|
|
327
327
|
}
|
|
@@ -400,9 +400,14 @@ function formatDisplayDate(value) {
|
|
|
400
400
|
}
|
|
401
401
|
return value;
|
|
402
402
|
}
|
|
403
|
-
function resolveShowBarCode(transactionData) {
|
|
404
|
-
var _a;
|
|
405
|
-
|
|
403
|
+
function resolveShowBarCode(transactionData, printConfig = {}) {
|
|
404
|
+
var _a, _b;
|
|
405
|
+
if (Object.prototype.hasOwnProperty.call(printConfig || {}, 'Customer')) {
|
|
406
|
+
return isTruthy((_a = printConfig === null || printConfig === void 0 ? void 0 : printConfig.Customer) === null || _a === void 0 ? void 0 : _a.ShowBarCode);
|
|
407
|
+
}
|
|
408
|
+
return isTruthy(transactionData === null || transactionData === void 0 ? void 0 : transactionData.ShowBarCode)
|
|
409
|
+
|| isTruthy((_b = transactionData === null || transactionData === void 0 ? void 0 : transactionData.Entity) === null || _b === void 0 ? void 0 : _b.PrCustBar)
|
|
410
|
+
|| isTruthy(transactionData === null || transactionData === void 0 ? void 0 : transactionData.PrCustBar);
|
|
406
411
|
}
|
|
407
412
|
function resolveBillToCode(transactionData) {
|
|
408
413
|
var _a, _b, _c;
|
|
@@ -441,12 +446,12 @@ function textToSvgBarcode(text) {
|
|
|
441
446
|
const svgElement = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
442
447
|
(0, jsbarcode_1.default)(svgElement, text, {
|
|
443
448
|
format: "CODE128",
|
|
444
|
-
width:
|
|
445
|
-
height:
|
|
449
|
+
width: 0.8,
|
|
450
|
+
height: 14,
|
|
446
451
|
margin: 0,
|
|
447
|
-
marginTop:
|
|
452
|
+
marginTop: 0,
|
|
448
453
|
displayValue: true,
|
|
449
|
-
fontSize:
|
|
454
|
+
fontSize: 6,
|
|
450
455
|
textMargin: 0,
|
|
451
456
|
fontOptions: 'bold'
|
|
452
457
|
});
|