shareneus 1.5.95 → 1.5.97

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;
@@ -400,9 +400,14 @@ function formatDisplayDate(value) {
400
400
  }
401
401
  return value;
402
402
  }
403
- function resolveShowBarCode(transactionData) {
403
+ function resolveShowBarCode(transactionData, printConfig = {}) {
404
404
  var _a;
405
- return isTruthy(transactionData === null || transactionData === void 0 ? void 0 : transactionData.ShowBarCode) || isTruthy((_a = transactionData === null || transactionData === void 0 ? void 0 : transactionData.Entity) === null || _a === void 0 ? void 0 : _a.PrCustBar) || isTruthy(transactionData === null || transactionData === void 0 ? void 0 : transactionData.PrCustBar);
405
+ if (Object.prototype.hasOwnProperty.call(printConfig || {}, 'ShowBarCode')) {
406
+ return isTruthy(printConfig === null || printConfig === void 0 ? void 0 : printConfig.ShowBarCode);
407
+ }
408
+ return isTruthy(transactionData === null || transactionData === void 0 ? void 0 : transactionData.ShowBarCode)
409
+ || isTruthy((_a = transactionData === null || transactionData === void 0 ? void 0 : transactionData.Entity) === null || _a === void 0 ? void 0 : _a.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;
@@ -442,7 +447,7 @@ function textToSvgBarcode(text) {
442
447
  (0, jsbarcode_1.default)(svgElement, text, {
443
448
  format: "CODE128",
444
449
  width: 1.25,
445
- height: 24,
450
+ height: 20,
446
451
  margin: 0,
447
452
  marginTop: 6,
448
453
  displayValue: true,
@@ -455,7 +455,7 @@ function hasDisplayValue(value) {
455
455
  return true;
456
456
  }
457
457
  function resolveTotals(invoiceData, totalTax, printConfigData = {}) {
458
- const subtotal = (0, pdf_table_section_1.readNumericValue)(invoiceData, ['SubTotal', 'SubTot', 'TaxableAmount', 'TaxableValue']);
458
+ const subtotal = (0, pdf_table_section_1.readNumericValue)(invoiceData, ['STotal', 'SubTotal', 'SubTot', 'TaxableAmount', 'TaxableValue']);
459
459
  const showDetailedDisc = isTruthy((0, pdf_shared_utils_1.firstValue)(printConfigData === null || printConfigData === void 0 ? void 0 : printConfigData.ShowDetailedDisc));
460
460
  const itemsDiscount = parseNumber((0, pdf_shared_utils_1.firstValue)(invoiceData === null || invoiceData === void 0 ? void 0 : invoiceData.PDisc));
461
461
  const servicesDiscount = parseNumber((0, pdf_shared_utils_1.firstValue)(invoiceData === null || invoiceData === void 0 ? void 0 : invoiceData.LDisc));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shareneus",
3
- "version": "1.5.95",
3
+ "version": "1.5.97",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",