6745-2404_testToMaster #1950

Merged
alexm merged 191 commits from 6745-2404_testToMaster into master 2024-01-25 07:39:13 +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