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