diff --git a/modules/ticket/back/methods/ticket/summary.js b/modules/ticket/back/methods/ticket/summary.js index 08de35482..760a71e2b 100644 --- a/modules/ticket/back/methods/ticket/summary.js +++ b/modules/ticket/back/methods/ticket/summary.js @@ -22,7 +22,7 @@ module.exports = Self => { Self.summary = async ticketFk => { let models = Self.app.models; let summaryObj = await getTicketData(Self, ticketFk); - summaryObj.sales = await getSales(models.Sale, ticketFk); + summaryObj.sales = await models.Ticket.getSales(ticketFk); summaryObj.packagings = await models.TicketPackaging.find({ where: {ticketFk: ticketFk}, include: [{relation: 'packaging', @@ -102,20 +102,6 @@ module.exports = Self => { return await Self.findOne(filter); } - async function getSales(Sale, ticketFk) { - let filter = { - where: { - ticketFk: ticketFk - }, - order: 'concept', - include: [ - {relation: 'item'}, - {relation: 'claimBeginning'} - ] - }; - return await Sale.find(filter); - } - async function getRequests(Self, ticketFk) { let filter = { where: { diff --git a/modules/ticket/front/summary/index.html b/modules/ticket/front/summary/index.html index 6c25f2665..1441024ba 100644 --- a/modules/ticket/front/summary/index.html +++ b/modules/ticket/front/summary/index.html @@ -120,6 +120,7 @@ Item + Available Quantity Description Price @@ -137,12 +138,6 @@ vn-tooltip="{{::$ctrl.$t('Claim')}}: {{::sale.claimBeginning.claimFk}}"> - - @@ -152,6 +147,10 @@ {{sale.itemFk | zeroFill:6}} + + {{::sale.available}} + + {{::sale.quantity}} {{::sale.item.name}}