7642_createNewState #2736

Closed
sergiodt wants to merge 32 commits from 7642_createNewState into dev
1 changed files with 10 additions and 2 deletions
Showing only changes of commit 21987011b6 - Show all commits

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