feat itemShelvingSale refs #6861
gitea/salix/pipeline/pr-master This commit looks good Details

This commit is contained in:
Sergio De la torre 2024-07-12 09:06:05 +02:00
parent 69bcad9ce0
commit 21987011b6
1 changed files with 10 additions and 2 deletions

View File

@ -33,8 +33,16 @@ BEGIN
CALL util.throw('Reservation completed');
END IF;
SELECT s.itemFk, iss.saleFk, iss.itemShelvingFk, SUM(IFNULL(iss.quantity,0)), IF(sgd.id, 'PREVIOUS_PREPARATION', 'PREPARED') vStateCode
INTO vItemFk, vSaleFk, vItemShelvingFk, vReservedQuantity, vStateCode
SELECT s.itemFk,
iss.saleFk,
iss.itemShelvingFk,
SUM(IFNULL(iss.quantity,0)),
IF(sgd.id, 'PREVIOUS_PREPARATION', 'PREPARED')
INTO vItemFk,
vSaleFk,
vItemShelvingFk,
vReservedQuantity,
vStateCode
FROM itemShelvingSale iss
JOIN sale s ON s.id = iss.saleFk
LEFT JOIN vn.saleGroupDetail sgd ON sgd.saleFk = iss.saleFk