Merge branch 'master' into 7773-dump
gitea/salix/pipeline/pr-master There was a failure building this commit
Details
gitea/salix/pipeline/pr-master There was a failure building this commit
Details
This commit is contained in:
commit
83fef59686
|
@ -20,9 +20,13 @@ module.exports = Self => {
|
||||||
if (typeof options == 'object')
|
if (typeof options == 'object')
|
||||||
Object.assign(myOptions, options);
|
Object.assign(myOptions, options);
|
||||||
|
|
||||||
const [, , [{collectionFk}]] =
|
const result = await Self.rawSql(`
|
||||||
await Self.rawSql('CALL vn.collection_assign(?, @vCollectionFk); SELECT @vCollectionFk collectionFk',
|
CALL vn.collection_assign(?, @vCollectionFk);
|
||||||
[userId], myOptions);
|
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');
|
if (!collectionFk) throw new UserError('There are not picking tickets');
|
||||||
await Self.rawSql('CALL vn.collection_printSticker(?, NULL)', [collectionFk], myOptions);
|
await Self.rawSql('CALL vn.collection_printSticker(?, NULL)', [collectionFk], myOptions);
|
||||||
|
|
Loading…
Reference in New Issue