diff --git a/modules/invoiceOut/back/methods/invoiceOut/globalInvoicing.js b/modules/invoiceOut/back/methods/invoiceOut/globalInvoicing.js index 14d6913cb..dba05ed85 100644 --- a/modules/invoiceOut/back/methods/invoiceOut/globalInvoicing.js +++ b/modules/invoiceOut/back/methods/invoiceOut/globalInvoicing.js @@ -145,34 +145,8 @@ module.exports = Self => { if (newInvoice.id) { await Self.rawSql('CALL invoiceOutBooking(?)', [newInvoice.id], myOptions); - // query = `INSERT IGNORE INTO invoiceOut_queue(invoiceFk) VALUES(?)`; - // await Self.rawSql(query, [newInvoice.id], myOptions); - - query = `SELECT id FROM vn.report WHERE name ='invoice'`; - const [reportFk] = await Self.rawSql(query, null, myOptions); - - query = `SELECT ref FROM vn.invoiceOut WHERE id = ?`; - const [invoiceRef] = await Self.rawSql(query, [newInvoice.id], myOptions); - - // Print invoice - const args = { - invoiceOutFk: newInvoice.id, - refFk: invoiceRef.ref, - hasToForcePdf: true, - email: '' - }; - - const userId = ctx.req.accessToken.userId; - - query = `INSERT INTO vn.printQueue (priorityFk, reportFk, workerFk, printerFk) VALUES (?, ?, ?, NULL)`; - await Self.rawSql(query, [2, reportFk.id, userId], myOptions); // La prioridad de donde se la saca? 'adPriorityBelowNormal' - - const [lastInsertedPrintQueue] = await Self.rawSql('SELECT LAST_INSERT_ID() AS id', null, myOptions); - - for (let key in args) { - query = `INSERT INTO vn.printQueueArgs (printQueueFk, name, value) VALUES (?, ?, ?)`; - await Self.rawSql(query, [lastInsertedPrintQueue.id, key, args[key]], myOptions); - } + query = `INSERT IGNORE INTO invoiceOut_queue(invoiceFk) VALUES(?)`; + await Self.rawSql(query, [newInvoice.id], myOptions); invoicesIds.push(newInvoice.id); }