22 lines
541 B
SQL
22 lines
541 B
SQL
DELIMITER $$
|
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_recalcComponents`(vSelf INT, vOption VARCHAR(25))
|
|
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 ;
|