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