@bookipi/htmlgenerator 1.1.31-alpha1 → 1.1.31-alpha3

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.
@@ -205,6 +205,15 @@ var currencies = {
205
205
  code: "BOB",
206
206
  name_plural: "Bolivian bolivianos"
207
207
  },
208
+ BSD: {
209
+ symbol: "B$",
210
+ name: "Bahamian Dollar",
211
+ symbol_native: "B$",
212
+ decimal_digits: 2,
213
+ rounding: 0,
214
+ code: "BSD",
215
+ name_plural: "Bahamian dollar"
216
+ },
208
217
  BRL: {
209
218
  symbol: "R$",
210
219
  name: "Brazilian Real",
@@ -1593,8 +1602,7 @@ var roundNumber = function roundNumber(num, scale) {
1593
1602
  var multiplier = Math.pow(10, scale);
1594
1603
  return Math.round((num + Number.EPSILON) * multiplier) / multiplier;
1595
1604
  };
1596
-
1597
- function formatMoney(num, c, d, t, forcePositive) {
1605
+ var formatMoney = function formatMoney(num, c, d, t, forcePositive) {
1598
1606
  if (forcePositive === void 0) {
1599
1607
  forcePositive = false;
1600
1608
  }
@@ -1615,8 +1623,7 @@ function formatMoney(num, c, d, t, forcePositive) {
1615
1623
 
1616
1624
  return ret;
1617
1625
  }(c, d, t);
1618
- }
1619
-
1626
+ };
1620
1627
  var FormatCurrencyDetails = function FormatCurrencyDetails(value, currency, lang, cFormat, rtl, removeDecimal, showLongSymbol, options) {
1621
1628
  if (options === void 0) {
1622
1629
  options = {
@@ -1718,7 +1725,6 @@ var FormatCurrencyDetails = function FormatCurrencyDetails(value, currency, lang
1718
1725
  symbol: symbol
1719
1726
  };
1720
1727
  };
1721
-
1722
1728
  var currencyFormat = function currencyFormat(value, currency, lang, cFormat, rtl, removeDecimal, showLongSymbol, options) {
1723
1729
  if (options === void 0) {
1724
1730
  options = {
@@ -1728,7 +1734,6 @@ var currencyFormat = function currencyFormat(value, currency, lang, cFormat, rtl
1728
1734
 
1729
1735
  return FormatCurrencyDetails(value, currency, lang, cFormat, rtl, removeDecimal, showLongSymbol, options).str;
1730
1736
  };
1731
-
1732
1737
  var FormatCurrencyNumber = function FormatCurrencyNumber(value, currency) {
1733
1738
  var currencyName = currency || "USD";
1734
1739
 
@@ -1761,6 +1766,8 @@ var getSafe = function getSafe(accessor) {
1761
1766
  };
1762
1767
 
1763
1768
  var util = {
1769
+ currencyFormat: currencyFormat,
1770
+ formatMoney: formatMoney,
1764
1771
  getSafe: getSafe,
1765
1772
  FormatCurrency: FormatCurrency,
1766
1773
  FormatCurrencyInPdf: FormatCurrencyInPdf,
@@ -9683,7 +9690,7 @@ var invoiceHtmlWithDetails = (function (_ref) {
9683
9690
  if (document.it) {
9684
9691
  for (var _iterator2 = _createForOfIteratorHelperLoose(document.it), _step2; !(_step2 = _iterator2()).done;) {
9685
9692
  var _item = _step2.value;
9686
- itemsContainer = itemsContainer + ("<tr>\n <td>\n <span class=\"text-inverse\"><strong>" + (_item.n || "") + "</strong></span>\n " + (_item.pc ? "<div class=\"text-inverse\">" + _item.pc + "</div>" : "") + "\n <div class=\"mt-2\">" + (nl2br(_item.dsc) || "") + "</div>\n <div class=\"d-block d-md-none mt-1\">\n " + ((_item.p || _item.p == 0) && (_item.q || _item.q == 0) ? FormatCurrency$1(_item.p, company.cr, company.la, company.cf, {
9693
+ itemsContainer = itemsContainer + ("<tr>\n <td>\n <span class=\"text-inverse\"><strong>" + (_item.n || "") + "</strong></span>\n " + (_item.productCode ? "<div class=\"text-inverse\">" + _item.productCode + "</div>" : "") + "\n <div class=\"mt-2\">" + (nl2br(_item.dsc) || "") + "</div>\n <div class=\"d-block d-md-none mt-1\">\n " + ((_item.p || _item.p == 0) && (_item.q || _item.q == 0) ? FormatCurrency$1(_item.p, company.cr, company.la, company.cf, {
9687
9694
  forceDecimal: forceItemUnitPriceDecimal
9688
9695
  }) + " ✕ " + (_item.q || "0") : "") + "\n " + (discountOnItem && (_item.p || _item.p == 0) && _item.dc ? "" + (_item.dc > 0 ? " - " : " + ") + FormatCurrency$1(Math.abs(_item.dc), company.cr, company.la, company.cf, {
9689
9696
  forceDecimal: forceItemUnitPriceDecimal
@@ -9985,7 +9992,7 @@ var invoiceHtmlWithDetailsAsync = (function (_ref) {
9985
9992
  if (document.it) {
9986
9993
  for (var _iterator2 = _createForOfIteratorHelperLoose(document.it), _step2; !(_step2 = _iterator2()).done;) {
9987
9994
  var _item = _step2.value;
9988
- itemsContainer = itemsContainer + ("<tr>\n <td>\n <span class=\"text-inverse\"><strong>" + (_item.n || "") + "</strong></span>\n <div>" + (nl2br(_item.dsc) || "") + "</div>\n <div class=\"d-block d-md-none mt-1\">\n " + ((_item.p || _item.p == 0) && (_item.q || _item.q == 0) ? FormatCurrency$2(_item.p, company.cr, company.la, company.cf, {
9995
+ itemsContainer = itemsContainer + ("<tr>\n <td>\n <span class=\"text-inverse\"><strong>" + (_item.n || "") + "</strong></span>\n " + (_item.productCode ? "<div class=\"text-inverse\">" + _item.productCode + "</div>" : "") + "\n <div>" + (nl2br(_item.dsc) || "") + "</div>\n <div class=\"d-block d-md-none mt-1\">\n " + ((_item.p || _item.p == 0) && (_item.q || _item.q == 0) ? FormatCurrency$2(_item.p, company.cr, company.la, company.cf, {
9989
9996
  forceDecimal: forceItemUnitPriceDecimal
9990
9997
  }) + " ✕ " + (_item.q || "0") : "") + "\n " + (discountOnItem && (_item.p || _item.p == 0) && _item.dc ? "" + (_item.dc > 0 ? " - " : " + ") + FormatCurrency$2(Math.abs(_item.dc), company.cr, company.la, company.cf, {
9991
9998
  forceDecimal: forceItemUnitPriceDecimal
@@ -10011,11 +10018,9 @@ var invoiceHtmlWithDetailsAsync = (function (_ref) {
10011
10018
  for (var _iterator3 = _createForOfIteratorHelperLoose(document.pm), _step3; !(_step3 = _iterator3()).done;) {
10012
10019
  var payment = _step3.value;
10013
10020
  paymentContainer = paymentContainer + ("<tr>\n <td class=\"text-md-right\" width=\"22%\">" + t("payment_on.date", {
10014
- date: date
10021
+ date: formatDate(payment.d)
10015
10022
  }) + ("" + (payment.b ? t("payment_on.brand", {
10016
10023
  brand: formatCardBrand(payment.b)
10017
- }) : "") + (endNumber && payment.b ? t("payment_on.endNumber", {
10018
- endNumber: endNumber
10019
10024
  }) : "")) + "</td>\n <td class=\"text-right\" width=\"22%\">" + FormatCurrency$2(payment.a, company.cr, company.la, company.cf) + "</td>\n </tr>");
10020
10025
  }
10021
10026
  }
@@ -10140,7 +10145,7 @@ var invoiceHtmlAsync = function invoiceHtmlAsync(_ref2) {
10140
10145
  var docTypeMapping = new Map([[0, "estimate"], [1, "invoice"], [2, "credit_note"], [3, "delivery_note"], [4, "purchase_order"], ["estimate", 0], ["invoice", 1], ["credit_note", 2], ["delivery_note", 3], ["purchase_order", 4]]);
10141
10146
  var ItemCompat = function ItemCompat(item) {
10142
10147
  if (item == null) return null;
10143
- var mapping = new Map([["name", "n"], ["productCode", "pc"], ["description", "dsc"], ["price", "p"], ["quantity", "q"], ["tax", "tx"], ["tax2", "tx2"], ["discount", "dc"], ["total", "t"]]);
10148
+ var mapping = new Map([["name", "n"], ["productCode", "productCode"], ["description", "dsc"], ["price", "p"], ["quantity", "q"], ["tax", "tx"], ["tax2", "tx2"], ["discount", "dc"], ["total", "t"]]);
10144
10149
  return Object.fromEntries(Object.entries(item).map(function (_ref) {
10145
10150
  var k = _ref[0],
10146
10151
  v = _ref[1];