@bookipi/htmlgenerator 1.1.42-alpha2 → 1.1.42

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
@@ -11845,9 +11845,8 @@ var ItemsContainer = function ItemsContainer(_ref) {
11845
11845
  }
11846
11846
  var itemsContainer = "";
11847
11847
  for (var _iterator = _createForOfIteratorHelperLoose(document.it), _step; !(_step = _iterator()).done;) {
11848
- var _item$photos;
11849
11848
  var item = _step.value;
11850
- itemsContainer = itemsContainer + html$5(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteralLoose(["<tr>\n <td>\n ", "\n <div style=\"display: inline-block\">\n <span class=\"text-inverse\"><strong>", "</strong></span>\n ", "\n <div class=\"mt-2\">", "</div>\n <div class=\"d-block d-md-none mt-1\">\n ", "\n ", "\n </div>\n </div>\n </td>\n <td class=\"text-center d-none d-md-table-cell\">\n ", "\n </td>\n <td class=\"text-right d-none d-md-table-cell\">\n ", "\n </td>\n ", "\n <td class=\"text-right\">\n ", "\n </td>\n </tr>"])), (_item$photos = item.photos) !== null && _item$photos !== void 0 && _item$photos[0] ? "<img style=\"width:56px;height:56px;display:inline-block;margin-right:12px;border-radius:4px;\" src=\"https://s3.amazonaws.com/bookipi/" + company._id + "/item/images/" + item.photos[0].filename + ".jpg\" />" : "", item.n || "", item.productCode ? html$5(_templateObject2$2 || (_templateObject2$2 = _taggedTemplateLiteralLoose(["<div class=\"text-inverse\">", "</div>"])), item.productCode) : "", nl2br(item.dsc) || "", (item.p || item.p == 0) && (item.q || item.q == 0) ? FormatCurrency$1(item.p, company.cr, company.la, company.cf, {
11849
+ itemsContainer = itemsContainer + html$5(_templateObject$5 || (_templateObject$5 = _taggedTemplateLiteralLoose(["<tr>\n <td>\n <span class=\"text-inverse\"><strong>", "</strong></span>\n ", "\n <div class=\"mt-2\">", "</div>\n <div class=\"d-block d-md-none mt-1\">\n ", "\n ", "\n </div>\n </td>\n <td class=\"text-center d-none d-md-table-cell\">\n ", "\n </td>\n <td class=\"text-right d-none d-md-table-cell\">\n ", "\n </td>\n ", "\n <td class=\"text-right\">\n ", "\n </td>\n </tr>"])), item.n || "", item.productCode ? html$5(_templateObject2$2 || (_templateObject2$2 = _taggedTemplateLiteralLoose(["<div class=\"text-inverse\">", "</div>"])), item.productCode) : "", nl2br(item.dsc) || "", (item.p || item.p == 0) && (item.q || item.q == 0) ? FormatCurrency$1(item.p, company.cr, company.la, company.cf, {
11851
11850
  forceDecimal: forceItemUnitPriceDecimal
11852
11851
  }) + " ✕ " + (item.q || "0") : "", discountOnItem && (item.p || item.p == 0) && item.dc ? "" + (item.dc > 0 ? " - " : " + ") + FormatCurrency$1(Math.abs(item.dc), company.cr, company.la, company.cf, {
11853
11852
  forceDecimal: forceItemUnitPriceDecimal
@@ -12565,7 +12564,7 @@ var getRecurringPeriodType = function getRecurringPeriodType(recurringPeriodType
12565
12564
  return recurringPeriodType;
12566
12565
  }
12567
12566
  };
12568
- function getBilling(item, proposal, company, t) {
12567
+ function getBilling(item, proposal, company) {
12569
12568
  var billingType = item.billingType,
12570
12569
  recurringPeriodFrequency = item.recurringPeriodFrequency,
12571
12570
  recurringPeriodType = item.recurringPeriodType,
@@ -12573,23 +12572,20 @@ function getBilling(item, proposal, company, t) {
12573
12572
  recurringStartType = item.recurringStartType;
12574
12573
  switch (billingType) {
12575
12574
  case "acceptance":
12576
- return t ? t("Billed today") : "Billed today";
12575
+ return "Billed today";
12577
12576
  case "completion":
12578
12577
  if (proposal.endType === "fixed_date") {
12579
- return t ? t("Billed on completion") : "Billed on completion";
12578
+ return "Billed on completion";
12580
12579
  } else if (proposal.endDate !== null) {
12581
- return (t ? t("Billed on") : "Billed on") + " " + formatDate(proposal.endDate, company);
12580
+ return "Billed on " + formatDate(proposal.endDate, company);
12582
12581
  } else {
12583
- return t ? t("Billed on completion") : "Billed on completion";
12582
+ return "Billed on completion";
12584
12583
  }
12585
12584
  case "recurring":
12586
12585
  var startDate = recurringStartType === "on_acceptance" ? "acceptance" : formatDate(recurringStartDate, company);
12587
- return t ? t("Billed every {{recurringPeriod}} " + getRecurringPeriodType(recurringPeriodType || "month", recurringPeriodFrequency) + " from {{startDate}}", {
12588
- recurringPeriod: recurringPeriodFrequency === 1 ? "" : recurringPeriodFrequency,
12589
- startDate: startDate
12590
- }) : "Billed every " + (recurringPeriodFrequency === 1 ? "" : recurringPeriodFrequency) + " " + getRecurringPeriodType(recurringPeriodType || "month", recurringPeriodFrequency) + " from " + startDate;
12586
+ return "Billed every " + (recurringPeriodFrequency === 1 ? "" : recurringPeriodFrequency) + " " + getRecurringPeriodType(recurringPeriodType || "month", recurringPeriodFrequency) + " from " + startDate;
12591
12587
  default:
12592
- return t ? t("Billing type should be selected") : "Billing type should be selected";
12588
+ return "Billing type should be selected";
12593
12589
  }
12594
12590
  }
12595
12591
 
@@ -12754,7 +12750,7 @@ var contractHtml = (function (props) {
12754
12750
  sectionServices += "</div>";
12755
12751
  }
12756
12752
  sectionServices += '</td><td align="right">';
12757
- sectionServices += "<p>" + (getBilling(it, proposal, company, t) + "</p>");
12753
+ sectionServices += "<p>" + (t ? getBilling(it, proposal, company).replace('Billed today', t('Billed today')).replace('Billed on completion', t('Billed on completion')).replace('Billed on', t('Billed on')) : getBilling(it, proposal, company) + "</p>");
12758
12754
  sectionServices += "</td></tr>";
12759
12755
  });
12760
12756
  } else {