3979-abonarTicketsSinAlmacen #1910

Merged
jgallego merged 8 commits from 3979-abonarTicketsSinAlmacen into dev 2024-01-11 12:39:28 +00:00
1 changed files with 4 additions and 1 deletions
Showing only changes of commit 26a05a4840 - Show all commits

View File

@ -109,7 +109,10 @@ module.exports = Self => {
const newTicket = await models.Ticket.new(ctx, myOptions);
if (negative) {
const ticketRefund = await models.TicketRefund.findOne({
where: {refundTicketFk: ticketId}
}, myOptions);
if (negative && (withWarehouse || !ticketRefund?.id)) {
await models.TicketRefund.create({
originalTicketFk: ticketId,
refundTicketFk: newTicket.id