@bookipi/htmlgenerator 1.5.13 → 1.5.15

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
@@ -13433,19 +13433,19 @@ var subscriptionInvoiceHtml = (function (_ref) {
13433
13433
  var hasDiscount = invoiceItems.some(function (item) {
13434
13434
  return item.type === 'discount' && item.total > 0;
13435
13435
  });
13436
+ var hasTax = invoiceItems.some(function (item) {
13437
+ return item.type === 'tax' && item.total > 0;
13438
+ });
13436
13439
  var renderItem = function renderItem(item) {
13437
- var title = item.description || item.name;
13438
- var itemLang = {
13439
- title: t ? t(title) : title,
13440
- description: t ? t(item.description) : item.description
13441
- };
13442
- if (!hasDiscount && item.type === 'subtotal') {
13440
+ var title = item.name || item.description;
13441
+ var showSubtotal = hasTax && hasDiscount;
13442
+ if (!showSubtotal && item.type === 'subtotal') {
13443
13443
  return '';
13444
13444
  }
13445
13445
  var isDiscount = item.type === 'discount';
13446
13446
  var total = item.total * (isDiscount ? -1 : 1);
13447
13447
  var color = isDiscount ? '#C81E1E' : 'inherit';
13448
- return "\n <div class=\"invoice-order-item\">\n <div class=\"invoice-order-details\">\n <div>\n <div class=\"invoice-spacing invoice-body3\">" + itemLang.title + "</div>\n </div>\n <div style=\"font-size:16px;color:" + color + ";\">\n " + formatPrice(total, currency) + "\n </div>\n </div>\n </div>\n ";
13448
+ return "\n <div class=\"invoice-order-item\">\n <div class=\"invoice-order-details\">\n <div>\n <div class=\"invoice-spacing invoice-body3\">" + title + "</div>\n </div>\n <div style=\"font-size:16px;color:" + color + ";\">\n " + formatPrice(total, currency) + "\n </div>\n </div>\n </div>\n ";
13449
13449
  };
13450
13450
  var renderItems = function renderItems(items) {
13451
13451
  var rendered = '';