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`.`sale_calculateComponent`(vSelf INT, vOption VARCHAR(25))
|
2024-01-15 11:31:03 +00:00
|
|
|
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
|
2024-01-25 16:33:54 +00:00
|
|
|
*/
|
|
|
|
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;
|
2024-01-15 11:31:03 +00:00
|
|
|
END$$
|
|
|
|
DELIMITER ;
|