fix: refs #6861 getTickets #3106

Merged
sergiodt merged 3 commits from 6861-itemShelvingSaleTickets into master 2024-10-16 05:58:53 +00:00
2 changed files with 6 additions and 4 deletions
Showing only changes of commit b592ccc162 - Show all commits

View File

@ -62,7 +62,8 @@ module.exports = Self => {
p.code parkingCodePrevia, p.code parkingCodePrevia,
p.pickingOrder pickingOrderPrevia, p.pickingOrder pickingOrderPrevia,
iss.id itemShelvingSaleFk, iss.id itemShelvingSaleFk,
iss.isPicked iss.isPicked,
iss.itemShelvingFk
FROM ticketCollection tc FROM ticketCollection tc
LEFT JOIN collection c ON c.id = tc.collectionFk LEFT JOIN collection c ON c.id = tc.collectionFk
JOIN sale s ON s.ticketFk = tc.ticketFk JOIN sale s ON s.ticketFk = tc.ticketFk
@ -102,7 +103,8 @@ module.exports = Self => {
p.code, p.code,
p.pickingOrder, p.pickingOrder,
iss.id itemShelvingSaleFk, iss.id itemShelvingSaleFk,
iss.isPicked iss.isPicked,
iss.itemShelvingFk
FROM sectorCollection sc FROM sectorCollection sc
JOIN sectorCollectionSaleGroup ss ON ss.sectorCollectionFk = sc.id JOIN sectorCollectionSaleGroup ss ON ss.sectorCollectionFk = sc.id
JOIN saleGroup sg ON sg.id = ss.saleGroupFk JOIN saleGroup sg ON sg.id = ss.saleGroupFk

View File

@ -3,10 +3,10 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` TRIGGER `vn`.`itemShelvingSale_afterI
AFTER INSERT ON `itemShelvingSale` AFTER INSERT ON `itemShelvingSale`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
UPDATE sale s UPDATE sale s
JOIN operator o ON o.workerFk = account.myUser_getId() JOIN operator o ON o.workerFk = account.myUser_getId()
SET s.isPicked = IF(o.isOnReservationMode, s.isPicked, TRUE) JOIN sector se ON s.id = o.sectorFk
sergiodt marked this conversation as resolved
Review

SET s.isPicked = IF(IFNULL(se.isOnReservationMode, o.isOnReservationMode), s.isPicked, TRUE)

Aixina és més fàcil

SET s.isPicked = IF(IFNULL(se.isOnReservationMode, o.isOnReservationMode), s.isPicked, TRUE) Aixina és més fàcil
SET s.isPicked = IF((se.isOnReservationMode IS NULL AND o.isOnReservationMode) OR se.isOnReservationMode, s.isPicked, TRUE)
WHERE id = NEW.saleFk; WHERE id = NEW.saleFk;
END$$ END$$
DELIMITER ; DELIMITER ;