@bookipi/htmlgenerator 1.5.3-alpha1 → 1.5.3-alpha2

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.
@@ -11948,7 +11948,7 @@ var InvoiceContent = function InvoiceContent(_ref) {
11948
11948
  isDeposit: isDeposit
11949
11949
  });
11950
11950
  var paymentOn = company.pi && document.ty === 1 && (company.p1 || company.p2 || company.p3);
11951
- var paymentInstructionDetails = "\n " + (paymentOn ? "<h2 style=\"margin-top: 0; margin-bottom: 12px; font-size: 18px; font-weight: 700;\">" + (company.r_pi ? company.r_pi : defaultLang["payment_instruction"]) + "</h2>" : "") + "\n " + (company.hasPaymentInstructionQRCode ? "\n <div style=\"padding: 10px; border-color: #D1D5DB; border-width: 1px; border-radius: 8px; width: 200px; height: 200px; border-style: solid; margin-bottom: 8px\">\n <img alt=\"paymentQrCode\" style=\"height: 180px; width: 180px;\" src=\"https://s3.amazonaws.com/bookipi/" + (company === null || company === void 0 ? void 0 : company._id) + "/paymentInstructionQRCode.png?t=" + new Date().getTime() + "\"\n /></div>" : "") + "\n <span style=\"white-space: pre-line; margin-top: 12px; color: #6B7280;\">\n " + (paymentOn && company.p1 ? company.p1 + "<br>" : "") + "\n " + (paymentOn && company.p2 ? company.p2 + "<br>" : "") + "\n " + (paymentOn && company.p3 ? company.p3 + "<br>" : "") + "\n </span>\n ";
11951
+ var paymentInstructionDetails = "\n " + (paymentOn ? "<h2 style=\"margin-top: 0; margin-bottom: 12px; font-size: 18px; font-weight: 700;\">" + (company.r_pi ? company.r_pi : defaultLang["payment_instruction"]) + "</h2>" : "") + "\n " + (company.hasPaymentInstructionQRCode ? "\n <div style=\"padding: 10px; border-color: #D1D5DB; border-width: 1px; border-radius: 8px; width: 200px; height: 200px; border-style: solid; margin-bottom: 8px\">\n <img alt=\"paymentQrCode-" + (company === null || company === void 0 ? void 0 : company._id) + "\" style=\"height: 180px; width: 180px;\" src=\"https://s3.amazonaws.com/bookipi/" + (company === null || company === void 0 ? void 0 : company._id) + "/paymentInstructionQRCode.png?t=" + new Date().getTime() + "\"\n /></div>" : "") + "\n <span style=\"white-space: pre-line; margin-top: 12px; color: #6B7280;\">\n " + (paymentOn && company.p1 ? company.p1 + "<br>" : "") + "\n " + (paymentOn && company.p2 ? company.p2 + "<br>" : "") + "\n " + (paymentOn && company.p3 ? company.p3 + "<br>" : "") + "\n </span>\n ";
11952
11952
  return html$7(_templateObject$7 || (_templateObject$7 = _taggedTemplateLiteralLoose(["<!-- begin invoice-content -->\n <div class=\"invoice-content\">\n <div class=\"table-responsive\">\n <table class=\"table table-invoice\">\n <thead>\n <tr class=\"table table-invoice\">\n <th\n class=\"text-left\"\n ", "\n >\n ", "\n </th>\n <th\n class=\"text-center d-none d-md-table-cell\"\n ", "\n >\n ", "\n </th>\n <th\n class=\"text-right d-none d-md-table-cell\"\n ", "\n >\n ", "\n </th>\n ", "\n <th\n class=\"text-right item-last\"\n ", "\n >\n ", "\n </th>\n </tr>\n </thead>\n <tbody>\n ", "\n </tbody>\n </table>\n </div>\n\n <hr />\n <div class=\"row\">\n <div class=\"col-12\">\n <table class=\"table table-borderless table-small\">\n <tbody>\n <tr>\n <td\n class=\"d-none d-md-table-cell\"\n rowspan=\"", "\"\n >\n ", "\n </td>\n <td class=\"text-md-right\" width=\"22%\">\n ", "\n </td>\n <td class=\"text-right\" width=\"22%\">\n ", "\n </td>\n </tr>\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n ", "\n </tbody>\n </table>\n </div>\n </div>\n </div>\n <!-- end invoice-content -->"])), itemWidth[0] ? "width='" + itemWidth[0] + "'" : "", company.r_it ? company.r_it : defaultLang["item"], itemWidth[1] ? "width='" + itemWidth[1] + "'" : "", document.um ? document.um : company.r_q ? company.r_q : defaultLang["quantity"], itemWidth[2] ? "width='" + itemWidth[2] + "'" : "", company.r_p ? company.r_p : defaultLang["price"], discountOnItem ? "<th class=\"text-right d-none d-md-table-cell\" " + (itemWidth[3] ? "width='" + itemWidth[3] + "'" : "") + ">" + (company.r_dc ? company.r_dc : defaultLang["discount"]) + "</th>" : "", itemWidth[4] ? "width='" + itemWidth[4] + "'" : "", company.r_a ? company.r_a : defaultLang["amount"], itemsContainer, numOfRowsPaymentInstruction, paymentOn || company.hasPaymentInstructionQRCode ? paymentInstructionDetails : "", company.r_sb ? company.r_sb : defaultLang["subtotal"], FormatCurrency$3(document.st, company.cr, company.la, company.cf), document.dc ? "<tr>\n <td class=\"text-md-right\" width=\"22%\">" + ((company.r_dc ? company.r_dc : defaultLang["discount"]) + (document.dcpo && document.dcp ? " (" + document.dcp + "%)" : "")) + "</td>\n <td class=\"text-right\" width=\"22%\">" + ("(" + FormatCurrency$3(document.dc, company.cr, company.la, company.cf) + ")") + "</td>\n </tr>" : "", document.sp && !document.sntx ? "<tr>\n <td class=\"text-md-right\" width=\"22%\">" + (company.r_sp ? company.r_sp : defaultLang["shipping"]) + "</td>\n <td class=\"text-right\" width=\"22%\">" + FormatCurrency$3(document.sp, company.cr, company.la, company.cf) + "</td>\n </tr>" : "", document.tx != 0 ? "<tr>\n <td class=\"text-md-right\" width=\"22%\">" + (taxName1 + taxIncluded1 + "(" + document.tp + "%)") + "</td>\n <td class=\"text-right\" width=\"22%\">" + ((document.t1d ? "(" : "") + FormatCurrency$3(document.tx, company.cr, company.la, company.cf) + (document.t1d ? ")" : "")) + "</td>\n </tr>" : "", document.ttx && document.tx2 != 0 ? "<tr>\n <td class=\"text-md-right\" width=\"22%\">" + (taxName2 + taxIncluded2 + "(" + document.tp2 + "%)") + "</td>\n <td class=\"text-right\" width=\"22%\">" + ((document.t2d ? "(" : "") + FormatCurrency$3(document.tx2, company.cr, company.la, company.cf) + (document.t2d ? ")" : "")) + "</td>\n </tr>" : "", document.sp && document.sntx ? "<tr>\n <td class=\"text-md-right\" width=\"22%\">" + (company.r_sp ? company.r_sp : defaultLang["shipping"]) + "</td>\n <td class=\"text-right\" width=\"22%\">" + FormatCurrency$3(document.sp, company.cr, company.la, company.cf) + "</td>\n </tr>" : "", document.ti && !document.t1d && !document.t2d ? "<tr>\n <td class=\"text-md-right\" width=\"22%\" style=\"border-top: 1px solid #ddd\">" + (company.r_n ? company.r_n : defaultLang["net"]) + "</td>\n <td class=\"text-right\" width=\"22%\" style=\"border-top: 1px solid #ddd\">" + FormatCurrency$3(document.tt - (document.tx || 0) - (document.tx2 || 0), company.cr, company.la, company.cf) + "</td>\n </tr>" : "", document.ty == 1 || document.ty !== 1 && (document.t1d || document.ttx && document.tx2 > 0 && document.t2d) ? "<tr>\n <td class=\"text-md-right\" width=\"22%\" style=\"border-bottom: 1px solid #ddd\">" + (company.r_tt ? company.r_tt : defaultLang["total"]) + "</td>\n <td class=\"text-right\" width=\"22%\" style=\"border-bottom: 1px solid #ddd\">" + FormatCurrency$3(document.tt ? document.tt : 0, company.cr, company.la, company.cf) + "</td>\n </tr>" : "", document.sca ? "<tr>\n <td class=\"text-md-right\" width=\"22%\">" + defaultLang["credit_card_surcharge"] + "</td>\n <td class=\"text-right\" width=\"22%\">" + FormatCurrency$3(document.sca, company.cr, company.la, company.cf) + "</td>\n </tr>" : "", document.hangingAmount && document.hangingAmount > 0 ? "<tr>\n <td class=\"text-md-right\" width=\"22%\" style=\"border-top: 1px solid #ddd\">" + (company.payment_in_progress ? company.payment_in_progress : defaultLang.payment_in_progress) + "</td>\n <td class=\"text-right\" width=\"22%\" style=\"border-top: 1px solid #ddd\">" + FormatCurrency$3(document.hangingAmount || 0, company.cr, company.la, company.cf) + "</td>\n </tr>" : "", document.ty == 1 && document.pma && document.pm ? paymentContainer : "", document.ty == 1 && isDeposit && document.depositAmount > 0 ? "\n <tr>\n <td class=\"text-md-right\" width=\"22%\" style=\"border-top: 1px solid #ddd\">" + (document.ty == 1 ? company.r_ad ? company.r_ad : defaultLang["amount_due"] : company.r_gt ? company.r_gt : defaultLang["grand_total"]) + "</td>\n <td class=\"text-right\" width=\"22%\" style=\"border-top: 1px solid #ddd\">" + FormatCurrency$3(document.ad - (document.hangingAmount || 0), company.cr, company.la, company.cf) + "</td>\n </tr>" : "");
11953
11953
  };
11954
11954
 
@@ -12002,9 +12002,10 @@ var InvoiceBookipayLink = function InvoiceBookipayLink(_ref) {
12002
12002
  defaultLang = _ref.defaultLang,
12003
12003
  document = _ref.document,
12004
12004
  bookipayLink = _ref.bookipayLink,
12005
- hidePayBtnInScreen = _ref.hidePayBtnInScreen;
12005
+ hidePayBtnInScreen = _ref.hidePayBtnInScreen,
12006
+ showPaymentInstructions = _ref.showPaymentInstructions;
12006
12007
  var surcharge = company.sc && company.sr || 0;
12007
- var paymentOn = company.pi && document.ty === 1 && (company.p1 || company.p2 || company.p3);
12008
+ var paymentOn = company.pi && document.ty === 1 && (company.p1 || company.p2 || company.p3) && showPaymentInstructions !== false;
12008
12009
  var bookipayLinkComponent = BookipayLinkContainer({
12009
12010
  document: document,
12010
12011
  bookipayLink: bookipayLink,
@@ -12013,7 +12014,7 @@ var InvoiceBookipayLink = function InvoiceBookipayLink(_ref) {
12013
12014
  defaultLang: defaultLang
12014
12015
  });
12015
12016
  if (paymentOn || bookipayLinkComponent) {
12016
- var paymentInstructionDetails = html$a(_templateObject$a || (_templateObject$a = _taggedTemplateLiteralLoose(["\n ", "\n ", "\n ", "\n ", "\n "])), paymentOn ? "<h2 style=\"margin-top: 0; font-size: 18px; font-weight: 700;\">" + (company.r_pi ? company.r_pi : defaultLang["payment_instruction"]) + "</h2>" : "", paymentOn && company.p1 ? company.p1 + "<br>" : "", paymentOn && company.p2 ? company.p2 + "<br>" : "", paymentOn && company.p3 ? company.p3 + "<br>" : "");
12017
+ var paymentInstructionDetails = html$a(_templateObject$a || (_templateObject$a = _taggedTemplateLiteralLoose(["\n ", "\n ", "\n <span style=\"white-space: pre-line; margin-top: 12px; color: #6B7280;\">\n ", "\n ", "\n ", "\n </span>\n "])), paymentOn ? "<h2 style=\"margin-top: 0; margin-bottom: 12px; font-size: 18px; font-weight: 700;\">" + (company.r_pi ? company.r_pi : defaultLang["payment_instruction"]) + "</h2>" : "", company.hasPaymentInstructionQRCode ? "\n <div style=\"padding: 10px; border-color: #D1D5DB; border-width: 1px; border-radius: 8px; width: 200px; height: 200px; border-style: solid; margin-bottom: 8px\">\n <img alt=\"paymentQrCode\" style=\"height: 180px; width: 180px;\" src=\"https://s3.amazonaws.com/bookipi/" + (company === null || company === void 0 ? void 0 : company._id) + "/paymentInstructionQRCode.png?t=" + new Date().getTime() + "\"\n /></div>" : "", paymentOn && company.p1 ? company.p1 + "<br>" : "", paymentOn && company.p2 ? company.p2 + "<br>" : "", paymentOn && company.p3 ? company.p3 + "<br>" : "");
12017
12018
  return html$a(_templateObject2$4 || (_templateObject2$4 = _taggedTemplateLiteralLoose(["<!-- begin invoice-payment-link -->\n <div class=\"invoice-body\">\n <div class=\"d-block d-md-none\">\n ", "\n ", "\n </div>\n </div>\n <!-- end invoice-payment-link -->"])), paymentOn ? paymentInstructionDetails : "", bookipayLinkComponent ? "<div class=\"mt-4\">" + bookipayLinkComponent + "</div>" : "");
12018
12019
  }
12019
12020
  return "";
@@ -12247,7 +12248,8 @@ var invoiceHtmlWithDetails = (function (_ref) {
12247
12248
  defaultLang: defaultLang,
12248
12249
  document: document,
12249
12250
  bookipayLink: bookipayLink,
12250
- hidePayBtnInScreen: hidePayBtnInScreen
12251
+ hidePayBtnInScreen: hidePayBtnInScreen,
12252
+ showPaymentInstructions: document.shouldShowPaymentInstructions
12251
12253
  }), InvoiceNote({
12252
12254
  company: company,
12253
12255
  defaultLang: defaultLang,
@@ -12758,7 +12760,8 @@ var invoiceHtmlWithDetailsNew = (function (_ref) {
12758
12760
  defaultLang: defaultLang,
12759
12761
  document: document,
12760
12762
  bookipayLink: bookipayLink,
12761
- hidePayBtnInScreen: hidePayBtnInScreen
12763
+ hidePayBtnInScreen: hidePayBtnInScreen,
12764
+ showPaymentInstructions: document.shouldShowPaymentInstructions
12762
12765
  }), InvoiceNote({
12763
12766
  company: company,
12764
12767
  defaultLang: defaultLang,