From caf99a97382a8bdfa9b8ac9044f67ddc31e91c52 Mon Sep 17 00:00:00 2001 From: sergiodt Date: Tue, 26 Mar 2024 11:06:14 +0100 Subject: [PATCH] refs #3520 feat:uncheckedTicket --- .../back/methods/ticket-collection/getUncheckedTicket.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/ticket/back/methods/ticket-collection/getUncheckedTicket.js b/modules/ticket/back/methods/ticket-collection/getUncheckedTicket.js index 64a4c563c..9eead967d 100644 --- a/modules/ticket/back/methods/ticket-collection/getUncheckedTicket.js +++ b/modules/ticket/back/methods/ticket-collection/getUncheckedTicket.js @@ -19,7 +19,12 @@ module.exports = Self => { } }); - Self.getUncheckedTicket = async ticketFk => { + Self.getUncheckedTicket = async(ticketFk, options) => { + const myOptions = {}; + + if (typeof options == 'object') + Object.assign(myOptions, options); + const result = await Self.rawSql(` SELECT tc2.ticketFk FROM vn.ticketCollection tc @@ -29,7 +34,7 @@ module.exports = Self => { JOIN vn.state s2 ON s2.code = 'CHECKED' WHERE tc.ticketFk = ? AND s.order < s2.id LIMIT 1;`, - [ticketFk]); + [ticketFk], myOptions); return result.length > 0 && result[0]['ticketFk'] > 0; }; };