fix: #6184 Deleted unused params
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Guillermo Bonet 2024-07-19 07:16:24 +02:00
parent dbf91293f8
commit fd2bac713d
1 changed files with 7 additions and 7 deletions

View File

@ -51,23 +51,23 @@ module.exports = Self => {
fields: ['id']
});
async function setLocation(ticketId) {
async function setLocation() {
await models.Delivery.create({
ticketFk: ticketId,
ticketFk: ticket.id,
longitude: location.Longitude,
latitude: location.Latitude,
dated: signedTime || new Date()
}, myOptions);
}
async function hasSignDms(ticketId) {
async function hasSignDms() {
const hasTicketDms = await Self.rawSql(`
SELECT d.id
FROM ticketDms td
JOIN dms d ON d.id = td.dmsFk
WHERE td.ticketFk = ?
AND d.dmsTypeFk = ?
`, [ticketId, dmsTypeTicket.id], myOptions);
`, [ticket.id, dmsTypeTicket.id], myOptions);
if (hasTicketDms.length) return true;
}
@ -133,9 +133,9 @@ module.exports = Self => {
if (await ticket.isSigned)
throw new UserError('Ticket is already signed');
if (location) await setLocation(ticketId);
if (!await hasSignDms(ticketId) && !isSignUploaded)
await createGestDoc(ticketId);
if (location) await setLocation();
if (!await hasSignDms() && !isSignUploaded)
await createGestDoc();
if (isSignUploaded)
await models.TicketDms.create({ticketFk: ticket.id, dmsFk: dms[0].id}, myOptions);
await ticket.updateAttribute('isSigned', true, myOptions);