2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
2024-07-22 09:52:42 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`vn-admin`@`localhost` PROCEDURE `vn`.`itemPlacementFromTicket`(vTicket INT)
|
2024-01-15 11:31:03 +00:00
|
|
|
BEGIN
|
|
|
|
/**
|
|
|
|
* Llama a itemPlacementUpdateVisible
|
|
|
|
* de los articulos de la tabla temporal tmp.itemPlacement(itemFk)
|
|
|
|
* @treturn tmp.itemPlacement
|
|
|
|
* @param vTicket Id del Ticket
|
|
|
|
*/
|
|
|
|
|
|
|
|
DROP TEMPORARY TABLE IF EXISTS tmp.itemPlacement;
|
|
|
|
CREATE TEMPORARY TABLE tmp.itemPlacement
|
|
|
|
(PRIMARY KEY (itemFk))
|
|
|
|
ENGINE = MEMORY
|
|
|
|
SELECT s.itemFk
|
|
|
|
FROM ticket t
|
|
|
|
JOIN sale s ON s.ticketFk = t.id
|
|
|
|
WHERE t.id = vTicket;
|
|
|
|
|
|
|
|
CALL itemPlacementUpdateVisible();
|
|
|
|
|
|
|
|
DROP TEMPORARY TABLE tmp.itemPlacement;
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|