refs #5651 packingSiteAdvanced #1615

Merged
sergiodt merged 4 commits from 5651-packingSiteAdvanced into dev 2023-06-15 11:40:43 +00:00
1 changed files with 36 additions and 28 deletions
Showing only changes of commit 927c0fddc6 - Show all commits

View File

@ -22,11 +22,21 @@ proc: BEGIN
* @param vSelf packingSite id
* @param vTicketFk A ticket id from the collection to start
*/
DECLARE vNewCollectionFk INT;
DECLARE vExists BOOL;
DECLARE vIsAdvanced BOOL;
DECLARE vNewCollectionFk INT;
DECLARE vOldCollectionFk INT;
DECLARE vIsPackingByOther BOOL;
SELECT id, collectionFk
INTO vExists, vOldCollectionFk
FROM packingSite
WHERE id = vSelf;
IF NOT vExists THEN
CALL util.throw('packingSiteNotExists');
END IF;
SELECT COUNT(*) > 0
INTO vIsAdvanced
FROM packingSiteAdvanced
@ -39,17 +49,15 @@ proc: BEGIN
SELECT collectionFk INTO vNewCollectionFk
FROM ticketCollection WHERE ticketFk = vTicketFk;
Review

açò donara fallo perque la taula ticketCollection pot tindre el ticket repetit, si te 2 quina collection vols?

açò donara fallo perque la taula ticketCollection pot tindre el ticket repetit, si te 2 quina collection vols?
Review

Creat redmine per solucionar que dos tickets estiguen en una col.lecció https://redmine.verdnatura.es/issues/5845

Creat redmine per solucionar que dos tickets estiguen en una col.lecció https://redmine.verdnatura.es/issues/5845
SELECT collectionFk INTO vOldCollectionFk
FROM packingSite WHERE id = vSelf;
IF NOT (vOldCollectionFk <=> vNewCollectionFk) THEN
IF vOldCollectionFk IS NOT NULL
AND vOldCollectionFk <> vNewCollectionFk THEN
SELECT COUNT(*) > 0
INTO vIsPackingByOther
FROM packingSite
WHERE id <> vSelf
AND collectionFk = vOldCollectionFk;
IF NOT vIsPackingByOther AND NOT collection_isPacked(vOldCollectionFk) AND vSelf IS NOT NULL THEN
IF NOT vIsPackingByOther AND NOT collection_isPacked(vOldCollectionFk) THEN
CALL util.throw('cannotChangeCollection');
END IF;
END IF;