7691-testToMaster #2703

Merged
alexm merged 268 commits from 7691-testToMaster into master 2024-07-09 05:38:28 +00:00
8 changed files with 33 additions and 70 deletions
Showing only changes of commit 6db1696094 - Show all commits

View File

@ -5,7 +5,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`itemShelvingSale_ad
) )
BEGIN BEGIN
/** /**
* Guarda la ubicación para el contenido de una colección * Reserva cantidades con ubicaciones para el contenido de una colección
* *
* @param vCollectionFk Identificador de collection * @param vCollectionFk Identificador de collection
*/ */

View File

@ -1,27 +0,0 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`itemShelving_AFTER_INSERT`
AFTER INSERT ON `itemShelving`
FOR EACH ROW
BEGIN
INSERT INTO vn.itemShelvingLog(
itemShelvingFk,
workerFk,
accion,
itemFk,
shelvingFk,
visible,
`grouping`,
packing,
available)
VALUES( NEW.id,
NEW.userFk,
'CREA REGISTRO',
NEW.itemFk,
NEW.shelvingFk,
NEW.visible,
NEW.`grouping`,
NEW.packing,
NEW.available);
END$$
DELIMITER ;

View File

@ -1,16 +0,0 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`itemShelving_AFTER_UPDATE`
AFTER UPDATE ON `itemShelving`
FOR EACH ROW
BEGIN
INSERT INTO itemShelvingLog
SET itemShelvingFk = NEW.id,
workerFk = account.myUser_getId(),
accion = 'CAMBIO',
itemFk = NEW.itemFk,
shelvingFk = NEW.shelvingFk,
visible = NEW.visible,
`grouping` = NEW.`grouping`,
packing = NEW.packing;
END$$
DELIMITER ;

View File

@ -1,10 +0,0 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`itemShelving_BEFORE_INSERT`
BEFORE INSERT ON `itemShelving`
FOR EACH ROW
BEGIN
SET NEW.editorFk = account.myUser_getId();
SET NEW.userFk = account.myUser_getId();
SET NEW.available = NEW.visible;
END$$
DELIMITER ;

View File

@ -1,22 +1,27 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`itemShelving_afterInsert` CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`itemShelving_AFTER_INSERT`
AFTER INSERT ON `itemShelving` AFTER INSERT ON `itemShelving`
FOR EACH ROW FOR EACH ROW
INSERT INTO vn.itemShelvingLog( itemShelvingFk, BEGIN
workerFk,
accion, INSERT INTO vn.itemShelvingLog(
itemFk, itemShelvingFk,
shelvingFk, workerFk,
visible, accion,
`grouping`, itemFk,
packing) shelvingFk,
VALUES( NEW.id, visible,
`grouping`,
packing,
available)
VALUES( NEW.id,
NEW.userFk, NEW.userFk,
'CREA REGISTRO', 'CREA REGISTRO',
NEW.itemFk, NEW.itemFk,
NEW.shelvingFk, NEW.shelvingFk,
NEW.visible, NEW.visible,
NEW.`grouping`, NEW.`grouping`,
NEW.packing NEW.packing,
)$$ NEW.available);
DELIMITER ; END$$
DELIMITER ;

View File

@ -1,8 +1,9 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`itemShelving_afterUpdate` CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`itemShelving_AFTER_UPDATE`
AFTER UPDATE ON `itemShelving` AFTER UPDATE ON `itemShelving`
FOR EACH ROW FOR EACH ROW
INSERT INTO itemShelvingLog BEGIN
INSERT INTO itemShelvingLog
SET itemShelvingFk = NEW.id, SET itemShelvingFk = NEW.id,
workerFk = account.myUser_getId(), workerFk = account.myUser_getId(),
accion = 'CAMBIO', accion = 'CAMBIO',
@ -10,5 +11,8 @@ INSERT INTO itemShelvingLog
shelvingFk = NEW.shelvingFk, shelvingFk = NEW.shelvingFk,
visible = NEW.visible, visible = NEW.visible,
`grouping` = NEW.`grouping`, `grouping` = NEW.`grouping`,
packing = NEW.packing$$ packing = NEW.packing,
available = NEW.available;
END$$
DELIMITER ; DELIMITER ;

View File

@ -5,6 +5,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`itemShelving_beforeIn
BEGIN BEGIN
SET NEW.editorFk = account.myUser_getId(); SET NEW.editorFk = account.myUser_getId();
SET NEW.userFk = account.myUser_getId(); SET NEW.userFk = account.myUser_getId();
SET NEW.available = NEW.visible;
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -3,9 +3,15 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`itemShelving_beforeUp
BEFORE UPDATE ON `itemShelving` BEFORE UPDATE ON `itemShelving`
FOR EACH ROW FOR EACH ROW
BEGIN BEGIN
SET NEW.editorFk = account.myUser_getId(); SET NEW.editorFk = account.myUser_getId();
IF NEW.userFk IS NULL THEN IF NEW.userFk IS NULL THEN
SET NEW.userFk = account.myUser_getId(); SET NEW.userFk = account.myUser_getId();
END IF; END IF;
IF (NEW.visible <> OLD.visible) THEN
SET NEW.available = GREATEST(NEW.available + NEW.visible - OLD.visible, 0);
END IF;
END$$ END$$
DELIMITER ; DELIMITER ;