refactor: refs #6824 Throw for no delete itemShelving with itemShelvingSale #3057

Merged
guillermo merged 9 commits from 6824-itemShelvingSaleNoDelete into dev 2024-10-07 05:50:49 +00:00
2 changed files with 5 additions and 1 deletions
Showing only changes of commit 2655e20ef6 - Show all commits

View File

@ -23,7 +23,9 @@ BEGIN
DELETE FROM messageInbox WHERE sendDate < v2Months;
DELETE FROM messageInbox WHERE sendDate < v2Months;
DELETE FROM workerTimeControl WHERE timed < v4Years;
SET @canDeleteItemShelvingSale = TRUE;
DELETE FROM itemShelving WHERE created < util.VN_CURDATE() AND visible = 0;
SET @canDeleteItemShelvingSale = NULL;
DELETE FROM ticketDown WHERE created < util.yesterday();
DELETE IGNORE FROM expedition WHERE created < v26Months;
DELETE cs

View File

@ -9,7 +9,9 @@ BEGIN
FROM itemShelvingSale
WHERE itemShelvingFk = OLD.id;
IF vItemShelvingSaleExists AND @canDeleteItemShelvingSale IS NULL THEN
IF vItemShelvingSaleExists AND (NOT @canDeleteItemShelvingSale
OR @canDeleteItemShelvingSale IS NULL) THEN
CALL util.throw('Cannot delete item shelving with item shelving sale');
END IF;