Merge pull request 'fix: hotfix entry_splitByShelving' (!3252) from HotfixEntry_splitByShelving into master
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #3252
Reviewed-by: Carlos Andrés <carlosap@verdnatura.es>
This commit is contained in:
Carlos Andrés 2024-11-26 17:04:06 +00:00
commit ee2b5471e4
1 changed files with 2 additions and 1 deletions

View File

@ -23,12 +23,13 @@ BEGIN
LEAST(bb.stickers, FLOOR(ish.visible / ish.packing)) ishStickers,
bb.stickers buyStickers
FROM itemShelving ish
JOIN shelving sh ON sh.id = ish.shelvingFk
JOIN (SELECT b.id, b.itemFk, b.stickers
FROM buy b
WHERE b.entryFk = vFromEntryFk
ORDER BY b.stickers DESC
LIMIT 10000000000000000000) bb ON bb.itemFk = ish.itemFk
WHERE ish.shelvingFk = vShelvingCode COLLATE utf8_general_ci
WHERE sh.code = vShelvingCode COLLATE utf8_general_ci
AND NOT ish.isSplit
GROUP BY ish.id;