2024-01-15 11:31:03 +00:00
|
|
|
DELIMITER $$
|
2024-01-25 16:33:54 +00:00
|
|
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_recalcComponents`(vSelf INT, vOption VARCHAR(25))
|
2024-01-15 11:31:03 +00:00
|
|
|
proc: BEGIN
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Crea tabla temporal para sale_recalcComponent() para recalcular los componentes
|
|
|
|
*
|
|
|
|
* @param vSelf Id del ticket
|
|
|
|
* @param vOption si no se quiere forzar llamar con NULL
|
|
|
|
*/
|
|
|
|
|
|
|
|
CREATE OR REPLACE TEMPORARY TABLE tmp.recalculateSales
|
|
|
|
SELECT s.id
|
|
|
|
FROM sale s
|
|
|
|
WHERE s.ticketFk = vSelf;
|
|
|
|
|
|
|
|
CALL sale_recalcComponent(vOption);
|
|
|
|
|
|
|
|
DROP TEMPORARY TABLE tmp.recalculateSales;
|
|
|
|
END$$
|
|
|
|
DELIMITER ;
|