delete: unnecessary code
gitea/salix/pipeline/head There was a failure building this commit Details

This commit is contained in:
Vicent Llopis 2022-08-10 13:23:50 +02:00
parent 31aafc0719
commit f3df373f70
1 changed files with 2 additions and 28 deletions

View File

@ -145,34 +145,8 @@ module.exports = Self => {
if (newInvoice.id) { if (newInvoice.id) {
await Self.rawSql('CALL invoiceOutBooking(?)', [newInvoice.id], myOptions); await Self.rawSql('CALL invoiceOutBooking(?)', [newInvoice.id], myOptions);
// query = `INSERT IGNORE INTO invoiceOut_queue(invoiceFk) VALUES(?)`; query = `INSERT IGNORE INTO invoiceOut_queue(invoiceFk) VALUES(?)`;
// await Self.rawSql(query, [newInvoice.id], myOptions); 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);
}
invoicesIds.push(newInvoice.id); invoicesIds.push(newInvoice.id);
} }