@bookipi/htmlgenerator 1.14.1-alpha.4 → 1.14.1-alpha.6

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/index.js CHANGED
@@ -415,7 +415,7 @@ var en = (_deposit_due$terms$pr = {
415
415
  return "This offer is valid from the date of issue and will expire at the close of business (" + x + "). Acceptance will be in the form of accepting and signing this proposal.";
416
416
  }, _deposit_due$terms$pr.details_line_3 = function details_line_3(x, y, z) {
417
417
  return x + " (" + y + "). " + z;
418
- }, _deposit_due$terms$pr.details_line_3_1 = 'This offer is valid from the date of issue and will expire at the close of business', _deposit_due$terms$pr.details_line_3_2 = 'Acceptance will be in the form of accepting and signing this proposal.', _deposit_due$terms$pr.details_line_4 = "Please accept this proposal and terms of service. This creates a legally binding contract between us. At any time if you have any questions please contact us on the details above. These terms will be effective throughout the period of our engagement and may only be changed by the Parties' agreement in writing.", _deposit_due$terms$pr.supplier_details = 'Supplier Details', _deposit_due$terms$pr.customer_details = 'Customer Details', _deposit_due$terms$pr.effective_date = 'Dated', _deposit_due$terms$pr.supplier_empty = 'No supplier added yet.', _deposit_due$terms$pr.customer_empty = 'No customer added yet.', _deposit_due$terms$pr.kind_regards = 'Kind regards', _deposit_due$terms$pr.services_title = 'Billing Schedule', _deposit_due$terms$pr["total"] = 'Total:', _deposit_due$terms$pr.items_empty = 'No services added yet.', _deposit_due$terms$pr.agreement_title = 'Terms and Conditions', _deposit_due$terms$pr["signature"] = 'Signature', _deposit_due$terms$pr.proposal_id = 'Proposal ID:', _deposit_due$terms$pr.client = 'Client:', _deposit_due$terms$pr.email_addresses = 'Email address:', _deposit_due$terms$pr.ip = 'IP:', _deposit_due$terms$pr.time = 'Time:', _deposit_due$terms$pr.upgradeRequired = 'Upgrade required', _deposit_due$terms$pr.document = 'Document', _deposit_due$terms$pr["invoice"] = 'Invoice', _deposit_due$terms$pr.estimate = 'Estimate', _deposit_due$terms$pr.creditNote = 'Credit Note', _deposit_due$terms$pr.deliveryNote = 'Delivery Note', _deposit_due$terms$pr.purchaseOrder = 'Purchase Order', _deposit_due$terms$pr.Invoice = 'Invoice', _deposit_due$terms$pr["Estimate"] = 'Estimate', _deposit_due$terms$pr.creditnote = 'Credit Note', _deposit_due$terms$pr.service_delivery_date = 'Date of delivery or completion of service', _deposit_due$terms$pr["tax_label"] = 'VAT Rate', _deposit_due$terms$pr.label_siren = 'SIREN', _deposit_due$terms$pr.vat = 'VAT', _deposit_due$terms$pr.total_tax = 'Total tax', _deposit_due$terms$pr.einvoice_tax_code_reverse_charge = 'Reverse charge', _deposit_due$terms$pr.einvoice_tax_code_intra_community = 'Intra-community supply', _deposit_due$terms$pr.einvoice_tax_code_export_non_eu = 'Export outside the EU', _deposit_due$terms$pr.einvoice_tax_code_exempt = 'Exempt', _deposit_due$terms$pr.einvoice_tax_code_out_of_scope = 'Out of scope', _deposit_due$terms$pr.einvoice_vat_due_upon_issue = 'VAT due upon issue', _deposit_due$terms$pr.einvoice_vat_due_upon_payment = 'VAT due upon payment', _deposit_due$terms$pr.item_unit_unit = 'Unit', _deposit_due$terms$pr.item_unit_unit_short = function item_unit_unit_short(n) {
418
+ }, _deposit_due$terms$pr.details_line_3_1 = 'This offer is valid from the date of issue and will expire at the close of business', _deposit_due$terms$pr.details_line_3_2 = 'Acceptance will be in the form of accepting and signing this proposal.', _deposit_due$terms$pr.details_line_4 = "Please accept this proposal and terms of service. This creates a legally binding contract between us. At any time if you have any questions please contact us on the details above. These terms will be effective throughout the period of our engagement and may only be changed by the Parties' agreement in writing.", _deposit_due$terms$pr.supplier_details = 'Supplier Details', _deposit_due$terms$pr.customer_details = 'Customer Details', _deposit_due$terms$pr.effective_date = 'Dated', _deposit_due$terms$pr.supplier_empty = 'No supplier added yet.', _deposit_due$terms$pr.customer_empty = 'No customer added yet.', _deposit_due$terms$pr.kind_regards = 'Kind regards', _deposit_due$terms$pr.services_title = 'Billing Schedule', _deposit_due$terms$pr["total"] = 'Total:', _deposit_due$terms$pr.items_empty = 'No services added yet.', _deposit_due$terms$pr.agreement_title = 'Terms and Conditions', _deposit_due$terms$pr["signature"] = 'Signature', _deposit_due$terms$pr.proposal_id = 'Proposal ID:', _deposit_due$terms$pr.client = 'Client:', _deposit_due$terms$pr.email_addresses = 'Email address:', _deposit_due$terms$pr.ip = 'IP:', _deposit_due$terms$pr.time = 'Time:', _deposit_due$terms$pr.upgradeRequired = 'Upgrade required', _deposit_due$terms$pr.document = 'Document', _deposit_due$terms$pr["invoice"] = 'Invoice', _deposit_due$terms$pr.estimate = 'Estimate', _deposit_due$terms$pr.creditNote = 'Credit Note', _deposit_due$terms$pr.deliveryNote = 'Delivery Note', _deposit_due$terms$pr.purchaseOrder = 'Purchase Order', _deposit_due$terms$pr.Invoice = 'Invoice', _deposit_due$terms$pr["Estimate"] = 'Estimate', _deposit_due$terms$pr.creditnote = 'Credit Note', _deposit_due$terms$pr.service_delivery_date = 'Date of delivery or completion of service', _deposit_due$terms$pr.einvoice_tax_label = 'VAT Rate', _deposit_due$terms$pr.label_siren = 'SIREN', _deposit_due$terms$pr.vat = 'VAT', _deposit_due$terms$pr.total_tax = 'Total tax', _deposit_due$terms$pr.einvoice_tax_code_reverse_charge = 'Reverse charge', _deposit_due$terms$pr.einvoice_tax_code_intra_community = 'Intra-community supply', _deposit_due$terms$pr.einvoice_tax_code_export_non_eu = 'Export outside the EU', _deposit_due$terms$pr.einvoice_tax_code_exempt = 'Exempt', _deposit_due$terms$pr.einvoice_tax_code_out_of_scope = 'Out of scope', _deposit_due$terms$pr.einvoice_vat_due_upon_issue = 'VAT due upon issue', _deposit_due$terms$pr.einvoice_vat_due_upon_payment = 'VAT due upon payment', _deposit_due$terms$pr.item_unit_unit = 'Unit', _deposit_due$terms$pr.item_unit_unit_short = function item_unit_unit_short(n) {
419
419
  return n === 1 ? 'unit' : 'units';
420
420
  }, _deposit_due$terms$pr.item_unit_piece = 'Piece', _deposit_due$terms$pr.item_unit_piece_short = function item_unit_piece_short(n) {
421
421
  return n === 1 ? 'pc' : 'pcs';
@@ -11975,7 +11975,8 @@ var DEFAULT_CONFIG = {
11975
11975
 
11976
11976
  /** French e-invoice rules; other French documents use the default config. */
11977
11977
  var FRANCE_E_INVOICE_CONFIG = {
11978
- // Our server rejects a negative subtotal before the PDP; Factur-X lines are clamped to 0.
11978
+ // Our server rejects a negative subtotal before the PDP, so a line discount stops at 0. A
11979
+ // negative price stays a negative line; Factur-X writes it as a negative quantity (BR-27).
11979
11980
  allowNegativeLines: false,
11980
11981
  // Factur-X has no after-tax discount, so the app hides "After-tax" on French e-invoices.
11981
11982
  allowDiscountAfterTax: false,
@@ -12061,7 +12062,9 @@ var getCountryConfig = function getCountryConfig(countryCode, _temp) {
12061
12062
  var code = (countryCode || "").toUpperCase();
12062
12063
  return _extends$1({}, DEFAULT_CONFIG, COUNTRY_CONFIGS[code] && _extends$1({
12063
12064
  countryCode: code
12064
- }, COUNTRY_CONFIGS[code]), eInvoice && E_INVOICE_CONFIGS[code]);
12065
+ }, COUNTRY_CONFIGS[code]), eInvoice && E_INVOICE_CONFIGS[code] && _extends$1({
12066
+ countryCode: code
12067
+ }, E_INVOICE_CONFIGS[code]));
12065
12068
  };
12066
12069
 
12067
12070
  /** E-invoice tax codes per country; a country listed here taxes its e-invoices by code. */
@@ -13866,9 +13869,10 @@ var currencies = {
13866
13869
 
13867
13870
  var currencyTable = currencies;
13868
13871
 
13869
- /** The code when it is a known currency, otherwise USD. */
13872
+ /** The upper-case code when it is a known currency, otherwise USD. */
13870
13873
  var getCurrencyCode = function getCurrencyCode(currencyCode) {
13871
- return currencyCode && currencyTable[currencyCode] ? currencyCode : "USD";
13874
+ var code = (currencyCode || "").toUpperCase();
13875
+ return currencyTable[code] ? code : "USD";
13872
13876
  };
13873
13877
 
13874
13878
  /** Digits after the decimal point. Unknown codes use USD. */
@@ -13984,14 +13988,29 @@ var calculateAdjustment = function calculateAdjustment(adjustment, base) {
13984
13988
  };
13985
13989
 
13986
13990
  /**
13987
- * Splits `amount` across `weights` pro rata; no share exceeds its weight, and weights ≤ 0 get none.
13991
+ * Splits `amount` across `weights` pro rata; no share exceeds its weight, and weights of the
13992
+ * other sign (or 0) get none. A negative amount (a discount on a negative document) is split
13993
+ * over the negative weights the same way.
13988
13994
  * With `decimals`, shares are rounded so they still add up exactly (largest remainder method).
13989
13995
  */
13990
- var allocateProportionally = function allocateProportionally(amount, weights, decimals) {
13996
+ var _allocateProportionally = function allocateProportionally(amount, weights, decimals) {
13997
+ if (amount.lt(0)) {
13998
+ var _allocateProportional = _allocateProportionally(amount.neg(), weights.map(function (weight) {
13999
+ return weight.neg();
14000
+ }), decimals),
14001
+ shares = _allocateProportional.shares,
14002
+ excess = _allocateProportional.excess;
14003
+ return {
14004
+ shares: shares.map(function (share) {
14005
+ return share.neg();
14006
+ }),
14007
+ excess: excess.neg()
14008
+ };
14009
+ }
13991
14010
  var noShares = weights.map(function () {
13992
14011
  return ZERO;
13993
14012
  });
13994
- if (amount.lte(0)) return {
14013
+ if (amount.eq(0)) return {
13995
14014
  shares: noShares,
13996
14015
  excess: ZERO
13997
14016
  };
@@ -14059,10 +14078,11 @@ var allocateDocumentDiscount = function allocateDocumentDiscount(_ref) {
14059
14078
  shipping = _ref.shipping,
14060
14079
  decimals = _ref.decimals;
14061
14080
  var taxableDiscount = documentDiscount != null && documentDiscount.afterTax ? ZERO : discount;
14062
- var _allocateProportional = allocateProportionally(taxableDiscount, lineAmounts, decimals),
14081
+ var _allocateProportional = _allocateProportionally(taxableDiscount, lineAmounts, decimals),
14063
14082
  shares = _allocateProportional.shares,
14064
14083
  excess = _allocateProportional.excess;
14065
- var shippingShare = shipping.gt(0) ? excess.gt(shipping) ? shipping : excess : ZERO;
14084
+ // Only a positive discount left over lowers a positive shipping cost.
14085
+ var shippingShare = shipping.gt(0) && excess.gt(0) ? excess.gt(shipping) ? shipping : excess : ZERO;
14066
14086
  return {
14067
14087
  lineShares: shares,
14068
14088
  shippingShare: shippingShare
@@ -14092,6 +14112,7 @@ var calculatePaymentSummary = function calculatePaymentSummary(_ref) {
14092
14112
  total = _ref.total,
14093
14113
  decimals = _ref.decimals,
14094
14114
  isInvoice = _ref.isInvoice,
14115
+ hasLines = _ref.hasLines,
14095
14116
  round = _ref.round;
14096
14117
  var surchargeRate;
14097
14118
  var totalPayment = round(sumMonetaryDecimals(payments.map(function (payment) {
@@ -14108,9 +14129,9 @@ var calculatePaymentSummary = function calculatePaymentSummary(_ref) {
14108
14129
  var amountAfterPayment = amountBeforePayment.minus(totalPayment);
14109
14130
 
14110
14131
  // Within one minor unit counts as fully paid, matching the legacy +0.01 tolerance.
14111
- // No payment counts as not paid.
14132
+ // Nothing owed (e.g. a 100% discount) is paid; an empty document with no payment is not.
14112
14133
  var tolerance = new MonetaryDecimal(10).pow(-decimals);
14113
- var isPaid = totalPayment.gt(0) && totalPayment.plus(tolerance).gte(amountBeforePayment);
14134
+ var isPaid = (totalPayment.gt(0) || hasLines && amountBeforePayment.lte(0)) && totalPayment.plus(tolerance).gte(amountBeforePayment);
14114
14135
  var paymentStatus = isPaid ? 2 : totalPayment.eq(0) ? 0 : 1;
14115
14136
  return {
14116
14137
  totalPayment: totalPayment,
@@ -14401,6 +14422,7 @@ var calculate = function calculate(document, options) {
14401
14422
  total: total,
14402
14423
  decimals: decimals,
14403
14424
  isInvoice: !!document.isInvoice,
14425
+ hasLines: lineItems.length > 0,
14404
14426
  round: round
14405
14427
  });
14406
14428
  return {
@@ -14764,21 +14786,43 @@ var calculateEN16931Totals = function calculateEN16931Totals(document, company)
14764
14786
  if (eInvoiceStandard !== "en16931") {
14765
14787
  throw new Error("calculateEN16931Totals: \"" + (countryCode || "") + "\" has no EN 16931 e-invoice.");
14766
14788
  }
14789
+ var taxCodes = getTaxCodes(countryCode);
14790
+ var findTaxCode = function findTaxCode(code) {
14791
+ return taxCodes.find(function (taxCode) {
14792
+ return taxCode.code === code;
14793
+ });
14794
+ };
14795
+ // Every amount needs a listed code: an uncoded line has no VAT breakdown, and an unlisted
14796
+ // code has no VAT category, so the totals would not reconcile. Untaxed shipping keeps no
14797
+ // code (toCalcDocument drops it; it is reported as untaxedChargeTaxCode), so it is not checked.
14798
+ var lineItems = readField(document.it, document.items) || [];
14799
+ var shippingNonTaxable = !!readField(document.sntx, document.shippingNonTax);
14800
+ var shippingTaxCode = shippingNonTaxable ? null : document.shippingTaxCode;
14801
+ var unlistedCodes = [].concat(lineItems.map(function (lineItem) {
14802
+ return lineItem.taxCode;
14803
+ }), shippingTaxCode || !shippingNonTaxable && toMonetaryDecimal(readField(document.sp, document.shippingCost)).gt(0) ? [shippingTaxCode] : []).filter(function (code) {
14804
+ return !findTaxCode(code);
14805
+ });
14806
+ if (unlistedCodes.length > 0) {
14807
+ throw new Error("calculateEN16931Totals: every line needs a \"" + countryCode + "\" tax code; got " + unlistedCodes.map(function (code) {
14808
+ return JSON.stringify(code != null ? code : null);
14809
+ }).join(", ") + ".");
14810
+ }
14767
14811
  var _calculateDocumentWit = calculateDocumentWith(document, company, {}, {
14768
14812
  eInvoice: true,
14769
14813
  taxCodeRates: getTaxCodeRates(countryCode)
14770
14814
  }),
14771
14815
  calculation = _calculateDocumentWit.result;
14816
+ // A discount past the items and shipping leaves a negative total on zero tax bases, which
14817
+ // cannot reconcile (BT-112 = BT-109 + BT-110); that is a credit note, not an invoice.
14818
+ var discountable = new MonetaryDecimal(calculation.subtotal).plus(calculation.shipping);
14819
+ if (new MonetaryDecimal(calculation.discount).gt(discountable)) {
14820
+ throw new Error("calculateEN16931Totals: the discount (" + calculation.discount + ") is more than the items and shipping (" + discountable.toNumber() + ").");
14821
+ }
14772
14822
  var decimals = calculation.decimals;
14773
14823
  var round = function round(amount) {
14774
14824
  return roundMonetaryDecimal(amount, decimals, calculation.config.roundingMethod);
14775
14825
  };
14776
- var taxCodes = getTaxCodes(countryCode);
14777
- var findTaxCode = function findTaxCode(code) {
14778
- return taxCodes.find(function (taxCode) {
14779
- return taxCode.code === code;
14780
- });
14781
- };
14782
14826
 
14783
14827
  // EN 16931 needs the line nets to add up to their tax code's basis to the cent.
14784
14828
  var lineNets = calculation.lines.map(function (line) {
@@ -14853,15 +14897,15 @@ var calculateEN16931Totals = function calculateEN16931Totals(document, company)
14853
14897
  return {
14854
14898
  currency: calculation.currency,
14855
14899
  decimals: decimals,
14900
+ // Every line has exactly one tax: its code, checked above.
14856
14901
  lines: calculation.lines.map(function (line) {
14857
- var _line$taxes$, _line$taxes$0$rate, _line$taxes$2, _line$taxes$3;
14858
14902
  return {
14859
14903
  index: line.index,
14860
14904
  net: lineNets[line.index].toNumber(),
14861
14905
  documentDiscount: line.documentDiscount,
14862
- taxCode: (_line$taxes$ = line.taxes[0]) == null ? void 0 : _line$taxes$.code,
14863
- rate: (_line$taxes$0$rate = (_line$taxes$2 = line.taxes[0]) == null ? void 0 : _line$taxes$2.rate) != null ? _line$taxes$0$rate : 0,
14864
- inclusive: !!((_line$taxes$3 = line.taxes[0]) != null && _line$taxes$3.inclusive)
14906
+ taxCode: line.taxes[0].code,
14907
+ rate: line.taxes[0].rate,
14908
+ inclusive: line.taxes[0].inclusive
14865
14909
  };
14866
14910
  }),
14867
14911
  shipping: shipping,
@@ -14920,11 +14964,13 @@ var calculateProposal = function calculateProposal(proposal, company) {
14920
14964
  company = {};
14921
14965
  }
14922
14966
  var decimals = getCurrencyDecimals(company.cr || company.currency);
14967
+ var _getCountryConfig = getCountryConfig(company.co || company.country),
14968
+ roundingMethod = _getCountryConfig.roundingMethod;
14923
14969
  var serviceItems = proposal.serviceItems,
14924
14970
  proposalFields = _objectWithoutPropertiesLoose(proposal, _excluded$1);
14925
14971
  var lineItems = (serviceItems || []).map(function (serviceItem) {
14926
14972
  var discountPercentage = toMonetaryDecimal(serviceItem.discountPercentage);
14927
- var discount = discountPercentage.gt(0) ? roundMonetaryDecimal(toMonetaryDecimal(serviceItem.price).times(toMonetaryDecimal(isBlank(serviceItem.quantity) ? 1 : serviceItem.quantity)).times(discountPercentage).div(100), decimals, "half-up").toNumber() : serviceItem.discount;
14973
+ var discount = discountPercentage.gt(0) ? roundMonetaryDecimal(toMonetaryDecimal(serviceItem.price).times(toMonetaryDecimal(isBlank(serviceItem.quantity) ? 1 : serviceItem.quantity)).times(discountPercentage).div(100), decimals, roundingMethod).toNumber() : serviceItem.discount;
14928
14974
  return {
14929
14975
  price: serviceItem.price,
14930
14976
  quantity: serviceItem.quantity,
@@ -17826,7 +17872,7 @@ var frConfig = {
17826
17872
  onLabelKey: 'einvoice_vat_due_upon_issue',
17827
17873
  offLabelKey: 'einvoice_vat_due_upon_payment'
17828
17874
  },
17829
- taxLabel: 'tax_label',
17875
+ taxLabel: 'einvoice_tax_label',
17830
17876
  itemUnitType: true,
17831
17877
  itemTaxCodes: true,
17832
17878
  taxCodeRates: calc.getTaxCodeRates('FR'),
@@ -18068,6 +18114,9 @@ var toCalcCompany = function toCalcCompany(company, currencyCode) {
18068
18114
  var calculateDocument$1 = function calculateDocument(document, company, currencyCode) {
18069
18115
  return calc.calculateDocument(document, toCalcCompany(company, currencyCode));
18070
18116
  };
18117
+ var getCalculationContext$1 = function getCalculationContext(document, company) {
18118
+ return calc.getCalculationContext(document, toCalcCompany(company));
18119
+ };
18071
18120
  var calculateTaxCodeBreakdown$1 = function calculateTaxCodeBreakdown(document, company, currencyCode) {
18072
18121
  return calc.calculateTaxCodeBreakdown(document, toCalcCompany(company, currencyCode));
18073
18122
  };
@@ -18173,6 +18222,9 @@ var getTaxCodeBreakdown = function getTaxCodeBreakdown(document, company, curren
18173
18222
  var _ref = _temp === void 0 ? {} : _temp,
18174
18223
  _ref$calculationRevam = _ref.calculationRevamp,
18175
18224
  calculationRevamp = _ref$calculationRevam === void 0 ? true : _ref$calculationRevam;
18225
+ if (!getCalculationContext$1(document, company).taxCodeRates) {
18226
+ return [];
18227
+ }
18176
18228
  if (!calculationRevamp) {
18177
18229
  return getOldTaxCodeBreakdown(document, company, currencyCode);
18178
18230
  }
@@ -18506,9 +18558,9 @@ var InvoiceContent = function InvoiceContent(_ref) {
18506
18558
  taxName2 = _getTaxDetails.taxName2,
18507
18559
  taxIncluded2 = _getTaxDetails.taxIncluded2;
18508
18560
  var eInvoiceConfig = getEInvoiceConfig(company.co);
18509
- var eInvoiceTaxLabel = eInvoiceConfig !== null && eInvoiceConfig !== void 0 && eInvoiceConfig.taxLabel ? defaultLang[eInvoiceConfig.taxLabel] : null;
18510
- var displayTaxName1 = eInvoiceTaxLabel != null ? eInvoiceTaxLabel : taxName1;
18511
- var displayTaxName2 = eInvoiceTaxLabel != null ? eInvoiceTaxLabel : taxName2;
18561
+ var eInvoiceTaxLabel = document.eInvoicing && eInvoiceConfig !== null && eInvoiceConfig !== void 0 && eInvoiceConfig.taxLabel ? defaultLang[eInvoiceConfig.taxLabel] : null;
18562
+ var displayTaxName1 = document.tn ? taxName1 : eInvoiceTaxLabel != null ? eInvoiceTaxLabel : taxName1;
18563
+ var displayTaxName2 = document.tn2 ? taxName2 : eInvoiceTaxLabel != null ? eInvoiceTaxLabel : taxName2;
18512
18564
  var timeZone = company.tz;
18513
18565
  var formatDate = function formatDate(date) {
18514
18566
  return getFormatDate({
@@ -18991,7 +19043,7 @@ var getDefaultLang = function getDefaultLang(t, lang) {
18991
19043
  siren: t ? t('label_siren') : lang['label_siren'],
18992
19044
  vat: t ? t('vat') : lang['vat'],
18993
19045
  serviceDeliveryDate: t ? t('service_delivery_date') : lang['service_delivery_date'],
18994
- tax_label: t ? t('tax_label') : lang['tax_label'],
19046
+ einvoice_tax_label: lang['einvoice_tax_label'],
18995
19047
  einvoice_vat_due_upon_issue: t ? t('einvoice_vat_due_upon_issue') : lang['einvoice_vat_due_upon_issue'],
18996
19048
  einvoice_vat_due_upon_payment: t ? t('einvoice_vat_due_upon_payment') : lang['einvoice_vat_due_upon_payment'],
18997
19049
  total_tax: t ? t('total_tax') : lang['total_tax'],
@@ -19438,9 +19490,9 @@ var InvoiceContent$1 = function InvoiceContent(_ref) {
19438
19490
  taxName2 = _getTaxDetails.taxName2,
19439
19491
  taxIncluded2 = _getTaxDetails.taxIncluded2;
19440
19492
  var eInvoiceConfig = getEInvoiceConfig(company.co);
19441
- var eInvoiceTaxLabel = eInvoiceConfig !== null && eInvoiceConfig !== void 0 && eInvoiceConfig.taxLabel ? defaultLang[eInvoiceConfig.taxLabel] : null;
19442
- var displayTaxName1 = eInvoiceTaxLabel != null ? eInvoiceTaxLabel : taxName1;
19443
- var displayTaxName2 = eInvoiceTaxLabel != null ? eInvoiceTaxLabel : taxName2;
19493
+ var eInvoiceTaxLabel = document.eInvoicing && eInvoiceConfig !== null && eInvoiceConfig !== void 0 && eInvoiceConfig.taxLabel ? defaultLang[eInvoiceConfig.taxLabel] : null;
19494
+ var displayTaxName1 = document.tn ? taxName1 : eInvoiceTaxLabel != null ? eInvoiceTaxLabel : taxName1;
19495
+ var displayTaxName2 = document.tn2 ? taxName2 : eInvoiceTaxLabel != null ? eInvoiceTaxLabel : taxName2;
19444
19496
  var timeZone = company.tz;
19445
19497
  var formatDate = function formatDate(date) {
19446
19498
  return getFormatDate({