Actualizar modules/ticket/back/methods/ticket/closure.js
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Andrés 2024-10-08 13:32:57 +00:00
parent f8a3527680
commit d497ffc781
1 changed files with 7 additions and 0 deletions

View File

@ -22,6 +22,8 @@ module.exports = async function(ctx, Self, tickets, options) {
const failedtickets = [];
for (const ticket of tickets) {
try {
await Self.rawSql(`CALL util.debugAdd('invoicingTicket', ?)`, [ticket.id], {userId});
await Self.app.models.InvoiceOut.getSerial(ticket.clientFk, ticket.companyFk, ticket.addressFk, 'quick');
await Self.rawSql(
`CALL vn.ticket_closeByTicket(?)`,
@ -149,6 +151,11 @@ module.exports = async function(ctx, Self, tickets, options) {
myOptions);
}
} catch (error) {
await Self.rawSql(`
INSERT INTO util.debug (variable, value)
VALUES ('invoicingTicketError', ?)
`, [ticket.id + ' - ' + error]);
if (error.responseCode == 450) {
await invalidEmail(ticket);
continue;