feat: refs #7685 changes required
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Robert Ferrús 2024-07-11 11:43:19 +02:00
parent f3d96f178f
commit cb0461b241
3 changed files with 14 additions and 13 deletions

View File

@ -5,11 +5,11 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`address_updateCoord
vLatitude INT)
BEGIN
/**
* Actualiza las coordenadas de una direccion
* Actualiza las coordenadas de una dirección
*
* @param vTicketFk id del ticket
* @param vLongitude longitud de la direccion
* @param vLatitude latitud de la dirrecion
* @param vTicketFk Id del ticket
* @param vLongitude Longitud de la dirección
* @param vLatitude Latitud de la dirección
*/
DECLARE vAddressFK INT;
@ -21,6 +21,5 @@ BEGIN
SET longitude = vLongitude,
latitude = vLatitude
WHERE id = vAddressFK;
END$$
DELIMITER ;

View File

@ -3,10 +3,11 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`delivery_beforeInsert
BEFORE INSERT ON `delivery`
FOR EACH ROW
BEGIN
IF (NEW.longitude IS NOT NULL AND NEW.latitude IS NOT NULL AND NEW.ticketFK IS NOT NULL) THEN
CALL address_updateCoordinates(NEW.ticketFk,NEW.longitude,NEW.latitude);
IF (NEW.longitude IS NOT NULL
AND NEW.latitude IS NOT NULL
AND NEW.ticketFK IS NOT NULL)
THEN
CALL address_updateCoordinates(NEW.ticketFk, NEW.longitude, NEW.latitude);
END IF;
END$$
DELIMITER ;

View File

@ -3,10 +3,11 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`delivery_beforeUpdate
BEFORE UPDATE ON `delivery`
FOR EACH ROW
BEGIN
IF (NEW.longitude IS NOT NULL AND NEW.latitude IS NOT NULL AND NEW.ticketFK IS NOT NULL) THEN
CALL address_updateCoordinates(NEW.ticketFk,NEW.longitude,NEW.latitude);
IF (NEW.longitude IS NOT NULL
AND NEW.latitude IS NOT NULL
AND NEW.ticketFK IS NOT NULL)
THEN
CALL address_updateCoordinates(NEW.ticketFk, NEW.longitude, NEW.latitude);
END IF;
END$$
DELIMITER ;