fix: asociar ticketRefund refs #7586 #2592
|
@ -145,15 +145,10 @@ module.exports = Self => {
|
|||
|
||||
const newTicket = await models.Ticket.new(ctx, myOptions);
|
||||
|
||||
const ticketRefund = await models.TicketRefund.findOne({
|
||||
where: {refundTicketFk: ticketId}
|
||||
}, myOptions);
|
||||
if (negative && (withWarehouse || !ticketRefund?.id)) {
|
||||
await models.TicketRefund.create({
|
||||
originalTicketFk: ticketId,
|
||||
refundTicketFk: newTicket.id
|
||||
}, myOptions);
|
||||
}
|
||||
|
||||
return newTicket;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue