This commit is contained in:
parent
bbcf71619c
commit
324875ec1f
|
@ -21,9 +21,8 @@ BEGIN
|
|||
SELECT tob.ticketFk, tob.description
|
||||
FROM vn.ticketObservation tob
|
||||
JOIN vn.ticketCollection tc ON tc.ticketFk = tob.ticketFk
|
||||
LEFT JOIN vn.observationType ot ON ot.id = tob.observationTypeFk
|
||||
WHERE ot.`code` = 'itemPicker'
|
||||
AND tc.collectionFk = vParamFk
|
||||
JOIN vn.observationType ot ON ot.id = tob.observationTypeFk AND ot.`code` = 'itemPicker'
|
||||
WHERE tc.collectionFk = vParamFk OR tc.ticketFk = vParamFk
|
||||
)
|
||||
SELECT t.id ticketFk,
|
||||
IF(!(vItemPackingTypeFk <=> 'V'), cc.code, CONCAT(SUBSTRING('ABCDEFGH', tc.wagon, 1), '-', tc.`level`)) `level`,
|
||||
|
|
|
@ -17,6 +17,8 @@ proc: BEGIN
|
|||
RESIGNAL;
|
||||
END;
|
||||
|
||||
START TRANSACTION;
|
||||
|
||||
SELECT iss.saleFk INTO vSaleFk
|
||||
FROM itemShelvingSale iss
|
||||
JOIN sale s ON s.id = iss.saleFk
|
||||
|
@ -31,11 +33,9 @@ proc: BEGIN
|
|||
WHERE saleFk = vSaleFk AND isPicked;
|
||||
|
||||
IF vHasSalesPicked THEN
|
||||
CALL util.throw('The sale can not be deleted with sales picked');
|
||||
CALL util.throw('A sale with picked sales cannot be deleted');
|
||||
END IF;
|
||||
|
||||
START TRANSACTION;
|
||||
|
||||
UPDATE itemShelvingSale iss
|
||||
JOIN itemShelving ish ON ish.id = iss.itemShelvingFk
|
||||
SET ish.available = ish.available + iss.quantity
|
Loading…
Reference in New Issue