From 9d855a80d57f2f7427f803c2774caab95b4ed0c7 Mon Sep 17 00:00:00 2001 From: joan Date: Tue, 20 Jul 2021 12:33:27 +0200 Subject: [PATCH] 3028 - Added visible column on ticket sales --- modules/ticket/back/methods/ticket/getSales.js | 12 +++++++++--- modules/ticket/front/sale/index.html | 8 ++++++++ modules/ticket/front/summary/index.html | 8 ++++++++ 3 files changed, 25 insertions(+), 3 deletions(-) diff --git a/modules/ticket/back/methods/ticket/getSales.js b/modules/ticket/back/methods/ticket/getSales.js index 7bd2eabbe..155f23362 100644 --- a/modules/ticket/back/methods/ticket/getSales.js +++ b/modules/ticket/back/methods/ticket/getSales.js @@ -60,8 +60,12 @@ module.exports = Self => { const [salesAvailable] = await Self.rawSql(query, [id], myOptions); const itemAvailable = new Map(); - for (let sale of salesAvailable) - itemAvailable.set(sale.itemFk, sale.available); + for (let sale of salesAvailable) { + itemAvailable.set(sale.itemFk, { + visible: sale.visible, + available: sale.available + }); + } // Get claimed sales const saleIds = sales.map(sale => sale.id); @@ -84,7 +88,9 @@ module.exports = Self => { for (let sale of sales) { const problems = saleProblems.get(sale.id); - sale.available = itemAvailable.get(sale.itemFk); + const itemStock = itemAvailable.get(sale.itemFk); + sale.available = itemStock.available; + sale.visible = itemStock.visible; sale.claim = claimedSales.get(sale.id); if (problems) { sale.isAvailable = problems.isAvailable; diff --git a/modules/ticket/front/sale/index.html b/modules/ticket/front/sale/index.html index dec0627c2..cd3f8426d 100644 --- a/modules/ticket/front/sale/index.html +++ b/modules/ticket/front/sale/index.html @@ -59,6 +59,7 @@ + Visible Available Id Quantity @@ -112,6 +113,13 @@ zoom-image="{{::$root.imagePath('catalog', '1600x900', sale.itemFk)}}" on-error-src/> + + + {{::sale.visible}} + + Item + Visible Available Quantity Description @@ -169,6 +170,13 @@ {{sale.itemFk | zeroFill:6}} + + + {{::sale.visible}} + +