Debug logs
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2022-09-29 10:09:01 +02:00
parent 4172229051
commit d7b563c5ec
2 changed files with 4 additions and 0 deletions

View File

@ -20,6 +20,8 @@ module.exports = async function(request, response, next) {
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,

View File

@ -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(`