Merge pull request 'hotfix: Eliminar restricciones ticketRefund Ticket #187137' (!2498) from Hotfix-eliminar-restricciones-ticketRefund into master
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #2498 Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
This commit is contained in:
commit
1e15a6ed44
|
@ -1,18 +0,0 @@
|
||||||
DELIMITER $$
|
|
||||||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticketRefund_beforeUpsert`(vRefundTicketFk INT, vOriginalTicketFk INT)
|
|
||||||
BEGIN
|
|
||||||
DECLARE vAlreadyExists BOOLEAN DEFAULT FALSE;
|
|
||||||
|
|
||||||
IF vRefundTicketFk = vOriginalTicketFk THEN
|
|
||||||
CALL util.throw('Original ticket and refund ticket has same id');
|
|
||||||
END IF;
|
|
||||||
|
|
||||||
SELECT COUNT(*) INTO vAlreadyExists
|
|
||||||
FROM ticketRefund
|
|
||||||
WHERE refundTicketFk = vOriginalTicketFk;
|
|
||||||
|
|
||||||
IF vAlreadyExists > 0 THEN
|
|
||||||
CALL util.throw('This ticket is already a refund');
|
|
||||||
END IF;
|
|
||||||
END$$
|
|
||||||
DELIMITER ;
|
|
|
@ -4,6 +4,5 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`ticketRefund_beforeIn
|
||||||
FOR EACH ROW
|
FOR EACH ROW
|
||||||
BEGIN
|
BEGIN
|
||||||
SET NEW.editorFk = account.myUser_getId();
|
SET NEW.editorFk = account.myUser_getId();
|
||||||
CALL ticketRefund_beforeUpsert(NEW.refundTicketFk, NEW.originalTicketFk);
|
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
|
@ -4,6 +4,5 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`ticketRefund_beforeUp
|
||||||
FOR EACH ROW
|
FOR EACH ROW
|
||||||
BEGIN
|
BEGIN
|
||||||
SET NEW.editorFk = account.myUser_getId();
|
SET NEW.editorFk = account.myUser_getId();
|
||||||
CALL ticketRefund_beforeUpsert(NEW.refundTicketFk, NEW.originalTicketFk);
|
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
Loading…
Reference in New Issue