refs #6915 test_master24_8 #2067

Merged
alexm merged 561 commits from test_master24_8 into master 2024-02-22 07:31:34 +00:00
1 changed files with 8 additions and 5 deletions
Showing only changes of commit d5a145ba1b - Show all commits

View File

@ -59,16 +59,18 @@ module.exports = Self => {
async function hasSignDms(ticketId) {
const ticketDms = await models.TicketDms.findOne({
where: {ticketFk: ticketId},
where: {
ticketFk: ticketId
},
fields: ['dmsFk'],
include: [{
relation: 'dms',
where: {
dmsType: dmsTypeTicket.id
scope: {
where: {dmsType: dmsTypeTicket.id}
}
}]
}, myOptions);
if (ticketDms) return true;
if (ticketDms.dms().id) return true;
}
async function createGestDoc(id) {
@ -132,7 +134,8 @@ module.exports = Self => {
throw new UserError('Ticket is already signed');
if (location) setLocation(ticketId);
if (!await hasSignDms(ticketId)) createGestDoc(ticketId);
if (!await hasSignDms(ticketId))
createGestDoc(ticketId);
await ticket.updateAttribute('isSigned', true, myOptions);
const deliveryState = await models.State.findOne({