diff --git a/modules/monitor/front/index/tickets/index.html b/modules/monitor/front/index/tickets/index.html index a504301a5..138788ed6 100644 --- a/modules/monitor/front/index/tickets/index.html +++ b/modules/monitor/front/index/tickets/index.html @@ -210,6 +210,9 @@ + + diff --git a/print/core/smtp.js b/print/core/smtp.js index 50a413673..a55ba448d 100644 --- a/print/core/smtp.js +++ b/print/core/smtp.js @@ -29,7 +29,7 @@ module.exports = { for (let attachment of options.attachments) { const fileName = attachment.filename; const filePath = attachment.path; - if (fileName.includes('.png')) return; + if (fileName.includes('.png')) continue; if (fileName || filePath) attachments.push(filePath ? filePath : fileName); diff --git a/print/methods/closure/closeAll.js b/print/methods/closure/closeAll.js index dad8b4569..36b853052 100644 --- a/print/methods/closure/closeAll.js +++ b/print/methods/closure/closeAll.js @@ -11,15 +11,17 @@ module.exports = async function(request, response, next) { if (reqArgs.to) toDate = reqArgs.to; const todayMinDate = new Date(); - minDate.setHours(0, 0, 0, 0); + todayMinDate.setHours(0, 0, 0, 0); const todayMaxDate = new Date(); - maxDate.setHours(23, 59, 59, 59); + todayMinDate.setHours(23, 59, 59, 59); // Prevent closure for current day if (toDate >= todayMinDate && toDate <= todayMaxDate) throw new Error('You cannot close tickets for today'); + console.log(`Making closure up to ${toDate}...`); + const tickets = await db.rawSql(` SELECT t.id, diff --git a/print/methods/closure/closure.js b/print/methods/closure/closure.js index 67a2538e8..fe5aba5e7 100644 --- a/print/methods/closure/closure.js +++ b/print/methods/closure/closure.js @@ -7,11 +7,13 @@ const storage = require('vn-print/core/storage'); module.exports = { async start(tickets, reqArgs) { + console.log(tickets); if (tickets.length == 0) return; const failedtickets = []; for (const ticket of tickets) { try { + console.log(`Closing ticket id ${ticket.id}...`); await db.rawSql(`CALL vn.ticket_closeByTicket(?)`, [ticket.id]); const invoiceOut = await db.findOne(`