Merge pull request 'hotFix: try to debug closeAll' (!2173) from hotFix_invoiceDebug into master
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #2173
Reviewed-by: Carlos Andrés <carlosap@verdnatura.es>
This commit is contained in:
Alex Moreno 2024-03-15 14:58:55 +00:00
commit fbf798e356
2 changed files with 3 additions and 1 deletions

View File

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

View File

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