20 lines
608 B
SQL
20 lines
608 B
SQL
DELIMITER $$
|
|
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`sale_calculateComponent`(vSelf INT, vOption INT)
|
|
proc: BEGIN
|
|
/**
|
|
* Crea tabla temporal para vn.sale_recalcComponent() para recalcular los componentes
|
|
*
|
|
* @param vSelf Id de la venta
|
|
* @param vOption indica en que componente pone el descuadre, NULL en casos habituales
|
|
*/
|
|
CREATE OR REPLACE TEMPORARY TABLE tmp.recalculateSales
|
|
SELECT s.id
|
|
FROM sale s
|
|
WHERE s.id = vSelf;
|
|
|
|
CALL sale_recalcComponent(vOption);
|
|
|
|
DROP TEMPORARY TABLE tmp.recalculateSales;
|
|
END$$
|
|
DELIMITER ;
|