Merge pull request 'fix: refs #6861 itemShelvingSale transaction' (!2983) from 6861-itemShelvingSalesTransaction into master
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #2983 Reviewed-by: Carlos Andrés <carlosap@verdnatura.es>
This commit is contained in:
commit
ee234577a3
|
@ -48,6 +48,13 @@ proc: BEGIN
|
|||
RESIGNAL;
|
||||
END;
|
||||
|
||||
START TRANSACTION;
|
||||
|
||||
SELECT id INTO vSaleFk
|
||||
FROM sale
|
||||
WHERE id = vSaleFk
|
||||
FOR UPDATE;
|
||||
|
||||
SELECT MAX(p.pickingOrder), s.quantity - SUM(IFNULL(iss.quantity, 0)), s.quantity
|
||||
INTO vLastPickingOrder, vOutStanding, vSaleQuantity
|
||||
FROM sale s
|
||||
|
@ -58,6 +65,7 @@ proc: BEGIN
|
|||
WHERE s.id = vSaleFk;
|
||||
|
||||
IF vOutStanding <= 0 THEN
|
||||
COMMIT;
|
||||
LEAVE proc;
|
||||
END IF;
|
||||
|
||||
|
@ -85,8 +93,6 @@ proc: BEGIN
|
|||
LEAVE l;
|
||||
END IF;
|
||||
|
||||
START TRANSACTION;
|
||||
|
||||
SELECT id INTO vItemShelvingFk
|
||||
FROM itemShelving
|
||||
WHERE id = vItemShelvingFk
|
||||
|
@ -115,9 +121,8 @@ proc: BEGIN
|
|||
WHERE id = vItemShelvingFk;
|
||||
|
||||
END IF;
|
||||
|
||||
COMMIT;
|
||||
END LOOP;
|
||||
CLOSE vItemShelvingAvailable;
|
||||
COMMIT;
|
||||
END$$
|
||||
DELIMITER ;
|
Loading…
Reference in New Issue