3520_wareshouse_back #2218

Merged
alexm merged 11 commits from 3520_wareshouse_back into dev 2024-03-28 07:16:57 +00:00
1 changed files with 7 additions and 2 deletions
Showing only changes of commit caf99a9738 - Show all commits

View File

@ -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;
};
};