2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
2024-07-22 09:52:42 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn-admin`@`localhost` FUNCTION `vn`.`ticketCollection_getNoPacked`(vCollectionFk INT)
|
2024-01-15 11:31:03 +00:00
|
|
|
RETURNS varchar(100) CHARSET utf8mb3 COLLATE utf8mb3_unicode_ci
|
|
|
|
DETERMINISTIC
|
|
|
|
BEGIN
|
|
|
|
|
|
|
|
/*
|
|
|
|
* return message with tickets and collection if there is tickets of a collection without expeditions
|
|
|
|
*
|
|
|
|
* @param vCollectionFk the collection to check
|
|
|
|
* @return an array with collection and tickets without expeditions
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
DECLARE vAnswer VARCHAR(100) DEFAULT '';
|
|
|
|
|
|
|
|
IF collection_isPacked(vCollectionFk) = FALSE THEN
|
|
|
|
SELECT CONCAT('Colección: ',tc.collectionFk,' Tickets: ' , GROUP_CONCAT(tc.ticketFk) ) INTO vAnswer
|
|
|
|
FROM vn.ticketCollection tc
|
|
|
|
LEFT JOIN vn.expedition e ON e.ticketFk = tc.ticketFk
|
|
|
|
WHERE tc.collectionFk = vCollectionFk
|
|
|
|
AND ISNULL(e.id);
|
|
|
|
END IF;
|
|
|
|
|
|
|
|
RETURN vAnswer;
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|