diff --git a/modules/ticket/back/methods/ticket/closeAll.js b/modules/ticket/back/methods/ticket/closeAll.js index 46c45aa92..edd1155ba 100644 --- a/modules/ticket/back/methods/ticket/closeAll.js +++ b/modules/ticket/back/methods/ticket/closeAll.js @@ -57,7 +57,8 @@ module.exports = Self => { AND t.refFk IS NULL GROUP BY t.id `, [toDate, toDate]); - + const ticketIds = tickets.map(ticket => ticket.id); + await Self.rawSql(`CALL util.debugAdd('nightInvoicing', ?)`, [ticketIds.join(',')]); await closure(ctx, Self, tickets); await Self.rawSql(` diff --git a/modules/ticket/back/methods/ticket/closure.js b/modules/ticket/back/methods/ticket/closure.js index 1d04679d3..14b040324 100644 --- a/modules/ticket/back/methods/ticket/closure.js +++ b/modules/ticket/back/methods/ticket/closure.js @@ -11,6 +11,7 @@ module.exports = async function(ctx, Self, tickets, reqArgs = {}) { const failedtickets = []; for (const ticket of tickets) { try { + await Self.rawSql(`CALL util.debugAdd('invoicingTicket', ?)`, [ticket.id], {userId}); await Self.rawSql(`CALL vn.ticket_closeByTicket(?)`, [ticket.id], {userId}); const [invoiceOut] = await Self.rawSql(`