7806_devToTest_2332 #2801

Merged
alexm merged 126 commits from 7806_devToTest_2330 into test 2024-07-30 06:14:09 +00:00
1 changed files with 7 additions and 3 deletions
Showing only changes of commit bc49600e21 - Show all commits

View File

@ -20,9 +20,13 @@ module.exports = Self => {
if (typeof options == 'object')
Object.assign(myOptions, options);
const [, , [{collectionFk}]] =
await Self.rawSql('CALL vn.collection_assign(?, @vCollectionFk); SELECT @vCollectionFk collectionFk',
[userId], myOptions);
const result = await Self.rawSql(`
CALL vn.collection_assign(?, @vCollectionFk);
SELECT @vCollectionFk collectionFk
`, [userId], myOptions);
// Por si entra en el SELECT FOR UPDATE y retorna un array más
const collectionFk = result[2][0]?.collectionFk || result[3][0]?.collectionFk;
if (!collectionFk) throw new UserError('There are not picking tickets');
await Self.rawSql('CALL vn.collection_printSticker(?, NULL)', [collectionFk], myOptions);