8093-devToTest_2442_3 #3100

Merged
alexm merged 284 commits from 8093-devToTest_2442_3 into test 2024-10-15 06:51:43 +00:00
3 changed files with 30 additions and 0 deletions
Showing only changes of commit 0ca1db7633 - Show all commits

View File

@ -0,0 +1,26 @@
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticketRefund_upsert`(
vRefundTicketFk INT,
vOriginalTicketFk INT
)
READS SQL DATA
BEGIN
/**
* Common code for ticketRefund triggers
*
* @param vRefundTicketFk
* @param vOriginalTicketFk
*/
DECLARE vIsDeleted BOOL;
SELECT SUM(ABS(isDeleted)) INTO vIsDeleted
FROM ticket
WHERE id IN (vRefundTicketFk, vOriginalTicketFk);
IF vIsDeleted THEN
CALL util.throw('The refund ticket can not be deleted tickets');
END IF;
END$$
DELIMITER ;

View File

@ -3,6 +3,8 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`ticketRefund_beforeIn
BEFORE INSERT ON `ticketRefund`
FOR EACH ROW
BEGIN
CALL ticketRefund_upsert(NEW.refundTicketFk, NEW.originalTicketFk);
SET NEW.editorFk = account.myUser_getId();
END$$
DELIMITER ;

View File

@ -3,6 +3,8 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`ticketRefund_beforeUp
BEFORE UPDATE ON `ticketRefund`
FOR EACH ROW
BEGIN
CALL ticketRefund_upsert(NEW.refundTicketFk, NEW.originalTicketFk);
SET NEW.editorFk = account.myUser_getId();
END$$
DELIMITER ;